Suggests manual context compaction at key stages to preserve task continuity.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "strategic-compact" skill from askskill: 1. Download https://raw.githubusercontent.com/affaan-m/ECC/main/skills/strategic-compact/SKILL.md 2. Save it as ~/.claude/skills/strategic-compact/SKILL.md 3. Reload skills and tell me it's ready
As we move from requirements analysis to solution design, help me do a manual context compaction that preserves goals, key constraints, confirmed decisions, and open questions.
A concise phase summary that preserves critical context for the next stage.
Before the next coding round, compact the current conversation context into completed modules, interface contracts, remaining bugs, and next priorities.
A structured development progress summary ready to use as context for implementation.
Before entering the literature comparison phase, manually compact our earlier discussion into research goals, key findings, evidence sources, and next validation directions.
A context summary for the next research phase that reduces information loss and repetitive discussion.
Suggests manual /compact at strategic points in your workflow rather than relying on arbitrary auto-compaction.
Auto-compaction triggers at arbitrary points:
Strategic compaction at logical boundaries:
The suggest-compact.js script runs on PreToolUse (Edit/Write) and:
Add to your ~/.claude/settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit",
"hooks": [{ "type": "command", "command": "node ~/.claude/scripts/hooks/suggest-compact.js" }]
},
{
"matcher": "Write",
"hooks": [{ "type": "command", "command": "node ~/.claude/scripts/hooks/suggest-compact.js" }]
}
]
}
}
Environment variables:
COMPACT_THRESHOLD — Tool calls before first suggestion (default: 50)Use this table to decide when to compact:
| Phase Transition | Compact? | Why |
|---|---|---|
| Research → Planning | Yes | Research context is bulky; plan is the distilled output |
| Planning → Implementation | Yes | Plan is in TodoWrite or a file; free up context for code |
| Implementation → Testing | Maybe | Keep if tests reference recent code; compact if switching focus |
| Debugging → Next feature | Yes | Debug traces pollute context for unrelated work |
| Mid-implementation | No | Losing variable names, file paths, and partial state is costly |
| After a failed approach | Yes | Clear the dead-end reasoning before trying a new approach |
Understanding what persists helps you compact with confidence:
| Persists | Lost |
|---|---|
| CLAUDE.md instructions | Intermediate reasoning and analysis |
| TodoWrite task list | File contents you previously read |
Memory files (~/.claude/memory/) | Multi-step conversation context |
| Git state (commits, branches) | Tool call history and counts |
| Files on disk | Nuanced user preferences stated verbally |
/compact with a summary — Add a custom message: /compact Focus on implementing auth middleware nextInstead of loading full skill content at session start, use a trigger table that maps keywords to skill paths. Skills load only when triggered, reducing baseline context by 50%+:
| Trigger | Skill | Load When |
|---|---|---|
| "test", "tdd", "coverage" | tdd-workflow | User mentions testing |
| "security", "auth", "xss" | security-review | Security-related work |
…
Handle returns, refunds, fraud checks, and warranty claim decisions efficiently.
Use Bun for runtime, bundling, testing, packages, and Node migration decisions.
Use the correct Ethereum Keccak-256 hashing in Node.js and TypeScript.
Apply Nuxt 4 patterns for SSR safety, performance, and data fetching.
Generate images, videos, and audio with one unified AI media workflow.
Design Quarkus 3 backend patterns for messaging, APIs, data, and async workflows.
Compress Claude Code and OpenCode context losslessly for longer, more efficient coding tasks.
Compress prompts, docs, and agent skills while preserving structure and saving tokens.
Compress context and persist checkpoints to cut AI agent token usage.
Compresses LLM conversation context while preserving meaning and reducing token usage.
Turn massive codebases into searchable semantic feature graphs for precise code understanding.
Define and compose task contexts for more consistent AI development results.