Skip to content

v1.8.0 — Claude Code Context Window & Tool Concurrency

Choose a tag to compare

@samestrin samestrin released this 11 Aug 20:10
· 198 commits to main since this release
846859b

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=1m

Accepts 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=5

Accepts 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 # comment stores 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 set of 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 an llm-env set.
  • Both are reported by llm-env show when set, appear in the set confirmation line, and are checked by llm-env config validate — which warns when either lands on an openai-protocol provider, where it does nothing. The quickstart importer emits paired openai_*/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