Skip to content

chunk fix command, git pre-push hook model, session-scoped sidecar state - #491

Draft
schurchleycci wants to merge 4 commits into
mainfrom
chunk-fix
Draft

chunk fix command, git pre-push hook model, session-scoped sidecar state#491
schurchleycci wants to merge 4 commits into
mainfrom
chunk-fix

Conversation

@schurchleycci

@schurchleycci schurchleycci commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Split commands[] into fix[] and validate[]; legacy configs migrate automatically on load
  • Add chunk fix command — runs formatters locally, fired by a PostToolUse(Edit|Write) hook
  • Replace chunk hook sentinel file with a real .git/hooks/pre-push; chunk init now installs it
  • Remove PreToolUse validate hook and pre-commit git hook — validation is pre-push only
  • Restore session-scoped sidecar state via a SessionStart hook that persists the Claude session ID

Test plan

  • task test passes
  • chunk init writes SessionStart + PostToolUse hooks (no PreToolUse) and installs .git/hooks/pre-push
  • chunk fix runs formatters; chunk fix <name> runs one by name; no-config case returns clear error
  • chunk hook enable/disable/status manage .git/hooks/pre-push correctly

🤖 Generated with Claude Code

schurchleycci and others added 4 commits August 11, 2026 09:03
…ed sidecar state

- Split config schema: unified commands[] → separate fix[] and validate[] arrays
  with automatic migration from the legacy format on load
- Add chunk fix command for running formatters and file-rewriting tools locally
- Replace the .chunk/hooks-disabled sentinel model with a real git pre-push hook:
  chunk hook enable/disable/status now manage .git/hooks/pre-push directly,
  including worktree support via git rev-parse --git-common-dir
- Remove Stop hook and Claude session detection from chunk validate; the
  stdin-sniffing approach was the source of the awkward stdout→stderr rerouting
  and attempt-tracking machinery (attempts.go deleted)
- Restore per-session sidecar isolation via a new SessionStart hook:
  chunk session start reads the Claude Code SessionStart payload and persists the
  session_id to the project data dir; chunk validate reads it back and injects it
  into context so LoadActive/SaveActive continue to namespace state files by session
- settings.Build now emits SessionStart, PreToolUse, and PostToolUse hooks;
  merge logic updated to handle the matcher-less SessionStart group

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove PreToolUse hook from Build/BuildCodex; validation no longer runs
  as a Claude hook, only via the git pre-push hook
- chunk init now installs the pre-push git hook instead of pre-commit;
  writeGitHook/gitHookContent removed, writePrePushHook delegates to a
  new shared installPrePushHook helper in hook.go
- Build/BuildCodex signatures drop the validate parameter; SessionStart
  and PostToolUse hooks only emitted when fix commands are configured
- Fix goconst (session/start constants), unparam (findGitRootFrom returns
  string, not (string, error))

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Always emit SessionStart hook from Build(), not only when fix commands
  exist — projects without fix commands were getting branch-based sidecar
  naming, causing concurrent sessions to compete for the same sidecar
- Expand {{CHANGED_PACKAGES}} in RunInline so chunk validate --cmd
  honours the template the same way RunAll/RunNamed do
- Remove stale Stop-hook reference from MergeCodex doc comment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jesseworld22 added a commit that referenced this pull request Aug 13, 2026
The getting-started guide walked new users through build-prompt and code
review as its numbered path, with sidecars below it under a heading still
marked '(preview)'. Someone following the steps in order never touched a
sidecar. README framed the two as co-equal capabilities.

Restructure so the sidecar loop is the primary path:

- GETTING_STARTED: sidecar creation and the dev loop become Steps 3 and 4,
  skills become Step 5, and build-prompt/review move below the sidecar
  material as 'Team review context'. Drop the '(preview)' label. Group the
  detail sections under a 'Sidecar reference' heading. Lead the auth step
  with CircleCI, since that is what sidecars need.
- README: drop the 'two main capabilities' framing, move context generation
  below the sidecar quick start.
- AGENTS.md: describe sidecars as the primary capability.
- SKILLS.md: lead the intro with sidecar setup and the dev loop, and point
  first-time readers at chunk-sidecar-setup.

Also adds the chunk-sidecar-setup skill to the getting-started skills table,
which listed only four of the five installed skills.

Command-level details in 'Environment setup', 'Syncing', 'First-time sidecar
setup', and 'Hook behavior' are left alone pending #438, #462, #491, and #501,
which change those commands.

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