Skip to content

Add the chunk validate Stop hook - #1739

Open
jesseworld22 wants to merge 1 commit into
mainfrom
jesse/chunk-stop-hook
Open

Add the chunk validate Stop hook#1739
jesseworld22 wants to merge 1 commit into
mainfrom
jesse/chunk-stop-hook

Conversation

@jesseworld22

Copy link
Copy Markdown

What

Adds the missing Stop hook to .claude/settings.json so chunk validate runs at the end of an agent coding session.

Why

This repo's .chunk/config.json configures a remote sidecar (validation.sidecarImage), but .claude/settings.json has no Stop block. Nothing runs chunk validate when 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: Merge handled permissions and PreToolUse but never called mergeStopHooks (only the Codex path did). On a repo that already had a .claude/settings.json, init merged the commit hooks and dropped the Stop hook. 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 init computes for this repo's commands (30s buffer + 300 + 60 + 30).

Separate issue, not fixed here

While verifying, I noticed the existing PreToolUse group uses the legacy group-level matcher "Bash(git commit*)". Per the fix in CircleCI-Public/chunk-cli#484, matcher filters 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 fix here vs task lint/task fmt in 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

.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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant