Repository navigation
v1.8.0 — Claude Code Context Window & Tool Concurrency
Two new optional per-provider config keys for running Claude Code against third-party Anthropic-compatible gateways (Synthetic, Alibaba Coding Plan, z.ai). Both are protocol=anthropic only.
max_context_tokens → CLAUDE_CODE_MAX_CONTEXT_TOKENS
Claude Code sizes auto-compact from a table of models it recognizes. Every third-party gateway model is absent from it, so it warns on startup and caps the session at the 200k window it assumes — wasting most of a larger one.
[anth_synth_kimi-k2.5]
protocol=anthropic
# exports CLAUDE_CODE_MAX_CONTEXT_TOKENS=1000000
max_context_tokens=1mAccepts 1m, 200k, or a plain integer such as 262144. The suffixes are decimal — 200k is 200,000, not 204,800 — matching CLAUDE_CODE_AUTO_COMPACT_WINDOW, whose documented maximum is exactly 1,000,000.
max_tool_use_concurrency → CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY
Claude Code fans tool calls out in parallel. Against a rate-limited or flatrate-throttled gateway that fan-out can trip the provider's own limits.
[claude_qwen-37]
protocol=anthropic
# exports CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY=5
max_tool_use_concurrency=5Accepts a bare positive integer 1–999. No k/m suffix — a fan-out count is not a token count.
Note: the INI parser has no inline-comment support, so put explanatory comments on their own line above the key, as shown.
key=5 # commentstores the comment as part of the value and the key is silently ignored.
Behavior
- A malformed value is rejected with a warning and the key ignored — the provider still loads.
- Both are owned outright by llm-env: unset on every
setof a provider that does not declare them, including switching between two Anthropic providers and moving between members of a group. A stale value is worse than none, so pre-exporting either variable in your shell profile will not survive anllm-env set. - Both are reported by
llm-env showwhen set, appear in thesetconfirmation line, and are checked byllm-env config validate— which warns when either lands on anopenai-protocol provider, where it does nothing. The quickstart importer emits pairedopenai_*/anth_*providers per model, so putting a key on the wrong half is easy and otherwise silent. - Providers declaring neither key are byte-identical in behavior and output.
Compatibility
No breaking changes. Both keys are additive and opt-in.
Verified on bash 3.2, 4.x, 5.x and zsh, across Linux, macOS and Windows (Git Bash + WSL2) in CI.
Full changelog: https://github.com/samestrin/llm-env/blob/main/CHANGELOG.md