Suggests manual /compact at strategic workflow points to preserve context through task phases. Use when approaching context limits, completing major milestones, or before context shifts. Triggers include high tool call counts, after planning phases, or before major implementation work.
Resources
1Install
npx skillscat add ven0m0/claude-config/compacting-context-strategically Install via the SkillsCat registry.
SKILL.md
Strategic Compact Skill
Suggests manual /compact at strategic workflow points rather than relying on arbitrary auto-compaction.
Why Strategic Compaction?
Auto-compaction triggers at arbitrary points, often mid-task, losing important context. Strategic compaction at logical boundaries preserves what matters:
| Timing | Benefit |
|---|---|
| After exploration, before execution | Compact research context, keep implementation plan |
| After completing a milestone | Fresh start for next phase |
| Before major context shifts | Clear exploration context before different task |
How It Works
The suggest-compact.sh script runs on PreToolUse (Edit/Write) and:
- Tracks tool call invocations in session
- Suggests at configurable threshold (default: 50 calls)
- Reminds every 25 calls after threshold
Hook Setup
Add to ~/.claude/settings.json:
{
"hooks": {
"PreToolUse": [{
"matcher": "tool == \"Edit\" || tool == \"Write\"",
"hooks": [{
"type": "command",
"command": "~/.claude/skills/strategic-compact/suggest-compact.sh"
}]
}]
}
}Configuration
Environment variables:
COMPACT_THRESHOLD- Tool calls before first suggestion (default: 50)