Claude Code✓ Confirmed in official docsAdded Oct 12
How to make a Claude Code subagent compact earlier with autoCompactWindow
Since Claude Code v2.1.296 you can put autoCompactWindow in a subagent definition, so the subagent auto-compacts on a smaller window than the main conversation.
Add it to the frontmatter of the subagent file under .claude/agents/.
---
name: explorer
description: Skims the codebase to find relevant files
autoCompactWindow: 200000
---
The same key works in definitions passed with --agents.
For the main conversation, the autoCompactWindow setting and the CLAUDE_CODE_AUTO_COMPACT_WINDOW environment variable take a plain token count from 100000 to 1000000. Writing 500k reads as 500 and clamps to the minimum. The changelog doesn't give a range for the subagent key.
Sources
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.