strategic-compact

Suggest manual compaction at logical phase boundaries via PreToolUse hooks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents important conversational context from being lost when automatic compaction triggers at arbitrary times by suggesting manual compaction at logical phase boundaries for long or multi-step sessions.

Core Features & Use Cases

  • Strategic Suggestions: Monitors tool-call activity and recommends manual /compact when configured thresholds are reached to avoid mid-task context loss.
  • Hook Integration: Designed to run on PreToolUse events (Edit/Write) so suggestions appear inline during active workflows.
  • Configurable Thresholds & Reminders: Supports a COMPACT_THRESHOLD environment variable and periodic reminders after the threshold to fit different workflows.
  • Use Case: When transitioning from research to implementation in a long session, compact exploratory reasoning while preserving the distilled plan and files.

Quick Start

Ask Claude to run the strategic-compact hook and suggest when to /compact during a long multi-step session.

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 automatic compaction in long Claude sessions?

Manual compaction at logical checkpoints prevents automatic compaction from losing important task state. This Skill monitors tool-call counts via PreToolUse hooks and suggests running /compact at phase boundaries to preserve distilled plans.

How does a tool-call counter trigger manual compaction suggestions?

A lightweight counter script tracks tool-call activity and emits compaction suggestions when a configurable threshold is reached. It operates on PreToolUse events for Edit and Write actions, displaying inline reminders during active workflows.

Can I configure the compaction threshold to fit my workflow?

Yes, you can configure the compaction threshold using the COMPACT_THRESHOLD environment variable. The Skill also supports periodic reminders after the threshold is reached to accommodate different session lengths and workflows.

When should I compact context in multi-phase Claude sessions?

You should compact context when transitioning between research, planning, implementation, and testing phases. Compacting at these logical boundaries preserves the distilled plan and relevant files while clearing exploratory reasoning from the context window.

Does this Skill automatically compact the conversational context?

No, the Skill does not perform automatic compaction. It solely tracks tool-call counts and emits suggestions for manual /compact actions, ensuring you retain control over when context is compressed and what state is preserved.

What is the best way to manage context in high tool-call workflows?

Using strategic manual compaction suggestions is the best way to manage context in high tool-call workflows. By monitoring tool-call counts and suggesting compaction at configured thresholds, you avoid mid-task context loss and maintain task state.