pre-compact — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited pre-compact (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
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.
The user is about to run /compact. Compaction destroys conversation context. Anything important from this session that is not persisted somewhere durable — memory files, commits, tickets, code, the issue tracker — is lost.
This skill is the last-chance pass to capture session state. Walk a fixed checklist as a floor, then use judgment for anything the checklist does not anticipate, and end with an SBAR-formatted go/no-go report.
it goes into persistent memory now. If a change should be in the project, it gets committed (with permission). If an artifact is trash, it gets deleted.
something is trash, abandoned, or important, ask the user.
behalf without per-invocation permission. Standing rules from CLAUDE.md still apply.
also use judgment to spot session-specific cleanup the checklist cannot anticipate.
Updating persistent memory is the core reason this skill exists. The user invokes /pre-compact because they want memory written before compaction. Do not skip this step or treat it as conditional. Follow whatever memory conventions are documented in the user's global or project CLAUDE.md (auto-memory directory, project notes, etc.).
Re-scan the session for facts worth saving across conversations. Look for:
user confirmed worked. Capture the why the user gave, not just the rule.
decisions, stakeholder context. Convert relative dates to absolute ones.
channels, docs the user mentioned
For each candidate:
than writing a duplicate.
git log / currentcode, or ephemeral to this conversation.
(architecture, conventions, fix recipes, ephemeral state).
Run git status and assess:
whether to commit. If yes, draft a commit message and ask for approval before running git commit.
survives compaction, so the files are not at risk — but the context about what is in flight may be. Either commit as WIP, or capture the in-flight state in the SBAR.
work product that should be tracked.
mid-rebase, mid-merge, conflicts) so the user is aware before compacting.
Do not commit or stage on the user's behalf without explicit per-invocation permission. Match the scope of any granted permission exactly.
Identify candidate trash:
/tmp/*,*.bak, ad-hoc test scripts, debug dumps)
scratch.*, debug.*,tmp_*, nohup.out)
For each candidate:
not delete.
A false delete loses the user's work-in-progress. A false retain costs nothing. Bias accordingly.
Walk the session and look for anything else that would be hard to reconstruct from git log + persistent memory + the issue tracker after compaction. Examples (non-exhaustive — the point of this step is to think past the checklist):
ticket, commit message, code comment, or memory
options proposed but not chosen
state
run_in_background tasks, devservers, watchers) that the user may have forgotten about
context is lost
For each item: either persist it now (memory, ticket, comment) or flag it explicitly in the SBAR.
Per the user's session handoff format:
work right now
what surprised
— verified (ran the command, read the file), inferred (reasoned from observation), or recalled (training knowledge, possibly stale)
at risk.
user (commit a staged change, answer a pending question); after that, compaction is fine.
would lose load-bearing context that has not been captured.
Keep each field tight — one to three lines. The user reads this returning to a stale tmux pane, and may also use it to brief the post-compaction version of the session.
The post-compaction agent reads the lossy summary, not the live conversation. A resume prompt drafted now, while full context is still in scope, is far higher-quality than what that agent could reconstruct from the summary. Always emit one of two outputs in this step — never silently skip it, since absence is ambiguous.
If there is pending work the next turn should pick up, emit a single fenced block the user can copy clean into the next prompt. The block must be:
conversational.
made, constraints already negotiated, and the next concrete step. Do not write "continue where we left off" — write "edit path/to/file.py:42 to do Y, then run Z."
open, pick the load-bearing one here and let the SBAR's Recommendation field flag the others.
If there is no pending work, emit exactly this line and nothing else in this step:
No resume prompt — work is sealed.
Wait for the user. Do not run /compact. Do not start new implementation work — this skill exists to seal the session, not to extend it.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.