[BUG] DISABLE_TELEMETRY and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC use bare truthiness, so =0 and =false silently enable them
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
DISABLE_TELEMETRY and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC are read as bare truthiness on the raw string, so =0, =false, and =no all enable them. Telemetry mode resolves as:
if (process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC) return "essential-traffic";
if (process.env.DISABLE_TELEMETRY) return "no-telemetry";
if (Vn(process.env.DO_NOT_TRACK)) return "no-telemetry";
return "default";
DO_NOT_TRACK, one line below, goes through a real parser. The two Claude-specific variables do not. Someone who sets DISABLE_TELEMETRY=0 intending to opt in is silently opted out, and there is no value that means "on" other than leaving the variable unset.
Why this matters beyond telemetry
no-telemetry mode also disables the GrowthBook fetch, so flag-gated tools fall back to their compiled defaults. On 2.1.241 that silently removes:
| Tool | Gate | Default |
|---|---|---|
| Monitor | tengu_amber_sentinel | false |
| ListAgents | tengu_agent_list_attach | false |
| PushNotification | tengu_kairos_push_notifications | false |
Monitor.isEnabled() is nt("tengu_amber_sentinel", false) && <platform check>, so a privacy setting silently changes which tools exist. This is the mechanism behind #86171, and the missing-ListAgents symptom in #87920 is the same failure.
The compounding part is that a 0 is a plausible thing to write. A user who believes they have telemetry on, and who never sees an error, just quietly has fewer tools than everyone else.
Steps to Reproduce
export DISABLE_TELEMETRY=0- Start a session and ask it to call the
Monitortool. - It reports the tool does not exist. Same with
=falseor=no. unset DISABLE_TELEMETRYand repeat:Monitorruns.
What Should Happen?
Parse these two the way DO_NOT_TRACK is already parsed, so 0, false, and empty mean off.
Workaround
An empty string is falsy, so this neutralizes a value inherited from a shell profile without editing the profile:
"env": { "DISABLE_TELEMETRY": "" }
Verified in both ~/.claude/settings.json and a project .claude/settings.json (post-trust).
Claude Code Version
2.1.241
Platform
Anthropic API
Operating System
macOS