strategic-compact

strategic-compact is a skill for Claude Code from mshadmanrahman/pm-pilot. It costs 15 tokens per session (508 once invoked), scanned A, original, MIT.

A workflow for monitoring how much conversation context a coding session uses and suggesting a reset at sensible milestones. It preserves important task state, decisions, file paths, and unfinished work before recommending compaction.

In plain words
What is it for?
Use it to decide when to compact context after planning, implementation, review, or triage, while recording the information needed to continue.
Why use it?
It helps prevent long sessions from becoming slower or less accurate when older context fills the available space.

Skill for Claude Code

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

Part of the pm-productivity plugin — 6 skills shipped together

Good fit Use it to decide when to compact context after planning, implementation, review, or triage, while recording the information needed to continue.

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

Made for: Claude Code.

Or install pm-productivity, the plugin that ships this one along with the rest of its 6 skills.

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/mshadmanrahman/pm-pilot/strategic-compact/github.svg)](https://agentmods.dev/skills/mshadmanrahman/pm-pilot/strategic-compact)
Your own site
<a href="https://agentmods.dev/skills/mshadmanrahman/pm-pilot/strategic-compact"><img src="https://agentmods.dev/badge/skills/mshadmanrahman/pm-pilot/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/mshadmanrahman/pm-pilot/strategic-compact"><img src="https://agentmods.dev/badge/skills/mshadmanrahman/pm-pilot/strategic-compact.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 15 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 508 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00015 $0.00508
Opus 5 $0.00008 $0.00254
Sonnet 5 $0.00003 $0.00102
Haiku 4.5 $0.00002 $0.00051

Measured 9d ago against content hash 6c412cce0ee7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 9d 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.

plugins/pm-productivity/skills/strategic-compact/SKILL.md · 80 lines

How it starts

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

Strategic Compact

Proactively manage context window to prevent degraded performance in long sessions.

When to Use

  • Context usage exceeds 60%
  • After completing a major planning phase
  • After finishing implementation, before review
  • Before starting a fundamentally different task
  • When responses start feeling slower or less precise

Procedure

  1. Assess Context State

    • Estimate current context consumption
    • Identify which content is load-bearing vs stale
  2. Identify Compaction Point Suggest compaction at natural milestones:

    • After planning: decisions locked, plan documented
    • After implementation: code committed, tests passing
    • Before review: implementation complete, shifting to review mode
    • After triage: results documented, moving to fixes
  3. Preserve Key State Before suggesting /clear, ensure these are persisted:

    • Active task and status in tasks/todo.md
    • Key decisions in handoff doc or tasks/lessons.md
    • Any uncommitted work is committed or stashed
    • File paths of actively-edited files
  4. Suggest Compaction Output:

    Context check: ~{percent}% used
    Milestone: {what was just completed}
    Recommendation: {compact now / safe to continue / approaching limit}
    
    Before /clear:
    - [ ] Handoff doc written
    - [ ] Work committed
    - [ ] Todo updated
    
  5. Post-Compaction Recovery After /clear, use session-init skill to restore context.

Output Format

Context check: ~65% used
Milestone: Implementation phase complete
Recommendation: Good time to compact before code review

Before /clear:
- [ ] Handoff doc written
- [ ] Work committed (3 files)
- [ ] Todo updated

Rules

  • Never force compaction; always suggest
  • Never compact mid-task; wait for a milestone
  • Always write handoff doc before suggesting /clear
  • Err on the side of compacting earlier rather than later
  • The last 20% of context window produces degraded output

Read the full file on GitHub · 80 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. 9d ago First seen · 80 lines · 15 tokens per session scan A 6c412cce0ee7

Subscribe to this mod's changes

strategic-compact is a skill published in the GitHub repository mshadmanrahman/pm-pilot (20 stars, last pushed 3d ago), licensed MIT. It adds 15 tokens to every session and 508 once invoked, about $0.0001 per session on Opus 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-08-30.

Related

Other skills, from other repositories

hive.context-preservation

Proactively extract critical values from tool results into working notes before automatic context pruning destroys them.

aden-hive/hive · 24 tokens

hive.note-taking

Maintain a free-form scratchpad of decisions, extracted values, and open questions so context pruning doesn't lose anything you still need.

aden-hive/hive · 30 tokens

caveman-compress

Compress natural language memory files (CLAUDE.md, todos, preferences) into caveman format to save input tokens. Preserves all technical substance, code, URLs, and structure. Compressed version overwrites the original file. Human-readable backup saved as FILE.original.md. Trigger: /caveman-compress FILEPATH or…

stevesolun/ctx · 77 tokens

continuous-learning-v2

Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.

sangrokjung/claude-forge · 33 tokens

lat-md-knowledge-graph

Design or audit a repo-local markdown knowledge graph with wiki links, source-code backlinks, drift checks, and searchable sections. Use when AGENTS.md/CLAUDE.md is too flat for a large codebase or when a custom harness needs durable structured project memory.

stevesolun/ctx · 60 tokens

analyze-codebase

Run comprehensive PLG analysis on a codebase to detect tech stack, existing growth features, and revenue opportunities. Use when the user says "analyze", "scan", "audit codebase", or "find growth opportunities".

SkeneTechnologies/skene · 50 tokens