strategic-compact

Suggest manual context compaction after configurable tool call thresholds in Claude sessions.

4|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/XD3an/cc-plus --skill strategic-compact-xd3an
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/XD3an/cc-plus/tree/main/skills/strategic-compact
Command: npx skills add https://github.com/XD3an/cc-plus --skill strategic-compact-xd3an

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill prevents the loss of crucial context during long or complex Claude sessions by suggesting manual context compaction at logical breakpoints, 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 milestones).
  • Configurable Thresholds: Allows customization of the tool call count that triggers the first suggestion and subsequent reminders.
  • Use Case: After researching a complex problem and outlining a solution, you can use this skill to prompt a compaction, preserving the detailed plan while discarding the broader research context, ensuring a clean slate for implementation.

Quick Start

Ensure the hook is configured in your ~/.claude/settings.json to automatically receive suggestions.

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 from losing context during long sessions?

Context compaction is the process of summarizing and preserving essential information at logical breakpoints within a Claude session. It tracks tool calls and prompts you to manually compact context after reaching a configurable threshold, preventing arbitrary auto-compaction from disrupting your multi-phase task workflow.

When should I manually compact context in a Claude session?

You should manually compact context at logical intervals such as after planning, before execution, or after reaching a milestone. Configurable thresholds trigger suggestions based on tool call counts, allowing you to preserve a detailed plan while discarding broader research context for a clean implementation slate.

How do I configure context compaction thresholds in Claude?

You configure context compaction thresholds by setting up a hook in your `~/.claude/settings.json` file. This hook tracks tool calls and automatically suggests manual compaction after a customized count of tool invocations, preventing arbitrary auto-compaction during extended workflow sessions.

Can I disable auto-compaction and use manual context management in Claude?

You can bypass arbitrary auto-compaction by using strategic manual context management. This approach tracks your tool call count and prompts you to compact context at logical task phases, ensuring essential information is preserved through milestones without workflow disruption.

Why does auto-compaction disrupt multi-phase workflows in Claude?

Auto-compaction disrupts multi-phase workflows because it triggers arbitrarily, potentially discarding crucial context mid-task. Strategic compaction solves this by suggesting manual context preservation at logical breakpoints like after planning or before execution, maintaining a clean slate for the next phase.