Close Build
Merge to main and clean up. Closure gates run automatically via the PreToolUse hook.
Default behavior
bash1python3 scripts/workflow/close_build.py
This runs:
- squash merge to
main, - local cleanup (branch delete + active context clear).
Note: targeted closure tests and doc stewardship are enforced by the
.claude/hooks/close-build-gate.sh PreToolUse hook on git merge/git push.
They no longer need to be invoked manually.
Dry run (gates only)
bash1python3 scripts/workflow/closure_gate.py
Use to check gate status without merge/cleanup. Returns JSON verdict.
No cleanup mode
bash1python3 scripts/workflow/close_build.py --no-cleanup
Use when you need to keep branch/context after merge.
Git worktree constraint
Run close_build.py (and underlying closure_pack.py) from the worktree directory, not the primary repo.
When main is already checked out in the primary worktree, the script
detects this automatically (via git branch --show-current on the repo root)
and skips the checkout main step. The merge proceeds against the primary
worktree's main directly.
If you accidentally run from the primary repo on a scoped branch, it hard-blocks
with ISOLATION_REQUIRED. Recover in one command:
bash1python3 scripts/workflow/start_build.py --recover-primary
Report contract (strict)
Output must use this section order:
BranchCommitsTest ResultsWhat Was DoneWhat Remains