Session resume drops parallel tool calls from both rendering and context
Description
When resuming a session originally created with claude -p (print mode), parallel tool calls are dropped from both the TUI rendering AND the context window. The resumed agent cannot recall these tool calls and believes they never happened.
The session .jsonl file contains all tool calls correctly — the data is persisted but not loaded on resume.
Steps to Reproduce
- Create a session using
-pmode where the agent makes parallel tool calls:
``bash``
echo "<prompt>" | claude -p \
--session-id "$(uuidgen)" \
--output-format json \
--dangerously-skip-permissions
- Resume the session interactively:
``bash``
claude --resume <session-id>
- Observe: parallel tool calls are missing from the TUI history.
- Ask the agent "summarize all tool calls you made" — it will not remember the dropped calls, confirming they are absent from the context, not just the rendering.
Expected Behavior
All tool calls (including parallel ones) should be loaded into context and rendered in TUI when resuming.
Actual Behavior
Parallel tool calls are silently dropped from both rendering and context. The agent on resume has an incomplete view of its own history.
Concrete example from session 2301608e-...:
The .jsonl file contains these tool calls (verified by parsing the file directly):
| .jsonl line | Tool | Parallel group | stop_reason | Loaded on resume? |
|-------------|------|---------------|-------------|-------------------|
| L5 | Read | 1/2 | null | No |
| L6 | mcp__search__get_session_dir | 2/2 | tool_use | Yes |
| L17 | Bash (sips) | 1/2 | null | No |
| L18 | mcp__search__crop_image | 2/2 | tool_use | Yes |
| L23 | Bash (sips) | 1/3 | null | No |
| L24 | mcp__search__xy_image_search | 2/3 | null | No |
| L25 | mcp__search__tb_image_search | 3/3 | tool_use | No |
| L31 | Read (image) | 1/2 | null | No |
| L32 | Read (grid) | 2/2 | tool_use | Yes |
| L38 | Read (solo) | solo | tool_use | Yes |
Pattern: Messages with stop_reason: null (streaming chunks for parallel calls) are consistently dropped. Some final chunks (stop_reason: tool_use) in larger parallel groups are also dropped.
Verification
- Parsing the
.jsonlfile directly confirms ALL tool calls are persisted correctly claude -p --resume <id>(non-interactive) can access the full history- Only the interactive TUI resume is affected
- Interactive sessions (not
-pmode) resume correctly with all tool calls visible
Impact
This makes -p mode sessions unreliable for resume/continuation workflows. Any session that uses parallel tool calls (which is common — e.g., launching multiple searches simultaneously) will have an incomplete context on resume.
Hypothesis
In -p mode, each content block in a parallel tool call is stored as a separate .jsonl entry. Intermediate entries have stop_reason: null while the final entry has stop_reason: tool_use. The TUI session loader appears to filter out entries with stop_reason: null, treating them as incomplete streaming artifacts rather than valid parallel tool call chunks.
Interactive sessions may avoid this because they include progress entries between tool calls that help the loader reconstruct parallel call groups.
Environment
- Claude Code version: 2.1.78
- Platform: macOS (Darwin 22.3.0)
- Flags used:
claude -p --output-format json --dangerously-skip-permissions --session-id <uuid>
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗