strategic-compact

Guide manual context compaction at configurable tool-call thresholds via a Bash script.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/mgr-kb/mgr-dotfiles --skill strategic-compact-mgr-kb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/mgr-kb/mgr-dotfiles/tree/main/claude/skills/strategic-compact
Command: npx skills add https://github.com/mgr-kb/mgr-dotfiles --skill strategic-compact-mgr-kb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill guides users to perform manual context compaction at logical boundaries to prevent loss of critical information during long-running tasks, rather than relying on arbitrary auto-compaction.

Core Features & Use Cases

  • Threshold-based prompts: Alerts after a configurable number of tool invocations to suggest compacting.
  • Pre/Post phase boundaries: Encourages compacting after exploration or before major context shifts to keep relevant context focused.
  • Operational integration: Hooks into Claude's PreToolUse flow via a script that checks usage and emits prompts.
  • Use Case: When researching a feature, compact after planning to start execution with a clean context, then compact again after milestones.

Quick Start

Tell Claude: "Suggest a manual context compact after the 50th tool call to preserve context through the task phases."

Frequently Asked Questions about strategic-compact

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

FAQPage Schema
How do I preserve task context during long-running multi-step workflows?

Manual context compaction at logical phase boundaries preserves task context during long-running workflows by guiding you to compact after exploration or before major context shifts, preventing the loss of critical information.

When should I manually compact context instead of relying on auto-compaction?

You should manually compact context at logical boundaries like after the planning phase or before major context shifts to keep relevant context focused, rather than relying on arbitrary auto-compaction that may discard critical task information.

How do I set up a threshold-based reminder to trigger manual context compaction?

You can set up a threshold-based reminder by configuring a Bash script integrated into Claude's PreToolUse hook flow that checks tool invocation counts and alerts you to suggest compacting after a configurable number of calls.

Can I integrate context compaction guidance with Claude's PreToolUse hooks?

Yes, this functionality hooks directly into Claude's PreToolUse flow via a Bash script that checks tool usage against your configured threshold and emits prompts to guide manual context compaction.

What are the limitations of threshold-based manual context compaction?

Manual context compaction requires you to define logical boundaries and configure the tool invocation threshold yourself, meaning it relies on user-defined phase transitions rather than automatically detecting optimal compaction points.