Smart commit — run tests, update docs and memory, then commit to ensure knowledge is not lost
Execute the smart commit flow. Core principle: commit code and knowledge together.
Check the test command in CLAUDE.md and execute it. If tests fail, stop the commit and report. Skip this step for projects with no configured test command.
Check each in order (simple changes may skip):
docs/progress.md — Does this change constitute a milestone or significant progress? If so, append a record. Also check the "Working Context" section: are Key Commands, Current Workflow, Tools & Scripts, Environment State, and Gotchas up to date? These are your lifeline after compact — if they're stale, a post-compact Claude starts from scratch.
docs/debug-log.md — Are there debug sessions that need to be closed or updated?
CLAUDE.md — Are there new components, interfaces, known pitfalls, or architectural changes to sync? Did you create any helper scripts or tools this session? If so, register them in the "Project Tools" section of CLAUDE.md NOW — not in progress.md (which is ephemeral), but in CLAUDE.md (which is permanent).
— Are there cross-session lessons worth remembering? (bug patterns, API pitfalls, debugging tips) Update memory files, keeping MEMORY.md under 200 lines.
git status
git diff --staged && git diff
git log --oneline -5
git add (don't use git add -A)