Every bridge run started Claude Code with
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 (there since the bridge's
first commit, 702477525, not added for #5582). With it, or
DISABLE_TELEMETRY or DO_NOT_TRACK, Claude Code 2.1.316 reads none of its
GrowthBook flags (its privacy level must be "default"), and Message
Threads are on by one of them, tengu_curious_tower. So every turn sent
the whole history again, every image in it (#4496's slow turns).
A turn's run (claudeRunEnv) now leaves the quiet variables out, so Claude
Code reads the account's own flags as a plain claude does. Updates and
error reports stay off (DISABLE_AUTOUPDATER, DISABLE_ERROR_REPORTING,
which the flags don't need). A quiet variable the user set, in magpie's
environment or in their Claude Code's settings.json env, is passed as
they set it (their telemetry choice; the run reads no settings of its
own). WSL runs get DO_NOT_TRACK too. The one-off runs (model test,
warm-up, /usage) keep the switch: no history, and an interactive one
would send probeQuotaStatus's request as it starts (#5582).
The issue's patch set CLAUDE_CODE_TETHER_LIVE=1 instead. Not taken: in
2.1.316 that variable wins over the account's flag (ryr(): the env value
is returned before tengu_curious_tower is read), so it would turn threads
on for accounts Anthropic hasn't given them, or has turned them off for.
Here nothing is forced; an account without the flag goes whole, as its
own claude does. Nothing of magpie's sends a request; CLAUDE_CODE_ENTRYPOINT
is untouched.
Run:
- Real Team account (sandbox CLAUDE_CONFIG_DIR + HOME, the keychain item
copied to the sandbox's name and deleted after, token not rotated),
claude 2.1.316 -p stream-json, haiku, one process, a 3 MB noise PNG then
three text turns, bytes to api.anthropic.com per turn through a
counting CONNECT proxy:
magpie's old env (NONESSENTIAL=1): 672, 667, 667, 668 KB
this env (no quiet vars, updater + errors off): 737, 6.3, 2.6, 2.6 KB
Turn 4 answered the codeword from turn 1 both times. The fresh config
had no cached flags; after the run it had 1223, tengu_curious_tower true.
Other traffic with this env: one connection to Datadog's log intake
(1.5 KB), Claude Code's own.
- go test -count=1 -run 'Claude|WSL|Warm|Usage' ./internal/gateway on mote:
ok (139s). The full package queued behind ten suites on mote's lock
and was not run before the tag; the full suite runs after it.
- TestClaudeRunReadsItsFlags: red with the run back on cleanClaudeEnvTTL
(3 of its 4 cases; the one where magpie's env sets them passes on both), green with it.
- gofmt; go vet darwin, linux (nogui), windows of internal/gateway.
Not tried: a run through a sandbox magpie end to end, the interactive
(TUI) mode with a real account (an image turn runs as -p anyway), WSL, an
account whose flag is off.