strategic-compact

Prompt manual context compaction at configurable thresholds via PreToolUse hooks.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill strategic-compact-sakamoto-family-smile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/sakamoto-family-smile/agent_monorepo/tree/main/.claude/skills/ecc/strategic-compact
Command: npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill strategic-compact-sakamoto-family-smile

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Long-running AI sessions often exceed the available context window, causing loss of important details and misalignment between exploration and execution. Strategic compaction provides a discipline to perform manual context trimming at logical boundaries, preserving essential information for the next phase.

Core Features & Use Cases

  • Phase-boundary prompts: suggest compacting context after exploration, before planning, and after milestones.
  • Configurable triggers: threshold-based reminders and periodic prompts that adapt to session activity.
  • Hook-driven workflow: integrates with PreToolUse to enforce context discipline during edits and writes.
  • Use Case: in a multi-phase AI project, compact context after each milestone to start fresh for the next phase without losing critical insights.

Quick Start

Install the strategic-compact skill and enable the PreToolUse hook so the suggest-compact.js script runs at defined boundaries.

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 window pressure during long-running AI sessions?

Context compaction is the process of trimming conversation history at logical boundaries to preserve essential information for the next phase. It works by using configurable hooks and threshold-based prompts to enforce context discipline during long-running sessions.

When should I compact context in a multi-phase AI workflow?

You should compact context in a multi-phase AI workflow after exploration, before planning, and after reaching milestones. Triggering compaction at these logical boundaries ensures you start fresh for the next phase without losing critical insights.

How do I set up threshold-based prompts for session history compaction?

You set up threshold-based prompts for session history compaction by enabling a suggest-compact script integrated with PreToolUse hooks. This configuration provides periodic reminders that adapt to session activity and enforce context discipline during edits and writes.

Does strategic compaction work with PreToolUse hooks?

Yes, strategic compaction works with PreToolUse hooks to enforce context discipline during edits and writes. The hook-driven workflow runs a suggest-compact script at defined boundaries to prompt manual context trimming.

What is the best way to preserve critical insights across multi-phase research and implementation?

The best way to preserve critical insights across multi-phase research and implementation is manual context compaction at phase boundaries. This discipline trims unnecessary history while retaining essential information needed for planning and testing.