Files
magpie/site
yetone de5fc6700e docs: Claude Code's Code Mode needs a direct Anthropic connection (#7025)
lst016 (#7025) and DylanH_L on X asked for Code Mode through magpie.
Claude Code 2.1.327 decides it in its own start-up check, read in its
bundle: Code Mode is refused with "provider" unless the provider is
firstParty and ANTHROPIC_BASE_URL is unset or its host is exactly
api.anthropic.com (nc()/fd()); then with "credentials" for an
apiKeyHelper or a custom Authorization/X-Api-Key header, "no_flags"
when DISABLE_TELEMETRY, DO_NOT_TRACK or
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC stops the feature-flag
download, and "gate" unless Anthropic's tengu_rustling_blossom flag is
on for the account. Nothing magpie sends or answers can change it: the
base-URL check runs before any request.

So every routed Claude Code (any upstream, a Claude subscription's or an
Anthropic key's model included) starts without it. The subscription
bridge's own runs can't have it either: --tools leaves REPL out, it reads
no user settings, and Code Mode needs an interactive opt-in and restart.
Faking a first-party address would misrepresent the client to Anthropic,
so it isn't done. The docs page says so in en, zh and ja, with the way to
use it: Claude Code on its own model, straight to Anthropic, with
Claude Code's telemetry left on (magpie's switch sets DISABLE_TELEMETRY).

Run:
- real Claude Code 2.1.327 in tmux, sandbox HOME and CLAUDE_CONFIG_DIR,
  ANTHROPIC_BASE_URL=http://127.0.0.1:59998,
  CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1: "Code Mode (experimental) isn't
  available: for now it only works directly with the Anthropic API".
- node docs-index.mjs (search indexes, llms-full.txt, docs-index.sums).
- on mica: node --test site/search.test.mjs site/worker.test.mjs
  site/docker-tags.test.mjs, 50 pass 0 fail; go test ./internal/testenv ok.
Not tried: a direct Code Mode session on a real account (it needs
Anthropic's account gate; nothing in magpie is on that path).
2026-11-18 16:15:36 +08:00
..