Repository navigation
feat(hook): user-prompt-submit /rename nudge — 0.14.0 - #16
Merged
Merged
Conversation
Peers can only @-address a session whose name a human chose with /rename. New `agentctl hook user-prompt-submit` reads Claude Code's own sessions/<pid>.json record: while nameSource is `derived` it asks the model, from the 2nd prompt on, to propose a kebab name, run `agentctl name` and end the reply with `Rename: **/rename <name>**`. Once renamed it prints nothing and syncs the Agentctl name to the /rename name. No network, no model call. session-start drops its "no Agentctl name" nudge when the registry tracks /rename for the session; older Claude Code keeps it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Peers can only @-address a Claude Code session whose name a human chose with
/rename; derived names are withheld. This adds a deterministic nudge.agentctl hook user-prompt-submit(registered by theagentctl-sessionsplugin 0.3.0 as aUserPromptSubmithook)<profile>/sessions/<pid>.jsonrecord (nameSource,name,kind); no network, no model call, ~30 ms.nameSource: derived, 2nd prompt or later (per-session counter in$TMPDIR/agentctl-prompts/) → one line of context: propose a kebab name, runagentctl name "<name>", end the reply withRename: **/rename <name>**.derived) → prints nothing; syncs the Agentctl name to the/renamename when they differ.interactive/ nonameSource/ junk input → silent, exit 0.agentctl hook session-startdrops its "no Agentctl name" nudge when the registry tracks/rename(the prompt hook covers naming); older Claude Code keeps it.registryEntry()is a separate reader fromreadLiveSessions()because the latter keeps only busy/idle and a session running a!command reportsshell.Tests: 229 pass (new: named / derived 1st / derived 2nd / missing entry / non-interactive / junk / name sync; registry reader newest-wins + status-agnostic; counter). Typecheck + build clean.
Live check: real interactive Claude Code 2.1.318 scratch session: prompt 1 silent, prompt 2 nudge injected (
hook_successUserPromptSubmit), after/renamesilent + agentctl name synced; SessionStart no longer printed the old nudge.Also bumps to 0.14.0 (package.json, lock, CHANGELOG) and adds the hook to the README plugin section.
🤖 Generated with Claude Code