{"version":"2.1.296","anchor":"plugin-agent-frontmatter-gains-autocompactwindow-passed-thr","canonical_anchor":"plugin-agent-frontmatter-gains-autocompactwindow-passed-thr","heading":"Agents can now set their own autoCompactWindow","tier":"use","area":"Plugins","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.296\/e\/plugin-agent-frontmatter-gains-autocompactwindow-passed-thr","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.296","markdown":"### Agents can now set their own autoCompactWindow\n\nAgent and plugin agent definitions accept autoCompactWindow, so a subagent can compact its own conversation at its own token threshold\n\n**What**\n\nThe auto-compact window (`autoCompactWindow`) is how full the context gets, in tokens, before Claude Code compacts, meaning it summarises the conversation to make room. It could already be set per model. Agent definitions, including plugin agent files, can now set it in their frontmatter (the settings block at the top of the agent file) for that one agent:\n\n- The value is a token count, accepted as a number or numeric string and validated as an integer between two bounds. An invalid value gives the error \"has invalid autoCompactWindow\".\n\n- It is the token count at which the agent compacts its own conversation when it runs as a subagent (a helper agent started by the main one). One finding notes it can only lower the window the agent would inherit and has no effect on the main session agent.\n\n- The value is kept on the agent definition, copied through alongside `maxTurns`, `hooks` and `mcpServers`, and forwarded into the subagent's options when it is spawned.\n\n- The in-process teammate runner's auto-compact check now also takes the per-agent value into account alongside the inherited one.\n\nThe per-model setting, described as 100000 to 1000000 tokens or `auto`, is still where `\/autocompact` saves its value.\n\n**Why**\n\nAn agent that reads a lot can compact earlier than the main session, keeping its own work within a size you choose. Teammate agents may now compact at a different point than before.\n\n- Area: Plugins\n- Names: `autoCompactWindow`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}