[Bug] Resumable agents fork from checkpoint instead of accumulating context
Bug Description
Bug Report: Resumable Agents Don't Accumulate Context
Summary
Resumable agents (introduced in v2.0.28) do not accumulate context across resume operations. Each resume loads only
the original conversation from the agent JSONL checkpoint, not any previous resume interactions. This makes agents
"forkable" rather than truly "resumable."
Expected Behavior
When resuming an agent multiple times, it should maintain a continuous conversation thread:
Agent Created (Message #1)
↓
Resume #1 (Message #2) - sees: #1, #2
↓
Resume #2 (Message #3) - sees: #1, #2, #3 ✓ Expected
↓
Resume #3 (Message #4) - sees: #1, #2, #3, #4 ✓ Expected
Actual Behavior
Each resume creates an independent branch from the original checkpoint:
Agent Created (Message #1) ← saved to JSONL
↓
├─→ Resume #1 (Message #2) - sees: #1, #2
├─→ Resume #2 (Message #3) - sees: #1, #3 ✗ Missing #2
└─→ Resume #3 (Message #4) - sees: #1, #4 ✗ Missing #2, #3
Reproduction Steps
Test 1: Simple Multi-Resume
# 1. Create an agent with initial message
Task(subagent_type="general-purpose", model="haiku", prompt="MESSAGE #1: Remember ALPHA-100")
# Agent ID: 03f6525d (example)
# 2. First resume
Task(resume="03f6525d", prompt="MESSAGE #2: Remember BETA-200. Quote all messages you see.")
# Output: Sees MESSAGE #1 (ALPHA-100) and MESSAGE #2 (BETA-200) ✓
# 3. Second resume
Task(resume="03f6525d", prompt="MESSAGE #3: Remember GAMMA-300. Quote all messages you see.")
# Output: Sees MESSAGE #1 (ALPHA-100) and MESSAGE #3 (GAMMA-300)
# Missing: MESSAGE #2 (BETA-200) ✗
Test 2: File System Evidence
# Create agent
ls -lt ~/.claude/projects/*/agent-*.jsonl | head -1
# Output: agent-03f6525d.jsonl created at 13:51:23
# Resume agent twice
# ... perform resumes ...
# Check file modification time
stat ~/.claude/projects/*/agent-03f6525d.jsonl | grep Modify
# Output: Modify: 2025-11-02 13:51:23 (unchanged!)
# Check line count
wc -l ~/.claude/projects/*/agent-03f6525d.jsonl
# Output: 8 lines (unchanged after resumes!)
Evidence
Agent's Own Observation
When asked to quote visible messages on Resume #2, the agent responded:
"Based on my conversation history, here are the user messages I can see: MESSAGE #1: "This is the first message. Remember this number: ALPHA-100." MESSAGE #3: "This is the third message. Remember this number: GAMMA-300." What I cannot see: - MESSAGE #2 and any BETA number (there is a gap in the visible conversation history) I do not have access to MESSAGE #2, so I cannot see the BETA number, even though the sequence suggests one existed."
The agent itself detected the gap in conversation history!
File System Evidence
- Agent JSONL files never updated after initial creation
- Modification timestamps frozen at creation time
- Line counts unchanged despite multiple resume operations
view-cc-transcript agent-<id>shows only original conversation
Impact
This bug breaks several expected use cases:
- Multi-turn agent conversations: Cannot have ongoing dialogue with resumed agents
- Iterative refinement: Cannot build on previous agent responses across resumes
- Agent collaboration: Cannot chain agent conversations meaningfully
- Context accumulation: Agents lose all intermediate conversation history
Additional Notes
The release notes for v2.0.28 described this as:
"Subagents: claude can now choose to resume subagents"
This implies agents should maintain continuity across resumes, not fork from a checkpoint.
Test Agents Used
agent-03f6525d- ALPHA/BETA/GAMMA testagent-977bef0e- Simple "Hi!" testagent-fad96168- Penguin fact / number 42 test
All exhibited the same forking behavior.
Suggested Fix
Agent JSONL files should be appended with new messages when resumed, similar to how the main session JSONL file grows
during conversation. Each resume should load the complete agent conversation history, not just the original
checkpoint. Or fork with a new session id for each resume if you can't get your session resume code work properly.
Environment
- Claude Code Version: 2.0.31
- OS: Linux (Ubuntu/Debian) -
Linux 6.11.0-28-generic - Terminal: Kitty
- Model Tested: Haiku 4.5 (
claude-haiku-4-5-20251001) - Session ID:
8cb86e85-6130-4db5-a754-8188e91f8423
Environment Info
- Platform: linux
- Terminal: ghostty
- Version: 2.0.31
- Feedback ID: 482e664c-b72c-4dc8-b43e-69f7848ec0aa
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗