Repository navigation
Releases
Releases · maximtop/opencode-session-namer
v0.4.0
v0.3.0
v0.2.0
v0.1.1
v0.1.0
First release.
What it does
Renames an opencode session once, right after the first user message:
- First message referencing a GitHub PR →
[repo] KEY-123 Review pull/N <PR title>. Full URLs with any suffix (…/pull/N/changes,#diff…,?…) and the shortowner/repo#Nform are detected; short forms are verified viagh(file references likesrc/rename.ts#42are dropped). WithprLinkLlmon, a small locked-down child session can extract a PR reference mentioned without a link. - Otherwise, inside a git project →
[project] KEY-123 <opencode auto-title>; the issue key comes from the branch in.git/HEAD. Linked worktrees resolve to the main repo name + worktree branch key. - Overlong titles are shortened deterministically, or via the configured
small_modelwhensmartShortenis on.
Safety
- Renames exactly once per session — the state file survives restarts.
- A title set by hand or by another tool is never replaced; a late re-write of the recorded auto-title is corrected at most once, before the first idle.
ghis pinned togithub.com— a PR URL from an untrusted message can never redirect your token to another host (GHES deliberately unsupported).- Deterministic by default; optional LLM modes run in throwaway child sessions with all tools disabled.
Install
From a checkout:
git clone https://github.com/maximtop/opencode-session-namer
cd opencode-session-namer
pnpm install
ln -s "$PWD/src/index.ts" ~/.config/opencode/plugins/session-namer.tsnpm install ("plugin": ["@maximtop/opencode-session-namer"]) lands with the first npm publish. Config: ~/.config/opencode/session-namer.json — all keys optional, see README. PR-based naming needs the gh CLI; without it the plugin degrades to project naming.
Full changelog: initial implementation — 54 review findings addressed across 3 review rounds.