Run Claude Code programmatically changedheadless
Nearest release: v2.1.335, published an hour 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 2 Dec 2026 20:50 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 2 Dec 2026 21:07 UTC.
Upstream edited
Recorded here
Lines+4added
Lines−0removed
From line
417
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits61to this page, all time
### Change when a session compacts
The whole hunk
from line 417, old and new numbered
/
from line 417
417417
418418In place of the session ID, you can pass `--resume` the absolute path to a session's `.jsonl` [transcript file](https://code.claude.com/docs/en/sessions.md#where-transcripts-are-stored), and Claude Code continues the conversation stored in that file.
419419
420### Change when a session compacts
421
422If you haven't set an auto-compact window, `claude -p` and Agent SDK sessions use `auto`, a size that Anthropic tunes per model. For the size on current models, see [Compaction near 400K on a 1M model](https://code.claude.com/docs/en/model-config.md#compaction-near-400k-on-a-1m-model). To opt out of `auto`, [set the auto-compact window](https://code.claude.com/docs/en/model-config.md#set-the-auto-compact-window) in your settings.
423
420424## Next steps
421425
422426* [Agent SDK quickstart](https://code.claude.com/docs/en/agent-sdk/quickstart.md): build your first agent with Python or TypeScript
No line in this hunk matches that.