This tutorial was AI-generated and is being fleshed out. Content may be incomplete or change.

Session Recovery

Context compaction is inevitable. Sessions end. But the decision graph survives. Watch how Claude recovers full context from scratch.

The Problem

When you start a new Claude session—or when the context window compacts—Claude loses memory of previous work. Without deciduous, this means:

With deciduous, Claude can query the graph and recover all of this in seconds.

The /recover Command in Action

At the start of a new session, the user runs /recover. Watch what happens:

New Claude Code Session
❚❚
Animation paused
You
/recover
Claude
Recovering context from decision graph...
Claude
deciduous nodes --branch feature/rate-limiting -n 20
Querying decisions on current branch...
Claude
#47 [goal] Add rate limiting to API [90%]   ↳ #48 [decision] Choose rate limiting strategy [75%]     ↳ #49 [option] Redis-based with sliding window [80%]     ↳ #50 [option] In-memory with token bucket [70%]     ↳ #51 [action] Implementing Redis rate limiter [85%]       ↳ #52 [outcome] Rate limiting working [95%] [commit: abc123]
Claude
deciduous edges | grep -E "(47|48|49|50|51|52)"
Claude
Edge 47→48: leads_to "Deciding implementation approach"
Edge 48→49: leads_to "Scales across instances, persistent"
Edge 48→50: leads_to "Simpler, but single-instance only"
Edge 48→51: chosen "Redis already in stack, needs horizontal scaling"
Edge 51→52: leads_to "Implementation verified with tests"
Claude
git log --oneline -5
abc123 feat: add Redis-based rate limiting
def456 fix: user validation edge case
...
Claude
Context Recovered:
Current branch: feature/rate-limiting

Goal: Add rate limiting to the API

Decision made: Redis-based sliding window approach
Rationale: Redis already in use, needed to scale horizontally

Rejected: In-memory token bucket (single-instance only)

Status: Implementation complete (commit abc123)
The rate limiting feature appears complete.
Claude
What would you like to work on next?

What Gets Recovered

From the decision graph, Claude can recover everything it needs:

Information Source
Goals being worked on goal nodes
Decisions made decision nodes + chosen edges
Alternatives rejected option nodes + edge rationales
Why decisions were made Edge rationales (-r)
User's original request -p prompt on goal nodes
Current status outcome nodes + linked commits

Branch-Scoped Context

When working on a feature branch, filter context to that branch:

Branch-Scoped Recovery
❚❚
Animation paused
Claude
deciduous nodes --branch feature/auth
Claude
#95 [goal] Add JWT authentication [90%]   ↳ #96 [decision] Token storage strategy [80%]     ↳ #97 [option] httpOnly cookies [85%]     ↳ #98 [option] localStorage [60%]     ↳ #99 [action] Implement JWT with cookies [85%]       ↳ #100 [outcome] JWT auth implemented [95%] [commit: c8d3e2f]
Claude
Only showing decisions from feature/auth branch—no noise from other work.

This shows only decisions relevant to the current feature, reducing noise from other work.

The Recovery Loop

Here's the full session lifecycle with deciduous:

Session Lifecycle
SESSION START
    │
    ▼
Run /recover → Query decision graph
    │
    ▼
Claude reports: goals, decisions, status
    │
    ▼
DO WORK → Log as you go (goals, decisions, actions)
    │
    ▼
BEFORE PUSH → deciduous sync
    │
    ▼
SESSION END → Graph survives
    │
    ▼
(New session starts, repeat)

The graph acts as persistent memory that bridges session boundaries.

Mid-Session Recovery

You can also run /recover mid-session if Claude seems to have lost track:

Mid-Session Recovery
❚❚
Animation paused
You
Wait, what were we doing? Run /recover
Claude
Let me check the decision graph...
Claude
deciduous nodes | head -20
Claude
deciduous commands | tail -10
Claude
I see we were working on rate limiting. The last action was "Implementing Redis rate limiter" and we completed it with outcome #52. The commit is abc123.
Claude
Would you like to continue with something else, or is there more to do on rate limiting?

Recovering from Compaction

When context compacts during a long session, the decision graph provides continuity:

What Context Compaction Means

Long Claude sessions may "compact" older messages to make room for new ones. This is normal, but it means Claude loses the detailed reasoning from earlier in the session. The decision graph preserves it.

Even after compaction, Claude can query the graph to recall:

Viewing Node Details

For detailed information about any specific node, use deciduous show:

Node Details
❚❚
Animation paused
Claude
deciduous show 47
Claude
Node #47 goal ──────────────────────────────────────────────────────────── Title: Add rate limiting to API Status: active Created: 2025-01-06T14:23:17 Metadata Confidence: 90% Branch: feature/rate-limiting Prompt User asked: Add rate limiting to the API endpoints Connections Outgoing (1): here ─[leads_to]→ #48: Choose rate limiting strategy
Claude
This shows the original user prompt that triggered the work—critical for understanding intent.
The /recover Checklist
  1. Query nodes: deciduous nodes --branch BRANCH
  2. Check edges: deciduous edges
  3. View git state: git status && git log --oneline -5
  4. Summarize what was found
  5. Ask what the user wants to work on
Ready to generate PR documentation? PR Documentation →