bug-fix
Bug-fixing workflow that coordinates diagnosis, test-driven reproduction, root-cause analysis, and targeted fixes. Use when the user wants to fix a bug with…
Pre-compaction housekeeping. Walks a checklist (persistent memory updates, git hygiene, trash cleanup) plus an open-judgment audit, produces an SBAR with a go/no-go recommendation, and emits a copy-pasteable resume prompt for the post-compaction agent if work remains. Run this
$ npx -y skills add chrisallenlane/claude-swe-workflows --skill pre-compact --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/pre-compactContext preview
The summary Claude sees to decide when to auto-load this skill.
Pre-compaction housekeeping. Walks a checklist (persistent memory updates, git hygiene, trash cleanup) plus an open-judgment audit, produces an SBAR with a go/no-go recommendation, and emits a copy-pasteable resume prompt for the post-compaction agent if work remains. Run this
name: pre-compact description: Pre-compaction housekeeping. Walks a checklist (persistent memory updates, git hygiene, trash cleanup) plus an open-judgment audit, produces an SBAR with a go/no-go recommendation, and emits a copy-pasteable resume prompt for the post-compaction agent if work remains. Run this immediately before /compact. model: opus
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.
code, 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:
`*.bak`, ad-hoc test scripts, debug dumps)
`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
servers, 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.
A system of composable software engineering workflows for Claude Code. Plan projects, implement tickets, and run quality passes — from a single ticket to a multi-batch project, using the same layered architecture.
Repo: chrisallenlane/claude-swe-workflows
Bug-fixing workflow that coordinates diagnosis, test-driven reproduction, root-cause analysis, and targeted fixes. Use when the user wants to fix a bug with…
Proactive bug-hunting workflow. Assesses codebase risk through complexity, coverage, and structural analysis, then spawns focused investigators that write…
Multi-ticket batch workflow. Takes a batch of tickets, plans execution order, implements each via /implement in autonomous mode, runs cross-cutting quality…
Full-lifecycle project workflow. Takes batched tickets, implements via /implement-batch, runs smoke tests, then executes a comprehensive quality pipeline…
Iterative development workflow that coordinates implementation, refactoring, QA, and documentation agents to complete features systematically. Use when the…
Autonomous bug-elimination loop. Iteratively invokes /bug-hunt and /implement-batch until findings converge below an operator-specified severity floor. At…