CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP
Updated by Alex Sorokoletov
CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP is a Claude Code environment variable: Disable skipping pre-compaction checks. Present since v2.1.69 or earlier and still present in v2.1.294. It is not in the official reference.
| Status | Present in v2.1.294 |
|---|---|
| Added | Present since v2.1.69 or earlier |
| Category | Context and compaction |
| Official docs | Not listed |
How to set it
For one session, export it in the shell that starts Claude Code:
export CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP=<value>
claudeTo apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP": "<value>"
}
}Release notes that mention it
- Claude Code v2.1.75 — 2 New Environment Variables: Auto-Compact Window & Plugin Options
- 165 Environment Variables in Claude Code 2.1.69 — What Changed in 50 Versions
Related variables
CLAUDE_CODE_SKIP_PRECOMPACT_LOAD: Optimize large session file loading.CLAUDE_CODE_DISABLE_1M_CONTEXT: Disable extended 1M token context window.DISABLE_AUTO_COMPACT: Disable automatic compaction only (manual /compact still works).DISABLE_CLAUDE_CODE_SM_COMPACT: Disable session memory compaction.DISABLE_COMPACT: Disable all compaction (manual + auto).DISABLE_MICROCOMPACT: Micro-compaction (small context cleanups).CLAUDE_AFTER_LAST_COMPACT: Request only conversation logs after last compaction.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE: Set when auto-compaction triggers (percentage threshold).
Frequently asked questions
What does CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP do?
Disable skipping pre-compaction checks
Which Claude Code version has CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP?
Present since v2.1.69 or earlier and still present in v2.1.294.
How do I set CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP?
Export it before starting Claude Code (export CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP=value), or add it to the "env" object in ~/.claude/settings.json to apply it to every session.
All variables, searchable: Claude Code environment variables.