compact-guard — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited compact-guard (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
"After context compaction occurs during plan mode execution, Claude Code fails to re-read or reference the existing plan." — issue #24686
"Plan mode state lost after context compression." — issue #26061
You're 30 turns into a careful refactor. /compact runs (manually or because you hit the auto-compact threshold). The summarizer condenses everything, including the plan you were halfway through. Claude wakes up on the other side without the plan, and you have to re-prompt from scratch.
compact-guard snapshots the plan before compaction touches it, then re-injects the snapshot as context immediately after, so the post-compact turn starts knowing the current task, active todos, files touched, and the most recent plan.
/compact (manual) or auto-compact at threshold
│
▼
PreCompact hook fires
│
▼
Read transcript → extract:
• Most recent user message (the current task)
• Latest TodoWrite todos (pending + in_progress only)
• Files edited this session (Edit / Write / MultiEdit)
• Last assistant text block (likely the working plan)
│
▼
Write .papercuts/compact-snapshots/<timestamp>.md
(keeps 5 most recent — oldest pruned)
Compaction runs. The summarizer eats most of the context.
Next session start with source="compact"
│
▼
SessionStart hook fires
│
▼
Read the latest snapshot → print to stdout
Claude Code auto-injects stdout as additional context/claude-papercuts:compact-guardcompact ran
When asked to show compact-guard state:
.papercuts/compact-snapshots/ exists in the project root.— the directory will populate on the first PreCompact. Then stop.
format is plain markdown — don't summarize.
you to clean them up, ask for explicit confirmation first.
Each snapshot is a markdown file in .papercuts/compact-snapshots/<UTC-timestamp>.md:
# compact-guard snapshot
- **When:** 2026-05-16 09:14 UTC
- **Trigger:** auto-compact
- **Session:** abc123def456
## Current task (last user message)
> <the most recent user prompt>
## Active todos
- [in_progress] <todo content>
- [pending] <todo content>
## Files edited this session
- `src/middleware/auth.ts`
- `src/__tests__/auth.test.ts`
## Last assistant message (plan / summary)
<the last assistant text block — usually the working plan, capped at 1500 chars>Sections that have nothing useful are omitted. Total snapshot file is uncapped because it's read on demand, not auto-injected into the system prompt.
case you want to inspect a series of compactions.
.papercuts/compact-snapshots/ relative to the project's cwd.
/clear, /resume, or startup —only post-compact. Use amnesia-fix for cross-session continuity.
Snapshots are written to a local file in your project's .papercuts/ directory. No network calls. Add .papercuts/ to your .gitignore if not already.
If Anthropic ships a compact-resilient plan-mode (per issues #24686 and #26061), this skill becomes a no-op and gets deprecated in the next monthly release with the date.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.