Run Claude Code programmatically changedheadless
Nearest release: v2.1.332, published 3 hours after upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 24 Nov 2026 18:21 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 24 Nov 2026 18:37 UTC.
Upstream edited
Recorded here
Lines+1added
Lines−1removed
From line
204
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits55to this page, all time
The whole hunk
from line 204, old and new numbered
/
from line 204
204204claude -p "Explain recursion" --output-format stream-json --verbose --include-partial-messages
205205```
206206
207The last line of the stream is a `result` message with the final response text, cost, and session metadata.
207Find each [`result` message](https://code.claude.com/docs/en/agent-sdk/typescript#sdkresultmessage) by `type`, because a message such as a task notification can follow a result and start another turn. A successful `result` message holds any final response text, the running cost total, and session metadata.
208208
209209If your consumer reads the stream slowly, Claude Code waits for the queued output to drain before exiting, scaling the wait with how much is still queued, capped at 30 seconds.
210210
No line in this hunk matches that.