strategic-compact

Prompt manual context compaction at logical workflow boundaries via PreToolUse hook.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/ignidus/iscagent --skill strategic-compact-ignidus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/ignidus/iscagent/tree/main/skills/strategic-compact
Command: npx skills add https://github.com/ignidus/iscagent --skill strategic-compact-ignidus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing context in long AI-assisted workflows can become unwieldy, leading to loss of important insights or coherence. Strategic compaction provides a structured prompt to compact at meaningful milestones, avoiding arbitrary trimming.

Core Features & Use Cases

  • Tracks tool calls within a session to gauge when compaction is appropriate.
  • Applies a configurable threshold (default 50) and issues periodic reminders (every 25 calls) to prompt compaction.
  • Hooks into PreToolUse to surface prompts without interrupting workflow.
  • Supports multi-phase projects (research → plan → implement → test) and phase transitions.

Quick Start

Install the Strategic Compact Skill and configure the PreToolUse hook to trigger the suggested-compact script so you are prompted to compact at logical task boundaries.

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 drift in long-running AI assistant workflows?

You can prevent context drift by prompting manual compaction at logical workflow boundaries. A PreToolUse hook tracks tool calls and issues reminders every 25 calls, enforcing a configurable threshold to compact context at meaningful milestones rather than arbitrarily trimming it.

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

Strategic context compaction is a technique to reduce context drift by prompting manual compaction at logical workflow boundaries. You should use it for multi-phase tasks like research, planning, implementation, and testing where context can balloon and phase transitions matter.

How do I configure the context compaction threshold for my AI assistant?

You can configure the context compaction threshold via the ~/.claude/settings.json file. The default threshold is set to 50 tool calls, with the PreToolUse hook issuing periodic reminders every 25 calls to prompt you to compact context.

Does strategic compaction interrupt the workflow during multi-phase tasks?

Strategic compaction does not interrupt the workflow. It hooks into PreToolUse to surface compaction prompts without halting your process, allowing you to manage context smoothly across multi-phase projects like research, implementation, and testing.

What are the limitations of relying on tool call counts for context management?

Relying on tool call counts for context management means compaction prompts are triggered by numerical thresholds rather than actual context size or semantic boundaries. This works best for structured multi-phase tasks but may not perfectly align with highly irregular or unpredictable workflow patterns.