# DISABLE_AUTO_COMPACT

> Set to 1, it stops the automatic squeeze. /compact still works.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** DISABLE_AUTO_COMPACT=1

## Think of it like

It is like you stop a helper from tidying your desk on their own. You can still ask.

## Definition

DISABLE_AUTO_COMPACT set to 1 stops the automatic squeeze of a long chat. Claude Code no longer sums up the chat as it nears the limit, or when it sits idle. You can still run /compact by hand. It wins over the autoCompactEnabled setting.

## Example

Lucy hates losing detail in the middle of a task. She sets this, and runs /compact herself at a good stopping point.

## Example code

```bash
export DISABLE_AUTO_COMPACT=1
claude
```

Squeeze the chat only when you ask.

## Why it matters

You pick when the chat is summed up, so it never happens halfway through a hard step.

## Common mistake

Forgetting to compact by hand. A full chat then stops with an error at the limit.

## Three principles

- **No auto squeeze.** Near the limit or idle.
- **/compact still works.** By hand.
- **Wins over the setting.** autoCompactEnabled.

## Related terms

- [Auto-Compact](https://learn.benibix.com/term/ai/auto-compact)
- [DISABLE_COMPACT](https://learn.benibix.com/term/ai/disable-compact-variable)
- [CLAUDE_CODE_AUTO_COMPACT_WINDOW](https://learn.benibix.com/term/ai/claude-code-auto-compact-window-variable)

## Told apart from

- [DISABLE_AUTO_COMPACT vs DISABLE_COMPACT](https://learn.benibix.com/compare/disable-auto-compact-variable-vs-disable-compact-variable): People think DISABLE_AUTO_COMPACT and DISABLE_COMPACT are the same switch. The first stops only the automatic squeeze, so /compact still works when you run it. The second stops all of it, /compact included. Use the first to choose when the chat is summed up. Use the second only when the chat must never be summed up at all.

![DISABLE_AUTO_COMPACT stops the automatic squeeze only. DISABLE_COMPACT stops /compact too.](https://learn.benibix.com/diagrams/env-compact-switches.svg)

---

Source: https://learn.benibix.com/term/ai/disable-auto-compact-variable
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
