strategic-compact

Suggest manual /compact checkpoints at logical boundaries during multi-phase agent workflows.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

It prevents slow, incoherent, context-stuffed sessions by stopping auto-compaction from interrupting important multi-phase work and replacing it with human-timed compaction at logical boundaries.

Core Features & Use Cases

  • Strategic manual compaction reminders: Suggests when to run /compact based on tool-call thresholds so you decide at meaningful phase transitions.
  • Phase-aware checkpointing: Targets boundaries like research → planning and planning → implementation, where context can be safely distilled.
  • Configurable behavior: Uses COMPACT_THRESHOLD to control when the first reminder appears and then issues periodic reminders afterward.

Quick Start

Enable the provided hooks in your Claude settings and, when the skill suggests a checkpoint during a phase transition, run /compact with a short focus summary tailored to your next phase.

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 overflow and coherence loss during long-running Claude agent sessions?

Manual context compaction prevents context overflow by suggesting when to run /compact at logical task boundaries, such as between research and implementation phases, stopping auto-compaction from interrupting multi-phase work. You decide when to compress the session context.

When should I run /compact to checkpoint context during multi-phase agent workflows?

You should run /compact during phase transitions like moving from planning to implementation. The skill uses a deterministic tool-call counter and threshold-based reminders to prompt you at these logical workflow checkpoints, ensuring safe context distillation before starting an unrelated task segment.

How do I configure context compaction reminders based on tool-call thresholds in Claude?

You configure context compaction reminders by setting the COMPACT_THRESHOLD variable to control when the first reminder appears. After reaching this tool-call threshold, the skill issues periodic reminders to prompt manual compaction at logical task boundaries.

Does manual compaction work with PreToolUse edit and write hooks in Claude?

Yes, manual compaction is compatible with PreToolUse edit/write hook execution. The skill integrates with these hooks to instruct users to run /compact at logical task boundaries, ensuring context management does not interfere with active tool execution.

What is the difference between auto-compaction and strategic manual compaction for context management?

Strategic manual compaction replaces auto-compaction by letting you time context compression at meaningful phase transitions instead of arbitrary limits. This prevents slow, incoherent, context-stuffed sessions by preserving workflow coherence across multi-phase agent tasks.