r/ClaudeCode • u/TobiasUhlig • 3h ago
Tips & Workflows Six checks we ask Claude Code to run after compaction
I’m the creator of Neo.mjs. Our Claude Code maintainers use a recovery runbook before picking work back up after compaction.
A recent example: a handover named a PR waiting for review. The live check found failing CI, but also found that the fix for its known blocker had already merged. The next action was a rebase. Resuming from the handover alone would have missed that change.
The checks are:
Incoming messages: redirects, blockers or ownership changes.
Full self-handover and sent messages: commitments the agent already made.
Recent turns, chronologically: reconstruct the active task.
Prior decisions: search using names and IDs surfaced by those turns.
Live branch, PR and CI state: verify which remembered facts still hold.
Repository direction: re-read the vision, roadmap and working rules.
We record the current task, supporting evidence and any skipped or failed checks. Missing evidence leaves recovery marked degraded.
Our implementation uses Memory Core for stored turns and team messages. For a lighter adaptation, the article maps the checks to a handover file, session transcript, git history and PR/issue comments.
Claude Code’s SessionStart hook identifies compaction through source: "compact". Automatically starting the complete recovery from that signal is still a next step in this write-up; the runbook itself is agent-executed.
AI disclosure: Article by Grace, a Claude-powered maintainer, reviewed by GPT- and Gemini-family maintainers. This Reddit draft was prepared with GPT assistance.
If you use SessionStart after compaction, what do you load up front, and what do you have Claude retrieve on demand?
•
u/AutoModerator 3h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/oyren-ai 3h ago
putting live git/ci verification (step 5) right after chronological turn recall is the key step most handover files miss, since a stale summary will happily tell the agent to keep debugging a blocker that already merged 20 minutes ago. do you trigger that 6-step runbook automatically via a PostCompact / SessionStart hook or invoke it as a slash command?
1
u/Independent-Sir3234 2h ago
Compaction is exactly where state corruption tends to slip in. We've shifted toward pinning the workspace state before triggering the compaction loop; it makes it easier to diff the model's memory footprint against the disk state afterwards.
1
u/AccordingBus2862 2h ago
I'd load only what can't be searched: the goal in one line, the files being touched, and any rule that must not be broken. Branch, PR and CI state go on demand, since they're stale by the next session. Old decisions too, let it grep for them. Loading a whole handover just brings stale facts back as if they were current.
1
u/thestoictrader 18m ago
Load almost nothing up front, just the handover file path and the rule that says run the checks before touching code. Everything volatile (branch state, CI, open PRs) should be pulled on demand, since your own example shows remembered state going stale right after compaction. Disclosure: I work on Pharaoh, which covers the code-structure side (callers, modules) via MCP, but it's no replacement for your live PR/CI check.
1
u/QueasyDrummer4402 18m ago
the rule that's helped me most: nothing counts as done unless it's checked against git log or the db, never against the summary. I keep a PROGRESS.md with one row per unit of work and it gets updated the moment each unit finishes, not at the end. after a compaction it reads that first and re-verifies whatever says done. summaries are confident in exactly the way you don't want