26 pages for autocompact.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
Beta
Claude Developer Platform · in the page
api/beta
…`BetaCompactionBlock object` A compaction block returned when autocompact is triggered. When content is None, it indicates the compaction failed to produce a valid summary (e.g.,…
Messages
Claude Developer Platform · in the page
api/beta/messages
…`BetaCompactionBlock object` A compaction block returned when autocompact is triggered. When content is None, it indicates the compaction failed to produce a valid summary (e.g.,…
Batches
Claude Developer Platform · in the page
api/beta/messages/batches
…CompactionBlock object` A compaction block returned when autocompact is triggered. When content is None, it indicates the compaction failed to produce a valid sum…
Retrieve Message Batch results
Claude Developer Platform · in the page
api/beta/messages/batches/results
…CompactionBlock object` A compaction block returned when autocompact is triggered. When content is None, it indicates the compaction failed to produce a valid sum…
Create a Message
Claude Developer Platform · in the page
api/beta/messages/create
…`BetaCompactionBlock object` A compaction block returned when autocompact is triggered. When content is None, it indicates the compaction failed to produce a valid summary (e.g.,…
Agent SDK reference - Python
Claude Code CLI · in the page
agent-sdk/python
…int rawMaxTokens: int percentage: float model: str isAutoCompactEnabled: bool memoryFiles: list[dict[str, Any]] mcpTools: list[dict[str, Any]] agents: list[dict[str, Any]]…
Subagents in the SDK
Claude Code CLI · in the page
agent-sdk/subagents
…inue. The partial marking requires Claude Code v2.1.246 or later | | `autoCompactWindow` | `number` | No | Lower the [auto-compact window](https://code.claude.com/docs/en/sub-agents.md#subagent-auto-c…
Agent SDK reference - TypeScript
Claude Code CLI · in the page
agent-sdk/typescript
…" | "memory_files" | "skills" | "messages" | "autocompact_buffer" | "compact_buffer" | "free_space"; name: string; tokens: number; color: string; is…
Orchestrate teams of Claude Code sessions
Claude Code CLI · in the page
agent-teams
…//code.claude.com/docs/en/model-config.md#set-the-effort-level). * **`autoCompactWindow`**: for an in-process teammate, Claude Code applies the definition's [`autoCompactWindow`](https://code.claude.c…
Claude Code changelog
Claude Code CLI · in the page
changelog
…imeout` under 1 second now counts as 1 second * Changed a subagent's `autoCompactWindow` to lower the window set by `CLAUDE_CODE_AUTO_COMPACT_WINDOW`, where it had no effect before; it still never rai…
Use Claude Code in the cloud
Claude Code CLI · in the page
claude-code-on-the-web
…n the context window approaches capacity. Cloud sessions set [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](https://code.claude.com/docs/en/env-vars) themselves, so compaction triggers partway through the [auto-…
Explore the .claude directory
Claude Code CLI · in the page
claude-directory
…, `tools`, `disallowedTools`, `model`, `permissionMode`, `maxTurns`, `autoCompactWindow`, `skills`, `mcpServers`, `hooks`, `memory`, `background`, `effort`, `isolation`, `color`, `initialPrompt`, `omi…
CLI reference
Claude Code CLI · in the page
cli-reference
…rompt | `claude --append-system-prompt-file ./extra-rules.txt` | | `--autocompact <auto\|tokens>` | Set the [auto-compact window](https://code.claude.com/docs/en/model-config.md#set-the-auto-compact-w…
Configure cloud environments
Claude Code CLI · in the page
cloud-environments
…session also sets some variables itself when it starts. For [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](https://code.claude.com/docs/en/claude-code-on-the-web#manage-context), the value the session sets over…
Commands
Claude Code CLI · in the page
commands
…| | `/autocompact [auto\|<tokens>]` | Set the auto-compact…
Explore the context window
Claude Code CLI · in the page
context-window
…ion keeps and how to guide the summary. * **Compact earlier**: run [`/autocompact`](/docs/en/commands#all-commands) with a token count, like `/autocompact 500k`, to set how full the context window get…
Environment variables
Claude Code CLI · in the page
env-vars
…| | `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` | Set the percentage (1-100) of the auto-compact window at which auto-compaction t…
Error reference
Claude Code CLI · in the page
errors
…[auto-compact](https://code.claude.com/docs/en/settings-reference.md#autocompactenabled) off, turn it back on so Claude Code compacts on its own next time. * Send another message to have Claude try a…
Deploy managed settings
Claude Code CLI · in the page
managed-settings
…the choice. * **The auto-compact window for a session**: a managed [`autoCompactWindow`](https://code.claude.com/docs/en/settings-reference#autocompactwindow) is a default too. The `--autocompact` fl…
Model configuration
Claude Code CLI · in the page
model-config
…: * **For the current model, in this session and later ones**: run `/autocompact` with a value, like `/autocompact 500k`. Claude Code saves it to your user settings under the current model in [`model…
Add components to a plugin
Claude Code CLI · in the page
plugins/components
…rted fields**: `name`, `description`, `model`, `effort`, `maxTurns`, `autoCompactWindow`, `tools`, `disallowedTools`, `skills`, `memory`, `background`, `omitClaudeMd`, `isolation`, `color`, and the `c…
Continue local sessions from any device with Remote Control
Claude Code CLI · in the page
remote-control
…eractive CLI, so the command tells you to run it there instead. * `/autocompact`, from v2.1.221: pass the window size as an argument, for example `/autocompact 500k`. With no argument, it prints the…
Claude Code settings
Claude Code CLI · in the page
settings
…| | `autoCompactEnabled` | **Default**: `true`. Automatically compact the conversation when context approaches the limit.…
All settings
Claude Code CLI · in the page
settings-reference
…/en/remote-control.md) commits | Git and attribution | Any file | | [`autoCompactEnabled`](#autocompactenabled) | Turn [automatic compaction](https://code.claude.com/docs/en/context-window.md) off or…
Create custom subagents
Claude Code CLI · in the page
sub-agents
…ools`, `model`, `permissionMode`, `mcpServers`, `hooks`, `maxTurns`, `autoCompactWindow`, `skills`, `initialPrompt`, `memory`, `effort`, `background`, `omitClaudeMd`, and `isolation`. * **Ignored fiel…
Troubleshooting
Claude Code CLI · in the page
troubleshooting
…dered. ### Auto-compaction stops with a thrashing error If you see `Autocompact is thrashing: the context refilled to the limit...`, automatic compaction succeeded but a file or tool output immediat…