
Strategic Compact
Instead of letting Claude's auto-compaction fire mid-task and lose your context at the worst possible moment, this skill tracks your tool usage and suggests manual compaction at logical boundaries. It reminds you after 50 tool calls (configurable) to consider compacting, but leaves the decision to you. The real value is the decision guide: compact after research before implementation, compact after debugging, but never mid-implementation when you need all those variable names and file paths. It assumes you understand that TodoWrite and files persist through compaction but conversation context doesn't. Works best if you actually write important state to disk before compacting, which is the discipline this enforces.
- skills.sh installs
- 6.1K
- GitHub stars
- 229.1K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add affaan-m/everything-claude-code --skill strategic-compact --agent claude-codeInstalls into .claude/skills of the current project.
Files
Strategic Compact Skill
Suggests manual /compact at strategic points in your workflow rather than relying on arbitrary auto-compaction.
When to Activate
- Running long sessions that approach context limits (200K+ tokens)
- Working on multi-phase tasks (research → plan → implement → test)
- Switching between unrelated tasks within the same session
- After completing a major milestone and starting new work
- When responses slow down or become less coherent (context pressure)
Why Strategic Compaction?
Auto-compaction triggers at arbitrary points:
- Often mid-task, losing important context
- No awareness of logical task boundaries
- Can interrupt complex multi-step operations
Strategic compaction at logical boundaries:
- 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.js script runs on PreToolUse (Edit/Write) and combines two signals:
Sponsors
Details
More from affaan-m/everything-claude-code
All 256- Android Clean Architecture6K
- Springboot Tdd6K
- Continuous Learning5.9K
- Database Migrations5.9K
- Django Tdd5.9K
- E2e Testing5.9K
- Liquid Glass Design5.9K
- Security Scan5.9K
- Deployment Patterns5.8K
- Jpa Patterns5.8K
- Laravel Patterns5.8K
- Clickhouse Io5.7K
- Eval Harness5.7K
- Laravel Security5.7K
- Cpp Testing5.6K
- Iterative Retrieval5.6K
- Agent Harness Construction5.5K
- Configure Ecc5.5K
- Nutrient Document Processing5.5K
- Search First5.5K
- Verification Loop5.5K
- Agentic Engineering5.4K
- Cost Aware Llm Pipeline5.4K
- Django Verification5.4K