Sweep 19 Sep 2026 · 02:36Z Build v2.1.278 500 read Stable v2.1.267 Latest v2.1.278 Next v2.1.278 Feeds RSS JSON llms.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

TierNothing to try yethow much it should matter to you
Useful3my rating, 1 to 5
Signal3worth watching, 1 to 5
AreaSDKwhat it touches
KindIn Developmentin v2.1.267,
Nothing to try yet

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

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 →