/compact — Context Preservation
Preserve working state before context window compaction.
Procedure
- •
Capture current state — summarize in a structured block:
- •What task is in progress
- •What files have been modified (list with brief description of changes)
- •What's left to do
- •Any decisions made during this session
- •Current git branch and status
- •
Write to memory — save the summary to the project memory directory:
code/Users/james/.claude/projects/-Users-james-Repos-wibandwob-dos/logs/memory/
Use filename
compact-{date}.md. - •
Output the summary so it survives compaction in the conversation.
Format
markdown
# Context Snapshot — {date} {time}
## Active Task
{what we're working on}
## Modified Files
- `path/to/file` — {what changed}
## Decisions Made
- {decision and rationale}
## Remaining Work
- [ ] {next step}
## Git State
Branch: {branch}
Status: {clean/dirty, uncommitted files}