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.
npx agentmods add skills/junmystery/agent-guidance-python/strategic-compactnpx skills add JunMystery/Agent-Guidance-Python --skill strategic-compactgit clone --depth 1 https://github.com/JunMystery/Agent-Guidance-PythonWrote 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.
[](https://agentmods.dev/skills/junmystery/agent-guidance-python/strategic-compact)<a href="https://agentmods.dev/skills/junmystery/agent-guidance-python/strategic-compact"><img src="https://agentmods.dev/badge/skills/junmystery/agent-guidance-python/strategic-compact.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00027 | $0.01420 |
| Opus 5 | $0.00014 | $0.00710 |
| Sonnet 5 | $0.00005 | $0.00284 |
| Haiku 4.5 | $0.00003 | $0.00142 |
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 yesterday.
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`: This is a copy
86% identical to strategic-compact — 37 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 137 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 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 combines two signals:
- Context size (primary) — Reads the latest
usagerecord from the session transcript (transcript_pathin the hook payload) and sumsinput_tokens + cache_read_input_tokens + cache_creation_input_tokens(the true context size of the turn). Suggests/compactat a window-scaled threshold — 160k tokens on a 200k window, 250k on a 1M window (detected from a[1m]model marker, or inferred when observed tokens already exceed 200k) — and re-reminds after every additional 60k tokens of context growth - Tool-call count (secondary) — Counts tool invocations in session; suggests at a configurable threshold (default: 50 calls), then every 25 calls after
Tool count alone is a weak proxy for window pressure: a few large file reads or MCP responses can fill the window in very few calls, while many tiny calls can cross 50 with a near-empty window. The context-size signal fires when it actually matters.
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.
- yesterday First seen · 137 lines · 27 tokens per session scan B 3eb441c2aa3a
strategic-compact is a skill published in the GitHub repository JunMystery/Agent-Guidance-Python (2 stars, last pushed 1mo ago), licensed MIT. It adds 27 tokens to every session and 1,420 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). It is 86% identical to strategic-compact, differing in 37 lines, and is treated as a copy.
Other skills, from other repositories
init-workspace-documentation
Skill "init-workspace-documentation" from griddynamics/rosetta, covering agent memory.md, agent memory, preventive rules, what worked and what failed.
memorix-sessions
Use when resuming work, preparing handoff context, binding an HTTP control-plane project, or deciding whether sessionstart is useful.
vault-for-llm
Connect OpenClaw to Vault Agent Memory as a local-first governed project memory layer. Search first, then bounded-read cited source ranges; propose new memories as candidates instead of writing directly into active memory.
c-13-install-and-onboard
After the harness starter package and MCP server are wired and the harness has restarted, run/verify runtimeinstall, set up the memory repo, bootstrap onboarding when scaffolding new, and configure providers to index the code and memory.
mem0-api
Complete reference for building applications with the Mem0 memory API and SDK — a persistent, self-improving memory layer for LLM agents and chatbots. ALWAYS use this skill when the user mentions: "mem0", "mem0ai", "MemoryClient", "Memory()", "memory layer for AI", "persistent agent memory", "long-term memory for…
c-04-retrieval-strategy-router
Choose retrieval strategies across memory substrates: semantics for known concepts with unknown structure, relationships for known anchors with unknown connections, and intent for hidden contracts and code truths.