# DISABLE_COMPACT

> Set to 1, it turns off all compaction, /compact too.

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

## Think of it like

It is like you lock the tidy box. No one can squeeze the desk, not even you.

## Definition

DISABLE_COMPACT set to 1 turns off all compaction. The auto squeeze stops. The /compact command stops too. A long chat then runs until it hits the model's limit. It is stricter than DISABLE_AUTO_COMPACT.

## Example

Jack tests how a model reads a whole chat, and a summary would spoil the test. He sets this, so the chat is never squeezed.

## Example code

```bash
export DISABLE_COMPACT=1
claude -p "Review this file"
```

Keep a short job from ever being summed up.

## Why it matters

Some tests and audits need the full chat kept word for word.

## Common mistake

Using it for normal work. A long session then stops at the limit with no way to free room.

## Three principles

- **All compaction off.** Auto and by hand.
- **Stricter.** Than the auto one.
- **Runs to the limit.** Then stops.

## Related terms

- [DISABLE_AUTO_COMPACT](https://learn.benibix.com/term/ai/disable-auto-compact-variable)
- [Auto-Compact](https://learn.benibix.com/term/ai/auto-compact)
- [Context Window](https://learn.benibix.com/term/ai/context-window)

## 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-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.
