strategic-compact

Suggests manual context compaction at logical task boundaries during long Claude sessions.

Updated May 19, 2026
One-click install
npx skills add https://github.com/azusagasaku/--claude-config --skill strategic-compact-azusagasaku
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/azusagasaku/--claude-config/tree/main/skills/ecc/strategic-compact
Command: npx skills add https://github.com/azusagasaku/--claude-config --skill strategic-compact-azusagasaku

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Auto-compaction in long AI coding sessions triggers at arbitrary points, often mid-task, losing critical context like file paths, variable names, and partial reasoning. This Skill helps you compact context at logical phase transitions instead, preserving what matters across multi-phase work. ## Core Features & Use Cases - Threshold-Based Suggestions: A PreToolUse hook tracks tool calls per session and suggests /compact after a configurable threshold (default: 50 calls), with reminders every 25 calls afterward. - Compaction Decision Guide: A phase-transition table (research → planning → implementation → testing) tells you when compacting is safe and when it would destroy needed context. - Persistence Awareness: Documents what survives compaction (CLAUDE.md, TodoWrite, memory files, git state) versus what is lost, so you can save important context to files before compacting. - Use Case: During a long feature build, after finalizing your plan in TodoWrite, the hook reminds you to run /compact Focus on implementing auth middleware next so you start implementation with a clean context window. ## Quick Start Add the suggest-compact hook to your Claude settings.json for Edit and Write tool events, then follow its suggestions to run /compact at phase transitions during long sessions.

Frequently Asked Questions about strategic-compact

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

FAQPage Schema
How do I compact context in Claude Code without losing progress?▼

Run /compact manually at logical phase boundaries, such as after planning or after completing a milestone, rather than waiting for auto-compaction. Save important context to files, memory, or TodoWrite first, and add a summary message like /compact Focus on implementing auth middleware next.

When should I compact during a long coding session?▼

Compact at phase transitions: after research before planning, after planning before implementation, after debugging, or after a failed approach. Avoid compacting mid-implementation, since losing variable names, file paths, and partial state is costly.

What survives a /compact in Claude Code?▼

CLAUDE.md instructions, the TodoWrite task list, memory files in ~/.claude/memory/, git state, and files on disk all persist. Lost items include intermediate reasoning, previously read file contents, conversation context, and tool call history.

How do I configure the compaction suggestion threshold?▼

Set the COMPACT_THRESHOLD environment variable to control how many tool calls occur before the first suggestion; the default is 50. After the threshold, the hook reminds you every 25 additional tool calls.

Why is manual compaction better than auto-compaction?▼

Auto-compaction triggers at arbitrary points with no awareness of task boundaries, often interrupting multi-step operations mid-task. Manual compaction at logical milestones keeps the distilled output of each phase while discarding bulky exploration context.