// Compact context at natural breakpoints to free tokens and continue working. Use PROACTIVELY at phase boundaries, after commits, or when token usage >150k. Better than random auto-compact. Supports custom compaction prompts.
| name | claude-restart-compact |
| description | Compact context at natural breakpoints to free tokens and continue working. Use PROACTIVELY at phase boundaries, after commits, or when token usage >150k. Better than random auto-compact. Supports custom compaction prompts. |
Compacting context at natural breakpoint and resuming work...
This will:
Use at logical stopping points rather than letting Claude auto-compact randomly:
After completing a phase:
At project boundaries:
Before running out of space:
Benefits over auto-compact:
Basic (default compaction):
.claude/skills/claude-restart-resume/scripts/claude-restart.sh compact
With custom prompt (guides what to preserve):
# Set compaction prompt before invoking
export COMPACT_PROMPT="Preserve: API design decisions, database schema, known bugs"
.claude/skills/claude-restart-resume/scripts/claude-restart.sh compact
Custom prompts help preserve important context:
# Keep technical decisions
COMPACT_PROMPT="Preserve architectural decisions and open technical questions"
# Keep project state
COMPACT_PROMPT="Preserve TODO list state, recent commits, and next steps"
# Keep domain knowledge
COMPACT_PROMPT="Preserve domain model, business rules, and API contracts"
The script will pass this to Claude during compaction to guide summarization.