-
Notifications
You must be signed in to change notification settings - Fork 66
Context window size ignores CLAUDE_CODE_DISABLE_1M_CONTEXT env var #28
Copy link
Copy link
Open
Description
Description
The webview displays context window size as 1000k for Opus 4.6 and Sonnet 4.6 models, but does not respect the CLAUDE_CODE_DISABLE_1M_CONTEXT=1 environment variable which limits the actual context window to 200k.
Current Behavior
In dist/webview/index.js, the context window size is hardcoded per model:
// Hardcoded model → context window mapping
{ "opus-4-6": 1e6, "sonnet-4-6": 1e6 }
S = 2e5 // 200k fallback
C = 1e6 // 1M defaultThe getContextWindowSize() function only checks the model name and always returns 1,000,000 for Opus/Sonnet 4.6.
Expected Behavior
When CLAUDE_CODE_DISABLE_1M_CONTEXT=1 is set in Claude Code's settings.json (under env), the context gauge should display 200k instead of 1000k.
How to Reproduce
- Set
CLAUDE_CODE_DISABLE_1M_CONTEXT=1in~/.claude/settings.json→env - Start agent-flow-app
- Open the webview — context gauge shows 1000k max instead of 200k
Suggested Fix
- Read the
CLAUDE_CODE_DISABLE_1M_CONTEXTenv var (from hook stdin payload or Claude Code settings) - If set to
"1", cap context window at 200,000 regardless of model
Environment
- agent-flow-app: v0.6.2
- Model: claude-opus-4-6
- OS: macOS (Darwin 25.3.0)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels