strategic-compact

Prompt manual context compression at logical milestones in multi-step workflows.

41|8|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/codelably/harmony-claude-code --skill strategic-compact-codelably
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/codelably/harmony-claude-code/tree/main/docs/zh-TW/skills/strategic-compact
Command: npx skills add https://github.com/codelably/harmony-claude-code --skill strategic-compact-codelably

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automatic context compression can cause loss of important context during multi-step tasks. Strategic manual compression prompts preserve essential context by enabling deliberate pruning at key milestones.

Core Features & Use Cases

  • Proposes context compression at logical boundaries: after exploration, before execution, after milestones, and before major transitions.
  • Integrates with PreToolUse hooks to trigger timing of prompts.
  • Supports configurable threshold via COMPACT_THRESHOLD to control suggestion frequency.

Quick Start

Configure your PreToolUse hook to execute the strategic-compact script and set COMPACT_THRESHOLD to 50 (default).

Frequently Asked Questions about strategic-compact

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

FAQPage Schema
Why does automatic context compression cause loss of important information during multi-step workflows?

Automatic context compression prunes data indiscriminately, causing loss of important information during multi-step workflows. Manual context compression at logical milestones enables deliberate pruning to preserve essential context across task phases.

How do I trigger manual context compression prompts at logical milestones?

To trigger manual context compression prompts at logical milestones, configure your PreToolUse hook to execute the strategic-compact script. This prompts deliberate pruning after exploration, before execution, or before major transitions.

Can I control the suggestion frequency for context compression prompts?

Yes, you can control the suggestion frequency for context compression prompts by setting the COMPACT_THRESHOLD variable. The default threshold is 50, allowing you to adjust how often the script suggests pruning.

What is the best way to preserve context across exploration, planning, and execution stages?

The best way to preserve context across exploration, planning, and execution stages is manual compression at logical boundaries. This optimizes cognitive load by prompting deliberate pruning after milestones rather than relying on automatic lossy compression.

Does manual context compression work with PreToolUse hooks for multi-step tasks?

Yes, manual context compression integrates directly with PreToolUse hooks to trigger timing of prompts. This integration supports multi-step workflows where context must endure across exploration, planning, execution, and handoff stages.

When should I avoid automatic context compression in multi-step tasks?

You should avoid automatic context compression in multi-step tasks when essential information must endure across exploration, execution, and handoff stages. Strategic manual compression at milestones prevents indiscriminate data loss during major transitions.