KS
Killer-Skills

strategic-compact — how to use strategic-compact skill how to use strategic-compact skill, what is strategic-compact MCP, strategic-compact vs auto compaction, strategic-compact alternative, strategic-compact install guide, strategic-compact setup for Claude, manual context compaction AI agent, managing Claude 200K token limit, MCP server compaction strategies

Verified
v1.0.0
GitHub

About this Skill

Ideal for long-session agents handling multi-phase workflows like research, planning, and implementation. strategic-compact is an AI agent skill that recommends manual execution of the /compact command at strategic points in a workflow. It helps preserve context integrity through task phases in long sessions, especially when approaching the 200K+ token limit in Claude AI interactions.

Features

Suggests manual /compact command execution at logical intervals
Designed for long sessions approaching 200K+ token context limits
Optimized for multi-phase tasks (research → plan → implement → test)
Activates when switching between unrelated tasks within a session
Recommends compaction after completing major milestones
Triggers suggestions when responses slow down or lose coherence due to context pressure

# Core Topics

affaan-m affaan-m
[62.0k]
[7678]
Updated: 3/6/2026

Quality Score

Top 5%
80
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add affaan-m/everything-claude-code/strategic-compact

Agent Capability Analysis

The strategic-compact MCP Server by affaan-m is an open-source Categories.official integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to use strategic-compact skill, what is strategic-compact MCP, strategic-compact vs auto compaction.

Ideal Agent Persona

Ideal for long-session agents handling multi-phase workflows like research, planning, and implementation.

Core Value

Enables manual context compaction at logical intervals to preserve critical information through task phases, preventing performance degradation from arbitrary auto-compaction. This strategic approach maintains coherence when working near 200K+ token limits or switching between unrelated tasks.

Capabilities Granted for strategic-compact MCP Server

Preserving research context before planning phases
Maintaining session coherence during multi-step implementations
Optimizing performance when approaching context limits

! Prerequisites & Limits

  • Requires manual activation at strategic points
  • Depends on user recognizing logical workflow intervals
  • No automatic compaction capability
Project
SKILL.md
3.8 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8
SKILL.md
Readonly

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

Add to your ~/.claude/settings.json:

json
1{ 2 "hooks": { 3 "PreToolUse": [ 4 { 5 "matcher": "Edit", 6 "hooks": [{ "type": "command", "command": "node ~/.claude/skills/strategic-compact/suggest-compact.js" }] 7 }, 8 { 9 "matcher": "Write", 10 "hooks": [{ "type": "command", "command": "node ~/.claude/skills/strategic-compact/suggest-compact.js" }] 11 } 12 ] 13 } 14}

Configuration

Environment variables:

  • COMPACT_THRESHOLD — Tool calls before first suggestion (default: 50)

Compaction Decision Guide

Use this table to decide when to compact:

Phase TransitionCompact?Why
Research → PlanningYesResearch context is bulky; plan is the distilled output
Planning → ImplementationYesPlan is in TodoWrite or a file; free up context for code
Implementation → TestingMaybeKeep if tests reference recent code; compact if switching focus
Debugging → Next featureYesDebug traces pollute context for unrelated work
Mid-implementationNoLosing variable names, file paths, and partial state is costly
After a failed approachYesClear the dead-end reasoning before trying a new approach

What Survives Compaction

Understanding what persists helps you compact with confidence:

PersistsLost
CLAUDE.md instructionsIntermediate reasoning and analysis
TodoWrite task listFile contents you previously read
Memory files (~/.claude/memory/)Multi-step conversation context
Git state (commits, branches)Tool call history and counts
Files on diskNuanced user preferences stated verbally

Best Practices

  1. Compact after planning — Once plan is finalized in TodoWrite, compact to start fresh
  2. Compact after debugging — Clear error-resolution context before continuing
  3. Don't compact mid-implementation — Preserve context for related changes
  4. Read the suggestion — The hook tells you when, you decide if
  5. Write before compacting — Save important context to files or memory before compacting
  6. Use /compact with a summary — Add a custom message: /compact Focus on implementing auth middleware next

Related

  • The Longform Guide — Token optimization section
  • Memory persistence hooks — For state that survives compaction
  • continuous-learning skill — Extracts patterns before session ends

Related Skills

Looking for an alternative to strategic-compact or building a Categories.official AI Agent? Explore these related open-source MCP Servers.

View All

flags

Logo of facebook
facebook

flags is a feature flag management system that enables developers to check flag states, compare channels, and debug feature behavior differences across release channels.

243.6k
0
Design

extract-errors

Logo of facebook
facebook

extract-errors is a skill that assists in extracting and managing error codes in React applications using yarn extract-errors command.

243.6k
0
Design

fix

Logo of facebook
facebook

fix is a technical skill that resolves lint errors, formatting issues, and ensures code quality in declarative, frontend, and UI projects

243.6k
0
Design

flow

Logo of facebook
facebook

Flow is a type checking system for JavaScript, used to validate React code and ensure consistency across applications

243.6k
0
Design