strategic-compact

Suggest manual context compaction via PreToolUse hook at configurable tool-call thresholds.

12|4|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/TeiNam/kiro-with-harness --skill strategic-compact-teinam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/TeiNam/kiro-with-harness/tree/main/skills/strategic-compact
Command: npx skills add https://github.com/TeiNam/kiro-with-harness --skill strategic-compact-teinam

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

The skill helps users manage the Claude context window more effectively by suggesting manual context compaction at strategic points, improving task flow and reducing the risk of context overload.

Core Features & Use Cases

  • Strategic Compact Suggestion: Prompts for manual compaction during logical workflow phases, rather than arbitrary auto-compaction.
  • Customizable Threshold: Configurable number of tool calls before suggesting compact, with default at 50 calls.
  • PreToolUse Hook: Triggers suggestions during editing or writing to consider compacting the context.
  • Context Survival Guide: Explains what information persists and what is lost after compaction.
  • Use Case: A developer working on a large codebase might use this skill to suggest compaction after finishing a coding phase, before transitioning to a testing phase.

Quick Start

Add the suggest-compact.js script to your PreToolUse hooks to get suggestions for compaction.

Frequently Asked Questions about strategic-compact

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

FAQPage Schema
How do I prevent Claude context overload during long coding workflows?

You prevent Claude context overload by triggering strategic manual compaction at logical workflow phase transitions, such as after a coding phase before starting testing. This approach optimizes the context window by summarizing completed work, thereby ensuring smoother task flow and preventing unexpected context truncation.

How does manual context compaction compare to auto-compaction in Claude?

Manual context compaction differs from auto-compaction by allowing you to compact at strategic, logical workflow phases rather than arbitrary token limits. This prevents losing critical task details mid-step, ensuring smoother transitions between coding and testing phases.

Can I configure the tool call threshold for Claude compaction suggestions?

Yes, you can configure the threshold for compaction suggestions. The default is set to trigger a manual compact suggestion after 50 tool calls, but this number is fully customizable to match your specific context management needs and workflow complexity.

How do I automate context compaction suggestions using a PreToolUse hook?

You automate compaction suggestions by adding the suggest-compact.js script to your PreToolUse hooks. This integration triggers prompts during editing or writing actions, advising you to consider compacting the context window before it becomes overloaded.

What information is lost when compacting the Claude context window?

Compacting the Claude context window preserves essential task summaries while discarding granular execution history. A Context Survival Guide explains exactly what information persists and what is lost after compaction, allowing you to manage workflow continuity effectively.