strategic-compact

Suggest manual context compaction at logical workflow intervals via PreToolUse hooks.

5|Updated Feb 6, 2026
One-click install
npx skills add https://github.com/FaisalAlqarni/sp-ecc --skill strategic-compact-faisalalqarni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/FaisalAlqarni/sp-ecc/tree/main/skills/strategic-compact
Command: npx skills add https://github.com/FaisalAlqarni/sp-ecc --skill strategic-compact-faisalalqarni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill prevents the loss of crucial context during long-running tasks by suggesting manual context compaction at logical workflow intervals, rather than relying on arbitrary auto-compaction.

Core Features & Use Cases

  • Strategic Compaction: Prompts the user to manually compact context at opportune moments (e.g., after planning, before execution, after a milestone).
  • Threshold-Based Suggestions: Offers suggestions after a configurable number of tool calls.
  • Use Case: When working on a complex feature, after finalizing the implementation plan but before starting to write code, this skill will remind you to compact the context to clear out research notes and keep only the essential plan, ensuring a clean slate for development.

Quick Start

Use the strategic-compact skill to suggest manual context compaction at logical intervals.

Frequently Asked Questions about strategic-compact

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent context loss during long-running tasks in Claude?

Prevent context loss by triggering manual context compaction at logical workflow intervals, such as after finalizing a plan or reaching a milestone, rather than relying on arbitrary auto-compaction.

What is strategic context compaction and when should I use it?

Strategic context compaction is the practice of manually clearing context at opportune moments to preserve essential task information. Use it before execution phases to clear research notes and maintain a clean slate for development.

How do I configure context compaction prompts using Claude hooks?

Configure context compaction prompts by integrating PreToolUse hooks for Edit and Write commands. The system tracks tool calls and prompts you for manual compaction after a configurable threshold is met or at periodic intervals thereafter.

Can I manage token usage by compacting context after a specific number of tool calls?

Yes, you can manage token usage by setting a configurable threshold for tool calls. The system tracks your calls and suggests manual compaction once that threshold is met, continuing at periodic intervals thereafter.

Does manual context compaction work better than auto-compaction for complex features?

Manual context compaction works better for complex features because it allows you to preserve context through task phases at logical intervals, whereas arbitrary auto-compaction might discard crucial information mid-task.

What are the limitations of threshold-based context compaction suggestions?

Threshold-based context compaction suggestions are limited by their reliance on tool call counts rather than semantic task completion. They trigger after a configurable threshold is met but may not align perfectly with actual workflow milestones.