What this thread does
Do first: capture .session_id from claude -p "Start a review" --output-format json with the page's jq pipeline.
When you need it
Use a session ID when multiple programmatic conversations exist and you need to continue a specific one. The page distinguishes this from --continue, which selects the most recent conversation.
Steps
1. Start the review and retain the ID returned in JSON:
session_id=$(claude -p "Start a review" --output-format json | jq -r '.session_id')
2. Send the follow-up to that ID:
claude -p "Continue that review" --resume "$session_id"
Check it worked
The page describes the second request as continuing the specific conversation selected by its session ID. It gives no separate confirmation command or success marker.
Limits
- The two commands may run from different directories; Claude Code can locate a session ID in any project on the same machine. The section does not promise cross-machine lookup by ID.
- On v2.1.257 or later,
--continuemay open a finished background session, but does not open one still running. That rule concerns--continue; it is not a version gate given for--resume. - An absolute path to a session's
.jsonltranscript is also accepted by--resume. - As of November 2026, the changelog's top entry is 2.1.331 (November 23, 2026).
Not for: renaming sessions for the interactive picker; see claude-code-rename-sessions-resume-list.
Sources
- Run Claude Code programmatically, Anthropic documentation, read 2026-11-24: "Use
--continueto continue the most recent conversation, or--resumewith a session ID" - Claude Code changelog, 2.1.331, Anthropic documentation, read 2026-11-24: "November 23, 2026"
Checked
2026-11-24; read Run Claude Code programmatically, Claude Code changelog, 2.1.331; no command was run.
Started from a post by @Anthropic, packaged by the editor. Original post