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 skills add chrisallenlane/claude-swe-workflows --skill pre-compactgit clone --depth 1 https://github.com/chrisallenlane/claude-swe-workflowsWrote 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/chrisallenlane/claude-swe-workflows/pre-compact)<a href="https://agentmods.dev/skills/chrisallenlane/claude-swe-workflows/pre-compact"><img src="https://agentmods.dev/badge/skills/chrisallenlane/claude-swe-workflows/pre-compact/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/skills/chrisallenlane/claude-swe-workflows/pre-compact"><img src="https://agentmods.dev/badge/skills/chrisallenlane/claude-swe-workflows/pre-compact.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.00069 | $0.01753 |
| Opus 5 | $0.00034 | $0.00877 |
| Sonnet 5 | $0.00014 | $0.00351 |
| Haiku 4.5 | $0.00007 | $0.00175 |
Grade A, and why
pre-compact 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 10d 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.
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.
How it starts
The opening of the file, as written. The whole thing — 187 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Pre-Compact - Session Housekeeping Before Compaction
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.
Philosophy
- Persist before you compact. If a fact will matter next session, 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.
- Surface uncertainty instead of guessing. When unsure whether something is trash, abandoned, or important, ask the user.
- Bias toward asking, not committing. Never commit on the user's behalf without per-invocation permission. Standing rules from CLAUDE.md still apply.
- The checklist is a floor, not a ceiling. Walk every item, but also use judgment to spot session-specific cleanup the checklist cannot anticipate.
- Do not invoke /compact yourself. Compaction is the user's call.
Workflow
1. Persistent memory pass
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:
- About the user: role, expertise, preferences, current focus
- Feedback: corrections received OR non-obvious approaches the user confirmed worked. Capture the why the user gave, not just the rule.
- Project state: ongoing initiatives, constraints, deadlines, decisions, stakeholder context. Convert relative dates to absolute ones.
- External references: pointers to issue trackers, dashboards, channels, docs the user mentioned
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.
- 10d ago First seen · 187 lines · 69 tokens per session scan A 5bedad706c83
pre-compact is a skill published in the GitHub repository chrisallenlane/claude-swe-workflows (18 stars, last pushed 3mo ago), licensed MIT. It adds 69 tokens to every session and 1,753 once invoked, about $0.0003 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 skills, from other repositories
brain-sync
Sync knowledge and learnings to the shared appie-brain repo. Every Appie commits with their own identity so contributions are traceable. Use after: complex tasks (5+ tool calls), significant discoveries, new skills, or client work. Fleet: Appie-1 (Orchestrator/MacMini), Appie-2 (CMO/DO), Appie-3 (CTO/VPS).
project-context-sync
Keep a living project state document updated after each commit, so any agent (or future session) can instantly understand where things stand.
afc:release-notes
Generate release notes from git history.
afc:launch
Generate release artifacts — version bump, changelog, release tags.
hyperfocus-recovery
Reconstruct context after a deep session or interruption from git diff, modified files, and recent commits, then propose the next concrete action. Use when the user says "what was I doing", "where did I leave off", "lost my place", or invokes /hyperfocus-recovery.
hive.note-taking
Maintain a free-form scratchpad of decisions, extracted values, and open questions so context pruning doesn't lose anything you still need.