strategic-compact

Prompt manual context compaction at strategic workflow milestones via a PreToolUse hook.

1|Updated Oct 17, 2025
One-click install
npx skills add https://github.com/tarrragon/claude --skill strategic-compact-tarrragon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/tarrragon/claude/tree/main/skills/strategic-compact
Command: npx skills add https://github.com/tarrragon/claude --skill strategic-compact-tarrragon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill guides users to perform deliberate context compaction at logical milestones, preventing context loss from spontaneous auto-compaction and keeping workflows coherent across task phases.

Core Features & Use Cases

  • Strategic prompts: Recommends manual /compact at key transition points to preserve essential context.
  • Phase-aware workflow: Helps maintain continuity when moving from exploration to implementation or between milestones.
  • Operational guidance: Provides configurable thresholds and hook examples to trigger compaction.

Quick Start

Use the strategic-compact skill to monitor tool usage and prompt for /compact at strategic points, after planning, milestones, or context shifts.

Frequently Asked Questions about strategic-compact

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

FAQPage Schema
How do I prevent context loss during spontaneous auto-compaction in long workflows?

Strategic compaction prompts you to manually compact context at key milestones, preventing workflow disruption from sudden auto-compaction. A lightweight hook monitors tool usage and suggests compaction after planning or before major context shifts.

When should I perform manual context compaction in a task workflow?

You should compact context after reaching milestones, finishing planning, or before major context shifts between phases. This phase-aware approach captures essential task details at logical transition points to preserve continuity.

Do I need external dependencies to set up strategic compaction hooks?

No external dependencies are required. Strategic compaction uses a lightweight PreToolUse hook and the suggest-compact.sh script to monitor tool usage and trigger compaction prompts without needing additional packages or frameworks.

How does a PreToolUse hook trigger context compaction prompts?

A PreToolUse hook monitors tool usage patterns and triggers compaction prompts at strategic points. The suggest-compact.sh script evaluates configurable thresholds to recommend manual /compact operations after milestones or before major context shifts.

What is the best way to manage context across multiple task phases?

Strategic manual compaction offers the best approach for managing context across phases, using configurable thresholds and hook examples to trigger timely compaction. This maintains workflow coherence when moving from exploration to implementation or between milestones.

Can I configure thresholds for when compaction suggestions appear?

Yes, compaction suggestion thresholds are configurable. The skill provides operational guidance and hook examples to tune when the PreToolUse hook prompts for manual /compact based on your specific task-management and workflow needs.