Follow Discord
Sweep 06 Nov 2026 · 01:32Z Build v2.1.319 537 read Stable v2.1.311 Latest v2.1.318 Next v2.1.319 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.267 ·

SDK/headless sessions get an explicit rejection for compact()

Calling compact() in headless SDK sessions now returns a clear rejection instead of silently doing nothing

Nothing to try yet In Development
JSON All of v2.1.267
Nothing to try yetTier: how much it should matter to you
3Useful: my rating, 1 to 5
3Signal: worth watching, 1 to 5
SDKArea: what it touches
In DevelopmentKind: in v2.1.267,
In DevelopmentSection of the release
What

Headless sessions, meaning ones run with -p or through the SDK without the interactive terminal interface, now expose a compact() method, but calling it currently always fails with an explanatory error. That's because compaction in headless mode currently only happens inside a turn, triggered by a /compact prompt, not through a separate method call.

Why

This gives headless and SDK users a clear, catchable error explaining that compact() isn't available yet in that mode, instead of it failing silently or behaving unpredictably, so they know to work around it for now.

How sure we are
One source agreesOne thing we can check says the same as this entry.
Anthropic's release notes agreeFixed resuming a session after /compact or another slash command ran via -p --resume: a spurious "Continue from where you left off." turn is…

See this entry in the whole of v2.1.267 →

Feedback