Strategic Compact
Strategic manual compaction at task phase boundaries, guided by context size and tool-call pressure.
- CCM score
- 68 of 100
- skills.sh installs
- 14K
- GitHub stars
- 312.6K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers when to run
/compactacross research, planning, implementation, testing, and debugging phases, with a decision table - Includes
suggest-compact.js, a PreToolUse hook on Edit and Write that combines context-token size with tool-call count - Enforces reminders at a window-scaled threshold, 160k on a 200k window or 250k on a 1M window, repeating every 60k tokens
- Designed for long sessions that approach context limits, where mid-task auto-compaction would lose important state
Install
$ npx -y skills add affaan-m/ecc --skill strategic-compact -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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:
Details
- Repository
- github.com/affaan-m/ecc
- Categories
- Memory & Context, Agent Workflow & Planning
- First seen
- Jul 14, 2026
Questions
What does the strategic-compact skill do?
The strategic-compact skill suggests manual /compact at logical task boundaries, such as after planning or debugging, instead of letting auto-compaction trigger mid-task. It combines a context-size signal with a tool-call count to decide when to suggest compacting.
How do I install the strategic-compact skill?
Run npx -y skills add affaan-m/ecc --skill strategic-compact -y in your project. Once installed, the agent gets a hook that reads context size and suggests compaction at the right phase transitions.
Where does strategic-compact rank in its category?
It is in the Memory & Context category and ranks in the top 25 there. Other skills in the category include handoff, caveman-compress and caveman-stats, while strategic-compact focuses on timing manual compaction around task phases.
Does strategic-compact need any setup or accounts?
If installed as a plugin, no setup is needed because the hook is already registered. For manual installs, you must add the PreToolUse hook for Edit and Write to your settings.json, and you should write the plan to a file before compacting.
More from affaan-m/ecc
All 257- Laravel Patterns13.8K
- Verification Loop13.6K
- Codebase Onboarding13.6K
- Springboot Tdd13.4K
- Security Scan13.4K
- Django Tdd13.3K
- Deployment Patterns13.3K
- Search First13.3K
- Deep Research13.2K
- Eval Harness13.1K
- Continuous Learning13K
- Cpp Testing13K
- Jpa Patterns13K
- Rust Patterns12.9K
- Kotlin Coroutines Flows12.9K
- Configure Ecc12.9K
- Laravel Tdd12.8K
- Agentic Engineering12.8K
- Clickhouse Io12.7K
- Cost Aware Llm Pipeline12.7K
- Kotlin Patterns12.7K
- Iterative Retrieval12.6K
- Django Verification12.6K
- Nextjs Turbopack12.6K
Similar to Strategic Compact
More Memory & Contextcontext-engineeringSkillrohitg00/pro-workflow180 installsFour-operation guide for managing context in AI coding sessions: Write, Select, Compress, Isolate.
cc-skill-strategic-compactSkillsickn33/agentic-awesome-skills602 installsStructured checkpoint for condensing an agent conversation at phase boundaries, preserving constraints, evidence, and the next action.
compact-guardSkillrohitg00/pro-workflow199 installsSmart pre- and post-compaction state saving that preserves files, task progress, and next steps.
context-optimizationSkillsickn33/agentic-awesome-skills561 installsStrategies for stretching limited context windows through compaction, observation masking, KV-cache reuse, and partitioning.
intelligent-compactPluginfcakyon/claude-codex-settings1.2K starsKeep file paths, root causes, and open questions through auto-summaries.