[BUG] claude code ignores CLAUDE_CODE_DISABLE_1M_CONTEXT settings

Resolved 💬 2 comments Opened Jun 2, 2026 by russell Closed Jul 5, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

claude version 2.1.158

<img width="640" height="317" alt="Image" src="https://github.com/user-attachments/assets/39eb013a-77d8-4b52-84d3-4e2f1787eb01" />

My config is roughly

{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "env": {
    "CLAUDE_CODE_ENABLE_TELEMETRY": "0",
    "CLAUDE_CODE_DISABLE_1M_CONTEXT": "1",
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  },
  "model": "sonnet",
  "alwaysThinkingEnabled": true,
  "teammateMode": "tmux"
}

What Should Happen?

Claude should compact and not waste all my quota

Error Messages/Logs

Steps to Reproduce

ask claude to monitor a process for hours, i didn't do this but i have pages of logs so it obviously decided to do this at some point

● Bash(date; ps -p 1869486 -o pid,stat,time,etime --no-headers 2>/dev/null && echo "running" || echo "DONE")
  ⎿  Tue 02 Jun 2026 03:00:01 CEST
     1869486 Sl   02:12:44    01:06:31
     running

● Bash(date; ps -p 1869486 -o pid,stat,time,etime --no-headers 2>/dev/null && echo "running" || echo "DONE")
  ⎿  Tue 02 Jun 2026 03:00:05 CEST
     1869486 Sl   02:12:51    01:06:34
     running

● Bash(date; ps -p 1869486 -o pid,stat,time,etime --no-headers 2>/dev/null && echo "running" || echo "DONE")
  ⎿  Tue 02 Jun 2026 03:00:08 CEST
     1869486 Sl   02:12:58    01:06:38
     running

● Bash(date; ps -p 1869486 -o pid,stat,time,etime --no-headers 2>/dev/null && echo "running" || echo "DONE")
  ⎿  Tue 02 Jun 2026 03:00:12 CEST
     1869486 Sl   02:13:06    01:06:42
     running

let it keep running until it's overrun the context

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.158

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗