What
Compaction is when Claude Code shortens the conversation so it fits in the model's working memory (the context window). The autoCompactWindow setting controls how full that memory gets before this happens.
- A per-model value is looked up at
modelSettings.autoCompactWindow, so different models can have different windows. - Claude Code now records the window actually in force and where it came from, once each time it changes. Possible sources are
env,server,experiment,default,agent_definition,session_override,settings_per_modelandsettings_top_level. The code that works out the window was split up to allow this. - Records of successful compaction gain
autoCompactWindow,autoCompactWindowOriginandarmTriggerfields. - A new helper can prepare a compaction in advance while Claude Code is idle (
armTrigger"idle"). - The list of settings Claude Code reports as set now includes
modelSettings.autoCompactWindowwhen any entry undermodelSettingsdefinesautoCompactWindow, alongsidepermissions.defaultModeandworktree.baseRef.
Why
Several places can set the auto-compact window, from environment variables to settings files to agent definitions. Recording which one won makes it possible to tell why compaction happens when it does, and confirms a per-model setting is recognised.
Names in the bundlemodelSettings.autoCompactWindow