← ClaudeAtlas

save-before-compactlisted

Use ONLY when the user explicitly wants to compact a long session without losing its learnings — triggers like "save before compact" / "wrap up and compact" / "session's too long, compact but keep the takeaways" / "capture learnings then compact". NEVER fire unsolicited. This skill APPLIES changes (CLAUDE.md / preference-file additions, memory, new skills) and writes a resume brief, then stops for the user to run /compact — it never runs /compact itself. Thin sessions get only the resume brief; in-flight high-stakes ops defer (Step 1 has the thresholds).
damson/hard-won-skills · ★ 1 · AI & Automation · score 67
Install: claude install-skill damson/hard-won-skills
# Save before compact ## Procedure Run a task per step, in order. Any step can short-circuit per its stated skip conditions. ### Step 1 — Pre-flight - Count substantive turns (ignore < 10-word acknowledgements: `thanks`, `ok`, `yes`, `nice`). If `< 15`, say so and skip straight to the resume brief (Step 8) — nothing worth persisting, but the pick-up note still gets written. - Detect context: is there a `CLAUDE.md` / `AGENTS.md` nearby? a skill-structure test suite or a config eval command, if the repo ships either (check its README / justfile / package scripts — do not assume names)? Record what's available — later steps branch on it. - Defer (one line, then stop) if a high-stakes op is in flight — scan the last ~5 turns for a deploy / merge / rebase / migration / incident command whose completion was never confirmed (confirmed = its success output is in the transcript, or the user said it landed) — or if this is another operator's transcript. ### Step 2 — Reflect & route List candidate facts under these categories: commands discovered, code-style patterns followed, testing approaches that worked, environment/config quirks, gotchas, decisions made. Then apply the **keep-test** — keep a fact only if (a) it would prevent a mistake a capable future session would realistically make (not restate the default behaviour, or what a neighbouring directive/test already implies) and (b) it is not already stated in an existing config/CLAUDE.md file. When unsure, drop