Repository navigation
feat(hooks): loop/goal instruction-review hook - #16
Merged
Merged
Conversation
New UserPromptSubmit hook suggest-loop-improvements.sh. When the user runs /loop or /goal, it injects an instruction so Claude proposes 2-3 improved, drop-in replacements for the command and presents them via AskUserQuestion (A/B/C plus "Run original unchanged") - the user picks one, no copy-paste, and only the selected command runs. The hook does no LLM work and spawns no nested session: it only injects context, so the running model generates the variants. Fast, no API key, non-blocking (exit 0) - a silent no-op for every other prompt, for already- precise commands, and in headless sessions. Wired into hooks.json (plugin) and install.sh (jq-merge), documented in hooks/README.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The suggest-loop-improvements README claimed the interactive picker works for both /loop and /goal. It does not: /goal is a client-side local command whose effect runs at submit time, before Claude's turn, so an advisory (exit 0) injection cannot intercept it. Document the model-driven vs client-side distinction so the behavior is not misrepresented. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add suggest-loop-improvements.sh to the hook lists in AGENT.md, skills/new-project/SKILL.md, and the README wiring summary, and to the manual settings.json example in TEAM.md. Bump VERSION and both plugin manifests 0.4.3 -> 0.4.4 for the new hook. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
/goal is a client-side local command whose effect runs at submit time, before Claude's turn, so an advisory injection can't gate it (as observed in practice). Drop /goal from the matcher, rename the injected tag to <loop-review>, and align statusMessages and docs to /loop only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sneg55
marked this pull request as ready for review
July 1, 2026 21:42
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.
What
Adds a new
UserPromptSubmithook,hooks/suggest-loop-improvements.sh. When the user runs/loopor/goal, it injects an instruction so Claude:AskUserQuestiontool as an interactive picker: A / B / C plus "Run original unchanged".How
UserPromptSubmithas no matcher, so it filters by prompt text (/loop*//goal*) and is a silent no-op for every other prompt.Wiring
hooks/hooks.json— plugin manifest (${CLAUDE_PLUGIN_ROOT}).install.sh— jq-merge into~/.claude/settings.json(idempotent).hooks/README.md— documented under Available Hooks.Test
Already wired into this machine's global
~/.claude/settings.jsonfor dogfooding.Notes
VERSION+ plugin manifests in a dedicated release PR, so I left that for the release step./goalisn't a command shipped by this repo, but the hook matches its text harmlessly if you have one defined elsewhere.🤖 Generated with Claude Code