Add the chunk validate Stop hook - #1739
Open
jesseworld22 wants to merge 1 commit into
Open
Conversation
.chunk/config.json configures a remote sidecar (validation.sidecarImage), but .claude/settings.json has no Stop hook, so nothing runs chunk validate when an agent session ends. The repo looks fully configured while getting no end-of-session validation. The cause was a bug in chunk init's settings merge: on a repo that already had a .claude/settings.json it merged the PreToolUse hooks and dropped the Stop hook on the floor. That is fixed in CircleCI-Public/chunk-cli#500; this restores the hook here. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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 the missing
Stophook to.claude/settings.jsonsochunk validateruns at the end of an agent coding session.Why
This repo's
.chunk/config.jsonconfigures a remote sidecar (validation.sidecarImage), but.claude/settings.jsonhas noStopblock. Nothing runschunk validatewhen a session ends, so the repo looks fully configured while getting no end-of-session validation.The cause was a bug in
chunk init's settings merge:MergehandledpermissionsandPreToolUsebut never calledmergeStopHooks(only the Codex path did). On a repo that already had a.claude/settings.json, init merged the commit hooks and dropped theStophook. That is fixed in CircleCI-Public/chunk-cli#500 so it cannot recur; this PR restores the hook here.The 420s timeout matches what
chunk initcomputes for this repo's commands (30s buffer + 300 + 60 + 30).Separate issue, not fixed here
While verifying, I noticed the existing
PreToolUsegroup uses the legacy group-level matcher"Bash(git commit*)". Per the fix in CircleCI-Public/chunk-cli#484,matcherfilters on tool name, so this group likely never fires either — the current form should be"matcher": "Bash"with a per-entry"if": "Bash(git commit*)". Its commands have also drifted from.chunk/config.json(task check/task fixhere vstask lint/task fmtin the config).I deliberately left that out to keep this PR to the Stop hook. Happy to send a follow-up.
🤖 Generated with Claude Code