Dispatch feature ignores CLAUDE_CODE_DISABLE_1M_CONTEXT — "Usage credits required for 1M context" blocks background agents

Resolved 💬 5 comments Opened Jun 1, 2026 by bradleybond512 Closed Jul 12, 2026

Bug Report

Summary

The Mac app's dispatch (background agent) feature fails with API Error: Usage credits required for 1M context even when CLAUDE_CODE_DISABLE_1M_CONTEXT=1 is set through every available mechanism.

Steps to Reproduce

  1. Set CLAUDE_CODE_DISABLE_1M_CONTEXT: "1" in ~/.claude/settings.json under env
  2. Set export CLAUDE_CODE_DISABLE_1M_CONTEXT=1 in ~/.zprofile
  3. Run launchctl setenv CLAUDE_CODE_DISABLE_1M_CONTEXT 1 to apply to all GUI processes
  4. Fully quit and relaunch the Claude Code Mac app
  5. Attempt to dispatch a background agent

Expected Behavior

Dispatch uses the standard 200K context model, consistent with the CLAUDE_CODE_DISABLE_1M_CONTEXT flag and "model": "sonnet" setting.

Actual Behavior

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

The error persists across all three ways of setting the env var and survives a full app restart.

Environment

  • Platform: macOS
  • App: Claude Code Mac app
  • Model setting: "model": "sonnet" in ~/.claude/settings.json
  • CLAUDE_CODE_DISABLE_1M_CONTEXT set via: settings.json env, ~/.zprofile, and launchctl setenv

Workaround

None found other than enabling usage credits. The flag appears to be ignored by the dispatch code path.

Notes

The flag works correctly for normal (non-dispatch) sessions. The issue is specific to the background agent dispatch feature in the Mac app, suggesting it spawns processes through a different code path that does not inherit or respect the disable flag.

View original on GitHub ↗

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