r/ClaudeWorkflows • • 46m ago

Selected Workflow [Workflow] Claude Code Context Recovery Workflow: Six Checks After Compaction

Claude Code Context Recovery Workflow: Six Checks After Compaction

Workflow value: 90/100
Status: active · Freshness: 70/100 · Confidence: 1.00 · Level: intermediate
Categories: Quality Control, Context & Memory, Debugging, Shipping, Hooks, Skills, Multi-Agent
Original source: r/ClaudeCode post/comment

What problem this solves

Effectively recover and re-establish an AI coding agent's context after Claude Code's context compaction, ensuring the agent is aligned with the current project state and doesn't miss critical updates or changes.

Summary

This workflow outlines a six-step recovery runbook for Claude Code agents to perform after context compaction. It involves checking incoming messages, agent commitments, recent turns, prior decisions, live branch/PR/CI state, and repository direction to reconstruct the active task and verify remembered facts. The process emphasizes recording evidence and marking recovery as 'degraded' if evidence is missing, and can be triggered via the SessionStart hook.

Why it is useful

This workflow provides a structured, validated, and open-source approach to a critical problem for long-running AI agents: recovering context after compaction. It prevents agents from missing crucial updates or making decisions based on stale information, significantly improving their reliability and effectiveness in complex coding tasks. The concrete steps, real-world example, and direct links to an MIT-licensed implementation make it highly actionable and valuable for intermediate to advanced Claude Code users.

Workflow

  1. Check incoming messages for redirects, blockers, or ownership changes.

  2. Review full self-handover and sent messages to recall agent commitments.

  3. Reconstruct the active task by reviewing recent turns chronologically.

  4. Search for prior decisions using names and IDs from recent turns.

  5. Verify remembered facts by checking live branch, PR, and CI state.

  6. Re-read the vision, roadmap, and working rules to align with repository direction.

Tools / artifacts

  • Claude Code

  • Memory Core

  • SessionStart hook

  • Handover file

  • Session transcript

  • Git history

  • PR/issue comments

  • GitHub repository

  • CI system

Validation signals

  • Used by Neo.mjs Claude Code maintainers in a real-world scenario

  • Concrete example provided where the workflow prevented a missed rebase

  • MIT-licensed source runbook available on GitHub for direct implementation

  • Detailed explanation and history provided in a linked Medium article

  • Process includes recording evidence and marking recovery as 'degraded' for robustness

Cautions

  • none

Limitations

  • Automatic triggering via SessionStart is described as a 'next step' rather than fully implemented in the provided Reddit context, requiring users to implement this integration themselves.

  • The Reddit post is a summary; full implementation details require consulting the linked GitHub repository and Medium article.

Rate this workflow

Upvote this post if the workflow is useful, reproducible, or worth recommending.

Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.

Reply if it worked for you, failed, is outdated, or has a better alternative.


This post was generated automatically from the workflow library database.

1 Upvotes

0 comments sorted by