strategic-compact

Track tool call counts and prompt manual compaction via PreToolUse hooks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manual context management during long Claude Code sessions leads to loss of important details and cognitive overload. This skill provides a milestone-driven approach to compact and preserve the core exploration context while enabling fresh progress.

Core Features & Use Cases

  • Track tool call counts during a session and detect when compaction should be considered.
  • Configure a threshold and periodic reminders to prompt manual compaction at logical boundaries.
  • Hook-based integration using PreToolUse to suggest compaction without interrupting workflow.
  • Use Case: in a long experiment, compact after exploration to preserve the hypothesis and plan for implementation.

Quick Start

Install the skill and configure your PreToolUse hooks to run the suggest-compact.sh script on Edit or Write events.

Frequently Asked Questions about strategic-compact

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

FAQPage Schema
How do I manage context loss during long Claude Code sessions?

Context loss during long Claude Code sessions can be managed by introducing manual, milestone-based compaction, preserving core exploration context while enabling fresh progress at logical boundaries.

What is milestone-based context compaction in Claude Code?

Milestone-based context compaction is a manual approach to minimize context loss by compacting at logical boundaries, applicable during long, multi-phase sessions spanning exploration, planning, implementation, and testing.

How do I configure PreToolUse hooks to suggest compaction automatically?

Configure PreToolUse hooks to run the suggest-compact.sh script on Edit or Write events, tracking tool call counts and prompting for compaction when a configurable threshold is met without interrupting workflow.

Can I set a custom compaction threshold for context management?

Yes, you can configure a custom compaction threshold and periodic reminders to prompt manual compaction at logical boundaries based on tracked tool call counts during your session.

Does manual context compaction work with multi-phase workflows?

Manual context compaction works effectively with multi-phase workflows, allowing you to compact after exploration to preserve hypotheses and plans before moving into implementation and testing phases.

What are the limitations of threshold-based compaction in Claude Code?

Threshold-based compaction relies on tool call counts rather than semantic understanding, meaning compaction prompts may trigger before a logical milestone is reached or require manual judgment to execute.