strategic-compact

Prompts manual compaction at strategic task boundaries to manage context.

15|2|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/kousukef/forge --skill strategic-compact-kousukef
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/kousukef/forge/tree/main/skills/strategic-compact
Command: npx skills add https://github.com/kousukef/forge --skill strategic-compact-kousukef

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Reduce context bloat by prompting manual compaction at strategic task boundaries, preserving important information across phases.

Core Features & Use Cases

  • Manual strategic compaction triggers at logical boundaries to preserve crucial context.
  • Configurable thresholds and PreToolUse hooks to integrate with Claude Code workflows.
  • Use Case: In long-running sessions spanning research, planning, implementation, and testing, strategically compact to maintain focus and coherence.

Quick Start

Install the skill and configure the PreToolUse hook to run the suggest-compact.sh script after a defined number of tool calls.

Frequently Asked Questions about strategic-compact

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

FAQPage Schema
How do I reduce context bloat in Claude Code during long-running sessions?

Reduce context bloat in Claude Code by triggering manual compaction at strategic task boundaries. This approach preserves crucial information across research, planning, implementation, and testing phases without hitting token limits.

What is strategic context compaction and when should I use it?

Strategic context compaction is a method to prompt manual context reduction at logical task boundaries. Use it in multi-phase workflows like research, planning, implementation, and testing to maintain focus and coherence when nearing token limits.

Can I configure PreToolUse hooks to automate context management in Claude Code?

Yes, you can configure PreToolUse hooks to automate context management in Claude Code. The skill uses a hook-driven script execution to suggest compaction after a defined number of tool calls based on a configurable threshold.

How do I set up a per-session counter for context compaction thresholds?

Set up a per-session counter by installing the skill and configuring the PreToolUse hook to run the suggest-compact.sh script. The counter tracks tool calls and suggests compaction when the configurable threshold is met.

Does manual compaction at task boundaries preserve context better than automatic compaction?

Manual compaction at strategic task boundaries preserves crucial context better by targeting logical breakpoints between research, planning, implementation, and testing. This ensures important phase information is retained across the workflow.

What are the limitations of using configurable thresholds for context compaction in multi-phase workflows?

The configurable threshold relies on a per-session counter of tool calls, meaning compaction suggestions are frequency-based rather than semantically aware. It requires manual triggering and does not automatically identify the optimal semantic boundary for context preservation.