analyze
CommandAnalyze user corrections and log them into the error notebook
Help decide when to use `/compact` based on the current conversation state.
Help decide when to use `/compact` based on the current conversation state.
| Situation | Compact? | Why | | :-------- | :------- | :-- | | Research/exploration done, ready to build | Yes | Research context is large; the plan is what matters | | Planning done, starting to code | Yes | Plan is already in TodoWrite or a file | | Debug session finished | Yes | Debug logs pollute the next task's context | | Switching to a completely different task | Yes | Clear irrelevant context | | Deployment done, starting new feature | Yes | Deployment logs aren't needed anymore |
| Situation | Why | | :-------- | :-- | | In the middle of writing code | Lose variable names, file paths, partial state | | Debugging an unresolved issue | Lose error messages and attempted solutions | | Multi-file refactor in progress | Forget which files still need changes | | Just read an important doc, about to reference it | Doc content gets summarized away |
When context usage exceeds 60%, proactively suggest whether compacting is appropriate based on the current task state.
Claude Code 的記憶系統 | A memory system built with hooks + markdown. Zero dependencies.
Analyze user corrections and log them into the error notebook
Pause the SessionEnd auto-commit hook when refactoring core engine files.
Review the error notebook — flip through past corrections before working
Generate a reflection diary entry from the current conversation.
Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.