[BUG] https://github.com/anthropics/claude-code/issues

Resolved 💬 1 comment Opened Jun 4, 2026 by N0TB0T Closed Jul 9, 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 Code automatically upgraded to the 1M context window mid-session without any warning, confirmation dialog, or indication that this would incur additional costs. The upgrade happened solely because the conversation grew long — not because the user selected the 1M model.

Actual behavior:

Silent automatic upgrade to 1M context
Credits consumed without notification
User discovers the cost only after the fact via the error message "Usage credits required for 1M context"

Environment:

Claude Code CLI on Windows 11
Plan: Pro
Model setting: Default (Sonnet 4.6, standard context)

Workaround:
Set CLAUDE_CODE_DISABLE_1M_CONTEXT=1 in ~/.claude/settings.json

What Should Happen?

User is warned before switching to a paid tier
User must explicitly confirm the upgrade
OR: the session is summarized/compacted instead of upgrading

Error Messages/Logs

API Error: Usage credits required for 1M context · turn on usage credits at claude.ai/settings/usage, or use --model to switch to standard context

Steps to Reproduce

Steps to reproduce:

Start a long coding session (multi-hour, many file reads/edits, error logs etc.)
Observe: at some point Claude Code silently switches to 1M context
Result: 40€+ in usage credits consumed without any prompt or opt-in

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

v2.1.161 (Claude Code Plugin in vscode)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗