Strategic Context Compaction

•
43k
•

Optimizes token usage by suggesting manual context compaction at logical task boundaries to prevent data loss during complex workflows.

Strategic Context Compaction is a developer utility for Claude Code that replaces arbitrary auto-compaction with intelligent, threshold-based prompts. By monitoring tool call frequency and identifying task boundaries, this skill suggests running the /compact command at strategic moments—such as after a research phase or upon reaching a project milestone. This ensures that critical implementation details are preserved while clearing out unnecessary debugging or exploration noise, providing a cleaner context for long-running coding sessions.

主な機能

01Logic-based workflow management for task transitions
02Token optimization for long-form coding sessions
03Threshold-based monitoring of tool call counts
04Non-intrusive alerts through PreToolUse hooks
0543,117 GitHub stars
06Configurable suggestion triggers (defaulting to 50 calls)

ユースケース

01Managing context windows during large-scale refactoring tasks
02Transitioning from research and exploration to active implementation
03Cleaning up debugging logs and error traces after solving a major bug