All areas Feed Weekly digests

compaction

The tracked changes tagged compaction, newest release first. Every sentence is an item's summary.

75 items from 30 releases, 3 breaking Sources: Claude Code, Codex, OpenAI Python SDK Last change:

Goes with

Changes

Claude Code v2.1.332

  1. breaking Breaking

    Desktop Code tab on Anthropic's API now ignores CLAUDE_CODE_AUTO_COMPACT_WINDOW under 200K in user settings when a gateway address is set; use /autocompact instead.

  2. feature

    Added a warning in VS Code and the desktop Code tab when part of a session could not be saved, explaining how to save it with /compact.

  3. fix

    Turns no longer end in Prompt is too long after repeated auto-compaction failures when one more compaction at the context limit could have continued them.

  4. fix

    Compaction no longer fails when a summary runs past the output limit; after three cut-off replies the last try asks for a shorter summary.

  5. fix

    Fixed a freeze and context overflow when a hook blocks or fails during a turn or after /compact with a very large log; text over about 50,000 characters is now shortened.

+4 more
  1. fix

    Fixed idle compaction being skipped for subscribers well under their weekly limit.

  2. fix

    Remote Control: fixed sessions hosted by the desktop app or VS Code showing as idle while /compact runs.

  3. other

    Improved recovery for long conversations behind a proxy or gateway with a request size limit where every message and /compact failed with a 413.

  4. fix

    VS Code: fixed the compaction summary showing as the user's prompt in chat, Rewind and prompt history after reload, resume or fork.

Claude Code v2.1.331

  1. fix

    Fixed /compact and auto-compact sometimes losing part of the summary when it quoted certain XML tags.

  2. fix

    [VSCode] Fixed a quick double click pressing a button that appeared after the first click, or starting a second compaction from the context usage circle.

Claude Code v2.1.330

  1. fix

    Fixed Claude Code freezing for up to several minutes right after compacting a very long conversation.

Claude Code v2.1.329

  1. fix

    Fixed sessions from a pre-warmed process ignoring autoCompactWindow in the project's .claude/settings.json.

  2. fix

    Fixed CLAUDE_AUTOCOMPACT_PCT_OVERRIDE staying active in a running session after removal from settings.json.

Claude Code v2.1.328

  1. fix

    Automatic compaction rebuilds the system prompt as /compact does instead of reusing the session's earlier one.

  2. fix

    Agent hooks no longer run past their timeout while compacting after a request was refused as too large.

Claude Code v2.1.327

  1. fix

    Fixed a compaction right after a reply cut at the output token limit losing that reply's tool call and result.

  2. fix

    Fixed Edit refusing with "File has not been read yet" after compaction on unchanged files outside the project that were already read in full.

  3. fix

    Fixed in-process agent teammates on a different model from the lead compacting at the lead's context limit and on the wrong model.

Claude Code v2.1.326

  1. breaking Breaking

    Automatic compaction in plan mode uses the answering model, such as Opus with opusplan, which can cost more.

  2. fix

    Compaction on Bedrock, Vertex, Foundry, and with telemetry off no longer sometimes replies to a message instead of summarizing, or drops Claude's last reply from the summary.

  3. fix

    Image-heavy sessions on Vertex AI now compact and retry instead of getting stuck on a 400 error about a 30 MB request limit.

  4. performance

    The first message after /compact is faster in git repositories.

Codex 0.167.0

  1. fix

    Automatic context compaction accounts for retained output from failed responses and responses with missing token usage data.

Claude Code v2.1.318

  1. fix

    Fixes idle compaction replacing a conversation with a reply that was not a summary.

Claude Code v2.1.317

  1. fix

    Fixes the Claude apps gateway hiding Amazon Bedrock's Input is too long error, which left sessions failing every turn instead of compacting.

  2. fix

    Fixes Prompt is too long errors after automatic compaction in sessions whose very large CLAUDE.md changed since it was last sent.

    compactionclaude-md
  3. fix

    Fixes very long conversations losing their earlier summary when compaction had to shorten its own request.

Claude Code v2.1.314

  1. feature

    Added idle compaction to VS Code and the Claude Desktop Code tab: a conversation of 200K+ tokens left idle is summarized, and the summary is used on the next message if the prompt cache has expired.

  2. fix

    Fixed Bedrock sessions with many images failing every turn and /compact failing with "400 Input is too long"; older images are now removed before compacting.

  3. fix

    Fixed a PreCompact hook with very large output making compaction fail or repeat; each hook's output is now cut at 10,000 characters.

  4. fix

    Fixed Remote Control clients showing a stray Compacted row after /compact.

  5. other

    Changed idle compaction to run for subscribers with telemetry off, and on Bedrock, Vertex, Foundry and LLM gateways once the one-hour prompt cache is on.

Codex 0.166.0

  1. fix

    Preserved reasoning-token accounting across resume and fork to avoid premature compaction.

  2. fix

    Preserved reasoning token accounting across resume and fork to avoid premature compaction.

Claude Code v2.1.312

  1. other

    A subagent's autoCompactWindow now lowers the window set by CLAUDE_CODE_AUTO_COMPACT_WINDOW, where it previously had no effect; it still never raises that window.

Claude Code v2.1.311

  1. breaking Breaking

    Changed DISABLE_COMPACT in settings files and in a mod's $.env.set so it can only turn compaction off, not back on.

  2. fix

    Fixed standard-context sessions stopping with a usage credits error when a request ran over 200K tokens; Claude Code now compacts the conversation and continues.

  3. fix

    Fixed Claude seeing stale MEMORY.md and CLAUDE.md content right after automatic compaction when those files were edited earlier in the session.

  4. fix

    Fixed agent teammates compacting their history when DISABLE_COMPACT is set.

  5. fix

    Fixed the rewind menu offering Summarize from here and Summarize up to here when DISABLE_COMPACT is set.

+2 more
  1. other

    Improved /teleport and claude --teleport to warn when a compacted cloud session loads from its last compaction, so messages it summarized are missing from the local copy.

  2. other

    Improved compaction so that when the model's reply has no summary, Claude Code usually asks for the summary once more before replacing the conversation.

Claude Code v2.1.310

  1. fix

    Compaction after a "Prompt is too long" error no longer keeps too much of a conversation with dense text such as base64 or SVG, which could cause the next request to fail again.

  2. performance

    Non-interactive sessions (-p, Agent SDK) use less memory during compaction when the transcript file is very large.

Codex 0.164.0

  1. fix

    Failed compaction no longer leaves partial summaries in conversation history, and background compaction failures fall back without panicking.

OpenAI Python SDK v3.36.0

  1. feature

    Adds compaction trigger IDs.

Claude Code v2.1.306

  1. fix

    Fixed an API error being replaced by "prompt is too long" and an unneeded compaction in sessions with many MCP tools.

Claude Code v2.1.305

  1. fix

    Fixed cloud sessions and teammates not being told when a compaction had to leave the oldest messages out of its summary.

Claude Code v2.1.304

  1. feature

    Added the names of tools called earlier to the compaction summary in the transcript view (Ctrl+O).

  2. fix

    Fixed a "Context limit reached" or "Prompt is too long" error after stopping a turn while Claude Code was compacting a conversation the API had rejected as too long.

  3. fix

    Fixed CLAUDE_CODE_AUTO_COMPACT_WINDOW=200k silently setting a 100K window; the variable now accepts k and M suffixes like --autocompact and warns when a value is out of range or ignored.

  4. other

    Changed compaction to send Claude the skill list again afterwards; /reload-skills now sends only new or changed skills.

Claude Code v2.1.300

  1. fix

    /autocompact no longer warns about high token usage when a smaller auto-compact window is chosen.

  2. fix

    Resuming a headless or Agent SDK session no longer loses recent messages kept by a compaction that followed a reply cut at the output token limit (compactions from this version on).

  3. fix

    Claude is now told about an MCP server's tools and instructions when the server finishes connecting after a compaction, not only at its next tool call.

  4. fix

    Resuming a headless or Agent SDK session no longer loses its compaction summary or brings back pre-compaction history when the compaction followed a retried or unfinished reply in the same turn.

Claude Code v2.1.299

  1. feature

    Added idle compaction in the terminal: conversations of 200K+ tokens idle about 54 minutes are compacted before the one-hour prompt cache expires.

  2. feature

    Added CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS to change the 200K-token minimum for idle compaction, and "idleCompaction": false in settings.json to turn it off; both need v2.1.290 or later.

  3. fix

    Fixed cloud sessions sometimes leaving a message unanswered when the worker was replaced right after a compaction.

Claude Code v2.1.292

  1. fix

    Fixed a compaction summary that repeated /name letting Claude invoke a skill reserved for the user.

Claude Code v2.1.290

  1. fix

    Fixed compaction sometimes failing with a "null is not an object" error.

  2. fix

    Fixed automatic compaction failing with Prompt is too long after Mac sleep.

Claude Code v2.1.288

  1. fix

    Fixed long conversations failing with "Prompt is too long" instead of auto-compacting when the last reply reported zero token usage.

  2. fix

    Fixed --resume sometimes dropping files and context that a compaction had just restored.

  3. fix

    Fixed the first request in a fresh environment or after a model switch using built-in output and auto-compact limits instead of the server's; that request may now wait up to 1.5 seconds.

  4. other

    Auto mode now compacts a conversation too long for the client-side safety classifier instead of prompting for or failing every tool call.

  5. other

    /autocompact now saves the auto-compact window per model.

Claude Code v2.1.287

  1. fix

    Fixed the commit attribution reminder being delivered inside a tool result after compaction.

  2. fix

    Fixed cloud sessions sometimes losing earlier conversation when restarted during compaction.

Claude Code v2.1.285

  1. fix

    Fixed compacting or resuming a session failing, losing history, or crashing when the transcript holds a malformed compaction marker or loop wakeup entry.

Claude Code v2.1.284

  1. fix

    Fixed persistent "Prompt is too long" errors after compacting by compacting once more with less recent conversation.

  2. fix

    Fixed VS Code "Prompt is too long" errors after compaction when a large text file is attached.

Claude Code v2.1.283

  1. other

    The compaction spinner timer now starts when compaction begins and counts streamed summary tokens, replacing the percentage bar.

Claude Code v2.1.282

  1. fix

    Fixed compaction failing when the summarization request is refused; it now retries on a fallback model.