{"version":"2.1.304","anchor":"claude-code-auto-compact-window-parsing-with-km-shorthand-a","canonical_anchor":"claude-code-auto-compact-window-parsing-with-km-shorthand-a","heading":"CLAUDE_CODE_AUTO_COMPACT_WINDOW gets shorthand values, warnings and a note in \/config","tier":"use","area":"Compaction","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.304\/e\/claude-code-auto-compact-window-parsing-with-km-shorthand-a","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.304","markdown":"### CLAUDE_CODE_AUTO_COMPACT_WINDOW gets shorthand values, warnings and a note in \/config\n\nThe auto-compact window env var accepts 200k or 1M shorthand, clamps or warns on bad values, and \/config shows an extra note about it\n\n**What**\n\nAuto-compact is when Claude Code summarises the conversation so far to free up room in the model's memory. The auto-compact window sets how full that memory can get, in tokens, before this happens. `CLAUDE_CODE_AUTO_COMPACT_WINDOW` is an environment variable, a value set in your shell, that sets this window. This release changes how it is read and shown:\n\n- The value is read by a new parser. It accepts shorthand such as `200k` or `1M`, and a bare number between 100 and 1000 is treated as thousands.\n\n- Values that are too small or too large are brought up to the minimum or down to the maximum, with a warning in the log or in headless output.\n\n- A value that cannot be read at all is ignored, with the message that it \"isn't a usable size, so Claude Code ignores it.\" Before, an invalid value was dropped without a visible warning.\n\n- At startup in interactive mode, the variable is checked and a warning is raised if needed.\n\n- The auto-compact window entry in `\/config` now shows an extra warning-coloured line built from the environment variable. Its exact wording was not read. Before, the only extra line was \"Auto-compact is currently disabled (see \/config)\".\n\n**Why**\n\nA mistyped window size now produces a warning instead of quietly having no effect, and the settings screen points out when the environment variable is in play.\n\n- Area: Compaction\n- Names: `CLAUDE_CODE_AUTO_COMPACT_WINDOW`\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: yes"}