strategic-compact

strategic-compact is a skill for Claude Code from myths-labs/muse. It costs 37 tokens per session (967 once invoked), scanned B, original, MIT.

A skill that recommends manually shortening the agent's working context at sensible points during a long task.

In plain words
What is it for?
Use it after research, debugging, planning, or completed milestones, with instructions about which information should remain available.
Why use it?
It helps preserve important decisions and findings while removing trial-and-error details that are no longer needed.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths; mentions CLAUDE.md; built for openclaw.

Good fit Use it after research, debugging, planning, or completed milestones, with instructions about which information should remain available.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/myths-labs/muse/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 myths-labs/muse --skill strategic-compact
Clone the repo
git clone --depth 1 https://github.com/myths-labs/muse

Made for: Claude Code.

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/myths-labs/muse/strategic-compact/github.svg)](https://agentmods.dev/skills/myths-labs/muse/strategic-compact)
Your own site
<a href="https://agentmods.dev/skills/myths-labs/muse/strategic-compact"><img src="https://agentmods.dev/badge/skills/myths-labs/muse/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/myths-labs/muse/strategic-compact"><img src="https://agentmods.dev/badge/skills/myths-labs/muse/strategic-compact.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 967 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00037 $0.00967
Opus 5 $0.00018 $0.00483
Sonnet 5 $0.00007 $0.00193
Haiku 4.5 $0.00004 $0.00097

Measured 2d ago against content hash 449465637530, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade B, and why

strategic-compact scanned grade B with 1 finding 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 2d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Add to your `~/.claude/settings.json`:
skills/core/strategic-compact/SKILL.md · 105 lines

How it starts

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

Strategic Compact Skill

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

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, keep plan
  • After completing a milestone — Fresh start for next phase
  • Before major context shifts — Clear old context before different task

Focus-Aware Compaction (inspired by OpenClaw)

Blind compaction = blind discards. Focus-directed compaction = preserving key information.

Usage: Specify what to preserve when manually compacting.

Scenario: Completed 3 hours of debugging, now starting a new feature
✅ /compact preserve root cause analysis and fix approach, discard trial-and-error debugging
❌ /compact (blind compaction may discard root cause analysis)

Common focus templates:

Scenario Focus Directive
After debugging Preserve root cause and fix approach, discard trial-and-error
After planning Preserve final plan and key decisions, discard alternative discussions
After code review Preserve items to change, discard confirmed-OK sections
After strategy discussion Preserve strategic decisions and metrics, discard brainstorming process
After multi-file edits Preserve which files changed and why, discard file content details

When to Trigger Compaction

Signal Action
Completed a full milestone ✅ Good time to compact
Switching from exploration to execution ✅ Good time to compact
Debugging complete, starting new feature ✅ Good time to compact
In the middle of multi-step implementation ❌ Do NOT compact
Still analyzing a problem ❌ Do NOT compact
/ctx shows 60-70% consumed 🟡 Consider compacting
/ctx observes ≥80% pressure Save the current Lane, compact if supported, verify and continue

Read the full file on GitHub · 105 lines

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. 2d ago Changed 449465637530
  2. 10d ago First seen · 105 lines · 37 tokens per session scan B 99f1dfb7596b

Subscribe to this mod's changes

strategic-compact is a skill published in the GitHub repository myths-labs/muse (32 stars, last pushed 3d ago), licensed MIT. It adds 37 tokens to every session and 967 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.