strategic-compact

Prompt manual context compaction at logical task boundaries via PreToolUse hooks.

Updated Mar 21, 2026
One-click install
npx skills add https://github.com/hieuck/Pro5ChromeManager --skill strategic-compact-hieuck
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/hieuck/Pro5ChromeManager/tree/main/.agents/skills/strategic-compact
Command: npx skills add https://github.com/hieuck/Pro5ChromeManager --skill strategic-compact-hieuck

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manages long AI-assisted sessions by prompting strategic manual compaction at logical task boundaries to preserve critical context and avoid over-trimming during multi-phase work.

Core Features & Use Cases

  • Hook-based control: integrates PreToolUse hooks to run suggest-compact.js before edits or writes.
  • Configurable thresholds: uses COMPACT_THRESHOLD to decide when to prompt or remind.
  • Phase-aware guidance: aligns compaction with exploration, planning, implementation, and testing phases.

Quick Start

Issue the /compact command at a strategic boundary to initiate context compaction.

Frequently Asked Questions about strategic-compact

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

FAQPage Schema
How do I preserve critical context during long AI-assisted sessions?

Context compaction preserves critical context during long AI-assisted sessions by prompting strategic manual compaction at logical task boundaries. This avoids over-trimming when switching between unrelated tasks or moving through multi-phase work.

When should I trigger manual context compaction in a multi-phase task?

Trigger manual context compaction at logical task boundaries, specifically when aligning with exploration, planning, implementation, and testing phases. This phase-aware guidance ensures you retain necessary history.

How do I configure context management thresholds for long sessions?

Configure context management thresholds by setting the COMPACT_THRESHOLD environment variable. This determines when the system prompts you to compact the context during multi-phase tasks.

Do I need PreToolUse hooks to run context compaction scripts?

Yes, strategic context compaction requires a PreToolUse hook to run suggest-compact.js before edits or writes. This hook-based control monitors your session and triggers the compaction prompt.

What is the best way to avoid over-trimming context when switching tasks?

Strategic manual compaction is the best way to avoid over-trimming context when switching between unrelated tasks within a single session. Issuing the /compact command at strategic boundaries preserves critical information.