strategic-compact

Trigger manual context compaction prompts via a PreToolUse hook and configurable threshold.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Long Claude sessions and multi-phase tasks suffer from context loss as information accumulates; this Skill provides a structured approach to prompt manual context compaction at logical boundaries.

Core Features & Use Cases

  • Tracks tool calls within a session to gauge progress and context pressure.
  • Uses a configurable threshold (default 50) and periodic reminders (every 25 calls) to suggest compaction.
  • Provides a PreToolUse hook configuration guide and a minimal script (suggest-compact.sh) to trigger compaction prompts during workflow transitions.

Quick Start

Configure your Claude hooks to run the strategic-compact script when the tool-call threshold is reached.

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

To prevent context loss in long Claude sessions, you can apply manual context compaction at logical phase boundaries. This approach uses a configurable threshold and periodic reminders to preserve coherence as information accumulates during multi-phase tasks.

How does a PreToolUse hook trigger context compaction?

A PreToolUse hook triggers context compaction by running a minimal shell script when a configured tool-call threshold is met. This setup prompts manual compaction during workflow transitions to actively manage context pressure.

When should I compact context during multi-phase tasks?

You should compact context during multi-phase tasks at logical phase transitions. Tracking tool calls helps gauge session progress, with default suggestions to compact every 50 calls and periodic reminders every 25 calls.

Can I configure the threshold for context compaction reminders?

Yes, you can configure the threshold for context compaction reminders. The default setting suggests compaction at 50 tool calls and provides periodic reminders every 25 calls to help you manage session context effectively.

What is the best way to manage context pressure in Claude?

The best way to manage context pressure in Claude is strategic in-task compaction. By tracking accumulated tool calls and prompting compaction at logical boundaries, you preserve session coherence without interrupting the workflow.

Do I need a specific script to prompt manual compaction?

Yes, you need a minimal script like suggest-compact.sh to prompt manual compaction. Configuring your Claude hooks to run this script ensures compaction prompts trigger automatically when the tool-call threshold is reached.