claudegoodies
Skill

strategic-compact

From affaan-m

Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.

Hooks Edit/Write tool calls to suggest manual /compact at logical task boundaries instead of arbitrary auto-compaction.

Use it when

  • Long sessions approaching 200K+ token context limits
  • Multi-phase tasks like research → plan → implement → test
  • Switching between unrelated tasks in the same session
  • After finishing a milestone before starting new work

Skip it if

  • Requires manual settings.json hook edit if not installed as a plugin
  • Just a tool-call counter with threshold suggestions, not automatic
  • Decision of whether to actually compact is still left to you

Facts

Repository
affaan-m/ECC
Status
Actively maintained
Last commit

Source preview

The instructions Claude Code reads when this skill runs.

# Strategic Compact Skill

Suggests manual `/compact` at strategic points in your workflow rather than relying on arbitrary auto-compaction.

## When to Activate

- Running long sessions that approach context limits (200K+ tokens)
- Working on multi-phase tasks (research → plan → implement → test)
- Switching between unrelated tasks within the same session
- After completing a major milestone and starting new work
- When responses slow down or become less coherent (context pressure)

## Why Strategic Compaction?

Auto-compaction triggers at arbitrary points:
- Often mid-task, losing important context
- No awareness of logical task boundaries
- Can interrupt complex multi-step operations

Strategic compaction at logical boundaries:
- **After exploration, before execution** — Compact research context, keep implementation plan
- **After completing a milestone** — Fresh start for next phase
- **Before major context shifts** — Clear exploration context before different task

## How It Works

The `suggest-compact.js` script runs on PreToolUse (Edit/Write) and:

1. **Tracks tool calls** — Counts tool invocations in session
2. **Threshold detection** — Suggests at configurable threshold (default: 50 calls)
3. **Periodic reminders** — Reminds every 25 calls after threshold

## Hook Setup

**Installed as a plugin?** No setup is needed. The plugin's `hooks/hooks.json` already registers `s
View full source on GitHub →

Other skills