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.
git clone --depth 1 https://github.com/sefaertunc/WorclaudeWrote 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/commands/sefaertunc/worclaude/compact-safe)<a href="https://agentmods.dev/commands/sefaertunc/worclaude/compact-safe"><img src="https://agentmods.dev/badge/commands/sefaertunc/worclaude/compact-safe/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.
<a href="https://agentmods.dev/commands/sefaertunc/worclaude/compact-safe"><img src="https://agentmods.dev/badge/commands/sefaertunc/worclaude/compact-safe.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00008 | $0.00806 |
| Opus 5.5 | $0.00003 | $0.00322 |
| Sonnet 5.5 | $0.00002 | $0.00161 |
| Haiku 4.5 | $0.00001 | $0.00081 |
Grade D, and why
compact-safe scanned grade D with 2 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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
node -e 'const s = require("./.claude/settings.json"); console.log(JSON.stringify(s.hooks?.PostCompact || []))' Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
patterns: `rm -rf`, `git reset --hard`, `git push --force`, `DROP TABLE`, How it starts
The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/compact-safe adds pre-flight safety checks to bare /compact. Compaction
loses fine-grained conversation state; running it on a session with
uncommitted work, mid-implementation TODOs, or recent destructive operations
risks losing context the user expected to keep. This command surfaces those
risks before triggering compaction.
Pre-flight safety checks
Run all four checks. Report the findings as a short table. Stop and ask the user for confirmation if any check trips.
1. Uncommitted changes
git status --porcelain
If output is non-empty, surface a warning: "You have N uncommitted changes. Compaction loses references to specific files and line numbers — consider committing or stashing first."
Offer via AskUserQuestion:
commit— write a WIP commit before compacting (reversible)stash— stash changes, compact, thengit stash popafterproceed— compact anyway (you accept the risk)cancel— abort compaction
2. In-flight work signals
Scan for indicators that compaction would lose useful context:
- Recent test failures — check the last
npm test/vitest/pytestoutput if available. If there are failing tests, warn the user and offer to run/verifyfirst to capture the failure list before compacting. - Mid-implementation TODOs —
grep -rn "TODO(claude)\|FIXME\|XXX" src/on files changed in the last hour (git diff --name-only HEAD@{1.hour.ago}if available, otherwise--name-only HEAD~1). If matches exist, surface them — they may be context Claude needs to remember.
3. Recent destructive operations
Check the last 20 commands in transcript or shell history for destructive
patterns: rm -rf, git reset --hard, git push --force, DROP TABLE,
etc. If any were run within the last 30 minutes, warn the user — they may
want to keep the conversation context until they verify the destructive
op landed correctly.
4. PostCompact hook verification
Confirm .claude/settings.json has a PostCompact hook configured. Without
it, compaction strips CLAUDE.md / PROGRESS.md context permanently. If the
hook is missing, surface a warning and stop — compacting in this state
silently breaks Claude's session orientation.
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.
- 3mo ago First seen · 90 lines · 8 tokens per session scan D d3d57483d287
compact-safe is a command published in the GitHub repository sefaertunc/Worclaude (4 stars, last pushed 3mo ago), licensed MIT. It adds 8 tokens to every session and 806 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it D with 2 findings (reads agent configuration directories, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
compact-safe compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| compact-safesefaertunc/Worclaude | Command | 4 | 3mo ago | MIT | D | 8 | Claude Code |
| memorizelucasrosati/claude-code-memory-setup | Command | 1.1k | yesterday | MIT | A | 0 | Claude Code |
| context-statstravisjneuman/.claude | Command | 115 | 2d ago | MIT | A | 7 | Claude Code |
| handofftravisjneuman/.claude | Command | 115 | 2d ago | MIT | A | 8 | Claude Code |
| handoffflonat/flonat-research | Command | 155 | 16d ago | MIT | A | 48 | Claude Code |
| budgetcukas/remembrall | Command | 6 | 7d ago | MIT | A | 13 | Claude Code |
| packPierry/harness-kit | Command | 4 | 1mo ago | MIT | A | 18 | Claude Code |