Creates a git commit with a CRAFT-context-aware commit message
The AI stages your modified files, generates a descriptive message that includes what changed and why, commits, runs a post-commit review, and optionally pushes to GitHub with automatic token scrub. Other recipes call this one automatically โ you rarely need to invoke it directly.
Cowork Git Checkpoint
TL;DR
How To Start
STEP 1Tell the AI What You Are Committing
-
commit_context
· string · required
Brief context for the commit message — a handoff ID, recipe executed, or description of changes (e.g., “Handoff H003” or “Updated roadmap after SP10 review”). -
files_to_stage
· list · optional · default: auto-detect modified
Specific files to stage. If not provided, the AI stages all modified tracked files matching CRAFT project patterns. -
push_to_github
· boolean · optional · default: false
Whether to push to GitHub after committing. Requires a configured remote and a Personal Access Token. -
called_by
· string · optional
Recipe ID that triggered this checkpoint. When provided, auto-generates a commit message prefix: CWK-002 produces “Handoff {context}”, CWK-003 produces “Checkpoint — {context}”, CWK-007 produces “CLAUDE.md generated — {context}.” Standalone calls use commit_context as-is.
STEP 2Review the Commit Result
STEP 3Address Any Post-Commit Review Findings
STEP 4Confirm Optional Push
Usage Examples
How AI Reads This Recipe
- CHECK git status and clean up any stale index.lock file before proceeding — stale locks from sandbox crashes are a recurring pattern.
- CAPTURE a before-state snapshot (HEAD, porcelain status, staged files) for post-commit state-diff verification.
- STAGE files using CRAFT-aware patterns — match project files, cookbooks, handoff logs, CLAUDE.md, manifests, and recipe indexes. Use folder-qualified glob patterns that work with both flat and migrated directory structures.
- GENERATE a commit message with an auto-prefix when called_by is provided (Handoff, Checkpoint, CLAUDE.md generated) and include a Co-Authored-By line.
- COMMIT and capture the resulting hash.
- RUN state-diff verification comparing before and after snapshots to confirm the commit produced the expected result with no unintended side effects.
- TRIGGER post-commit file review — use blocking mode when committed files include critical CRAFT files (cookbooks, handoff logs, CLAUDE.md, roadmap). HALT the workflow if blocking review returns CRITICAL findings.
- PUSH to GitHub only when requested, with immediate token scrub after successful push.
When to Use This Recipe
- Need to commit changes during a session — either standalone or through another recipe that calls it automatically.
- Want to create a versioned checkpoint before making significant changes to your project.
- Are closing a session via Handoff (CWK-002) or Mid-Session Checkpoint (CWK-003), which call this recipe internally.
- Need to push committed changes to GitHub with secure token handling.
- Want to verify that a commit produced exactly the expected result via state-diff verification.
Recipe FAQ
Q.Do I need to call this recipe directly?
Q.What is the state-diff verification?
Q.What triggers blocking mode for the post-commit review?
Q.What happens if blocking review finds a problem?
Q.What is the index.lock cleanup?
Q.How does the commit message auto-prefix work?
Q.Can I push to multiple remotes?
Version History
Get this recipe with CRAFT for Claude Cowork
Cowork recipes ship bundled with CRAFT for Claude Cowork — there’s no separate download. Clone the framework once, and your AI runs every recipe automatically when invoked.
Pull anytime to stay on the latest version — free to clone, no login or email required.
Then start your session
Once CRAFT is in your project folder, open a new Cowork session and ask Claude to initialize. For example:
You
Claude
Not familiar with Git? Download as a ZIP
No command line needed. Just download, move, and unzip:
- Open the CRAFT framework repo on GitHub.
- Click the green Code button, then choose Download ZIP.
- Move the downloaded ZIP into your Claude Cowork project folder.
- Unzip it: double-click on Mac, or right-click → Extract All on Windows.
