CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

strategic-compact

The skill recommends when to compact during long or multi-phase sessions, with a decision guide for phase transitions and advice on saving a checkpoint first. It also describes an optional Claude Code hook that can provide configurable reminders, including periodic reminders after a call threshold.

Quality

63%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

Fix and improve this skill with Tessl

tessl review fix ./.agents/skills/strategic-compact/SKILL.md
SKILL.md
Quality
Evals
Security

Strategic Compact Skill

Choose a useful phase boundary for manual compaction. Use /compact in clients that support it.

When to Activate

  • Running long sessions that approach the active model’s context limit
  • 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

When the client reports context usage, judge pressure relative to the active model’s context window. A tool-call count can prompt a review, but it does not measure remaining context.

The optional local helper counts calls when configured as a Claude Code PreToolUse hook for Edit and Write. It:

  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

Optional Claude Code Hook

Manual use requires no hook. Configure the helper through the user’s existing agent configuration workflow if they request an automatic reminder.

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 → ImplementationYesThe implementation plan is saved in a task file
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

Persistence varies by client and session. Save a checkpoint to an authorized task file before compaction, with the goal, decisions, pending work, and verification evidence.

PersistsLost
Project instructions loaded from diskIntermediate reasoning and analysis
Task list, when the client exposes and preserves oneFile contents you previously read
Authorized notes written to diskMulti-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 — Save the agreed plan before compacting
  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 — Use reminders as input to a phase-boundary decision
  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
Repository

saski/arnesto

Path

.agents/skills/strategic-compact/SKILL.md

Last updated
First committed
Purpose
Planning
Form
WorkflowBest practicesReference
Commands
compact
Usage
Periodic

Canonical home

ysyecust/everything-claude-code
In sync

since Feb 12, 2026

Also appears in

valeriibeck-star/claude-skills
Stale

last in sync Mar 28, 2026

ysyecust/everything-claude-code
Modified

on Oct 16, 2026

affaan-m/ECC
Modified

on Sep 2, 2026

tdg-personal/strategic-compact
Stale

last in sync Mar 28, 2026

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.