strategic-compact

Prompt strategic compaction at logical task boundaries to prevent context drift.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Context drift and bloated session memory occur when auto-compaction is relied upon across long workflows; Strategic compact provides deliberate, phase-boundary resets to preserve essential context.

Core Features & Use Cases

  • PreToolUse hook counts tool invocations and triggers compaction prompts at logical phase boundaries.
  • Configurable threshold via COMPACT_THRESHOLD with a default of 50, plus periodic reminders every 25 calls after the threshold.
  • Easy integration with existing hooks.json and suggest-compact.js to keep workflows lean.

Quick Start

Install the strategic-compact skill and use the /compact command at the end of a workflow phase to prune context and preserve the essential plan.

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 drift in long-running multi-phase workflows?

To prevent context drift in long-running workflows, use strategic compaction at logical phase boundaries. A PreToolUse hook counts tool invocations and triggers periodic compaction reminders, ensuring deliberate context resets instead of relying on automatic compaction.

Can I configure the tool invocation threshold for context compaction reminders?

Yes, you can configure the compaction threshold by setting the COMPACT_THRESHOLD value, which defaults to 50. After reaching the threshold, the PreToolUse hook issues periodic compaction reminders every 25 tool calls to manage context.

What is the best way to manage context across research and implementation phases?

The best way to manage context across research and implementation phases is to use a PreToolUse hook that enforces strategic compaction at logical task boundaries. This prunes context and preserves the essential plan when transitioning between phases.

How do I integrate compaction reminders into an existing hooks.json configuration?

You can integrate compaction reminders by adding the strategic-compact skill to your existing hooks.json and suggest-compact.js files. This connects the PreToolUse hook to count tool invocations and keep workflows lean.

When should I use strategic compaction instead of auto-compaction?

You should use strategic compaction instead of auto-compaction during long-running, multi-phase workflows like planning and testing. It provides deliberate, phase-boundary resets to preserve essential context, whereas auto-compaction often causes context drift and bloated session memory.