[BUG] DISABLE_NONESSENTIAL_TRAFFIC silently breaks /usage
Status Open
Reported on v2.1.195
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 4 comments · opened Jun 27, 2026
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?
Setting CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC to true causes the /usage command to stop working, with a non-specific error:
<img width="884" height="485" alt="Image" src="https://github.com/user-attachments/assets/6b1fc971-f379-4ac3-830b-05af3a7675a6" />
What Should Happen?
Claude Code should at least be explicit about the command being partially non-functional when CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC is true (as it explicitly is about disabling `/feedback).
Ideally, /usage would still function fully, since it was explicitly requested by the user.
Error Messages/Logs
Error: Failed to load usage data
Steps to Reproduce
- Run
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=true claude - Type
/usage - Navigate to the Usage tab
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.195
Platform
Other
Operating System
macOS
Terminal/Shell
Other
Additional Information
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC has several undesired or unintended side effects:
Showing cached comments. Read the full discussion on GitHub ↗
3 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Not a maintainer — confirming the mechanism and adding a workaround, because this is one of a cluster of silent feature removals from the same flag.
/usagepulls your usage numbers from a server endpoint, andCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=trueclassifies that fetch as non-essential and suppresses it — so the call returns nothing and you get the genericFailed to load usage data. It isn't a crash; it's traffic suppression working as designed, but silently: nothing tells you the data is unavailable because you disabled the traffic. As you note, the same flag also takes out/feedback(#52787) and/web-setup(#70454), so the real issue is a category of "this command is now a no-op, with no explanation why."``
sh
`env -u CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC claude # this session can /usage
env -u(If you export it in a shell rc,
overrides it for just that invocation.)DISABLE_NONESSENTIAL_TRAFFICThe ask here is reasonable and small: when a command is disabled by
, **say so** — e.g.Usage data is unavailable because CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC is set, the same way/feedbackis explicit about being disabled. A user who explicitly typed/usagehas signalled intent; failing closed with a generic error reads as a bug even when the suppression is intentional. Documenting the full set of commands the flag neuters (/usage,/feedback,/web-setup`, …) in one place would also stop these from being filed as separate surprises.Not macOS-specific: reproduces identically on Linux (Arch, x86_64, native build), so the
platform:macoslabel understates the scope. Still present in 2.1.220, filed against 2.1.195.Root cause, from the shipped bundle:
fetchUtilization()calls the first-party API helper without the bypass option:and the helper short-circuits before any request is made:
That hits
if (!r.ok) throw Error('Auth error: ' + r.reason), which is caught incollectUsageData()and turned intostatus: "unavailable", which renders the generic string.Two things make this worse than the sibling cases in #52787 and #70454:
Auth error: essential-traffic-only, so anyone who turns on debug logging gets pointed at authentication instead of at the flag. Credentials and endpoint are fine: a directGET /api/oauth/usagewith the same stored OAuth token returns 200 with the full payload in about 0.3s.--enable-live-previewalready print an explicit "unavailable while nonessential network traffic is restricted (CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICis set)" message./usageis the only one in the group that falls through to a generic error, so surfacingreasonhere is a one-line change with existing precedent in the codebase.Passing
bypassEssentialTrafficOnlyon this call would also be defensible: the endpoint returns the user's own plan rate limit state and sends no workspace content.