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 commands/sammcj/agentic-coding/compact-prepgit clone --depth 1 https://github.com/sammcj/agentic-codingWhat 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.00030 | $0.00393 |
| Opus 5 | $0.00015 | $0.00197 |
| Sonnet 5 | $0.00006 | $0.00079 |
| Haiku 4.5 | $0.00003 | $0.00039 |
Grade A, and why
compact-prep 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 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.
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.
What it actually says
This is an automated message to state that the context window usage is getting high and the user is going to run a compaction
As such, could you please:
-
(Only if applicable) Update any state that tracks the work currently in progress / the state of the tasks being worked on, e.g. A development plan if operating from one, the CLAUDE.md ( Only if that is where the user has asked you to track in flight work and it does not only contain rules), etc... to ensure it's up to date without any now outdated or invalid information, if it has next steps that they are correct, and if you're mid troubleshooting a complex problem - where you've got to and what you've tried so far (but keep it concise).
-
Give me a concise prompt that I can provide to the compaction agent that will be compacting our conversation to ensure the signal to noise ratio is kept high and focused. The agent will already be aware of it's task to compact the conversation so only needs additional guidance on specific things that may not be obvious but are important to keep (e.g. the WHY not just the WHAT).
-
Give me a concise prompt that I can provide to continue our work after compaction is complete. Keep in mind that the new agent / session will have access to the same files and will have the same CLAUDE.md agent rules in context.
Be terse / concise. Don't add filler. Less is more. The agent reading this is a capable model, not an audience. TLDRs are great.
Note: You must not quote, indent or format the prompts in any way that might impact me copying and pasting them without cleaning them up.
$ARGUMENTS
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 · 23 lines · 30 tokens per session scan A 7fbdda1f5d8b
compact-prep is a command published in the GitHub repository sammcj/agentic-coding (158 stars, last pushed 7d ago), licensed Apache-2.0. It adds 30 tokens to every session and 393 once invoked, about $0.0002 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.
Other commands, from other repositories
hatch3r-incident-response
Drive a live production incident through a structured lifecycle -- triage + topology, bounded-autonomy mitigation, stakeholder communication, then a blameless post-mortem with runbook -- via delegated sub-agents.
release-swarm
Orchestrate complex software releases using AI swarms that handle everything from changelog generation to multi-platform deployment.
code-review-swarm
Deploy specialized AI agents to perform comprehensive, intelligent code reviews that go beyond traditional static analysis.
release-manager
Automated release coordination and deployment with ruv-swarm orchestration for seamless version management, testing, and deployment across multiple packages.
issue-tracker
Intelligent issue management and project coordination with ruv-swarm integration for automated tracking, progress monitoring, and team coordination.
swarm-pr
Create and manage AI swarms directly from GitHub Pull Requests, enabling seamless integration with your development workflow.