strategic-compact

strategic-compact is a skill for Claude Code from shennawardana23/skillme. It costs 103 tokens per session (1,334 once invoked), scanned A, original, Apache-2.0.

A guide for choosing when to manually shorten an AI conversation's stored context. It recommends doing this at natural project boundaries so important working details are not lost midway through a task.

In plain words
What is it for?
Use it when moving from research to planning, planning to implementation, debugging to a new feature, or when the conversation becomes harder to follow.
Why use it?
It helps keep conversations focused while avoiding the loss of file names, variables, error details, or decisions that are still needed.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the skillme plugin — 148 skills, 2 commands shipped together

Good fit Use it when moving from research to planning, planning to implementation, debugging to a new feature, or when the conversation becomes harder to follow.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shennawardana23/skillme/strategic-compact
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add shennawardana23/skillme --skill strategic-compact
Clone the repo
git clone --depth 1 https://github.com/shennawardana23/skillme

Made for: Claude Code.

Or install skillme, the plugin that ships this one along with the rest of its 148 skills, 2 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for strategic-compact

README.md
[![agentmods](https://agentmods.dev/badge/skills/shennawardana23/skillme/strategic-compact/github.svg)](https://agentmods.dev/skills/shennawardana23/skillme/strategic-compact)
Your own site
<a href="https://agentmods.dev/skills/shennawardana23/skillme/strategic-compact"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/strategic-compact/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for strategic-compact

Your own site · 80×15
<a href="https://agentmods.dev/skills/shennawardana23/skillme/strategic-compact"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/strategic-compact.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 103 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,334 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00103 $0.01334
Opus 5.5 $0.00041 $0.00534
Sonnet 5.5 $0.00021 $0.00267
Haiku 4.5 $0.00010 $0.00133

Measured 3mo ago against content hash 3407a045804b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

strategic-compact scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/strategic-compact/SKILL.md · 115 lines

How it starts

The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Strategic Compact

Manual /compact at a chosen point beats compaction triggered automatically at an arbitrary token threshold, because automatic compaction has no notion of where in the task you actually are — it can fire mid-debugging and discard the exact state (which hypotheses were already tried, what the last error looked like) the next step needs. Compacting deliberately, at a logical boundary, keeps what matters and discards what doesn't.

The decision, by phase transition

Transition Compact? Why
Research → planning Yes Research context is bulky; the plan is the distilled output worth keeping
Planning → implementation Yes Once the plan is written down (a todo list or a file), free the context it took to reach it
Implementation → testing Maybe Keep if tests reference details from the code just written; compact if switching focus entirely
Debugging → next feature Yes Debug traces and dead-end hypotheses pollute context for unrelated work
Mid-implementation No Losing variable names, file paths, and partial state mid-task is costly and hard to reconstruct
After a failed approach, before trying another Yes Clear the dead-end reasoning trail before starting the next attempt with a clean slate

The pattern across all of these: compact when the next step doesn't need the reasoning process that got you here, only its output. Don't compact when the next step is a continuation of the same reasoning.

What actually survives compaction

Compacting isn't all-or-nothing — some things persist regardless, which should shape what you do before compacting:

Persists Lost
Written instructions/config files Intermediate reasoning and analysis
A task list written to a file or tracked externally Contents of files you read earlier but didn't need to re-read
Anything written to disk Multi-step conversational context
Git history (commits, branches) Tool-call history and counts
Files on disk generally Nuanced preferences stated verbally but never written down

Read the full file on GitHub · 115 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 115 lines · 103 tokens per session scan A 3407a045804b

Subscribe to this mod's changes

strategic-compact is a skill published in the GitHub repository shennawardana23/skillme (4 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 103 tokens to every session and 1,334 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

strategic-compact compared with skills from other repositories

strategic-compact next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
strategic-compactshennawardana23/skillmeSkill41mo agoApache-2.0A103Claude Code
chief-of-staffvinvcn/mattpocock-skills-zh-CNSkill6.3kyesterdayMITA20Claude Code, Codex
digital-brainforyourhealth111-pixel/Vibe-SkillsSkill3.9k24d agoApache-2.0A57Claude Code, Codex
context-bankruptcymohitagw15856/pm-claude-skillsSkill1.6kyesterdayMITA108Claude Code
relevance-coarse-filterelvisun/newsjackSkill1.7k7d agoMITA57Claude Code
context-engineering-reviewmohitagw15856/pm-claude-skillsSkill1.6kyesterdayMITA111Claude Code
memory-file-maintenancemohitagw15856/pm-claude-skillsSkill1.6kyesterdayMITA146Claude Code