[DOCS] CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC also disables the plan-usage fetch, which isn't documented

Open Beginner friendly
#108,146 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
documentation

Research direction

Read the env-vars and data-usage pages named in the issue and check how each describes CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC. Confirm the documented behavior against the reported SDK usage result, where rate_limits is null when the variable is set. Update both pages to explain that the plan-usage fetch is skipped, or clarify its behavior if maintainers choose to treat that fetch as essential.

Written by the indexing model from the issue text.

Description

area:api area:docs documentation enhancement platform:macos
Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/env-vars
https://code.claude.com/docs/en/data-usage

Section/Topic

CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC and "Telemetry services"

Current Documentation

The env-vars row lists what the variable disables: "auto-updates, telemetry, error reporting, the /feedback command, Claude-drafted feedback, release notes, the PR and MR status badge checks, and availability checks such as the fast mode check", plus feature-flag fetching and plugin command sources. The data-usage page describes it as a way to "disable all non-essential traffic at once".

What's Wrong or Missing?

With the variable set, Claude Code also skips the plan-usage request (/api/oauth/usage). Neither page mentions this. The SDK's usage call returns rate_limits_available: true, rate_limits: null in a few milliseconds, without a network request. Anything that reads plan limits from it shows nothing. Streamed rate_limit_events and the status line's rate_limits keep working, because they come from inference response headers.

It's easy to hit without knowing. Org admins push the variable to every member through managed settings to turn off telemetry. Members can't override it, and "0" still counts as set. The members then lose the 5-hour and weekly usage numbers in tools built on the SDK, with no hint why.

Repro (Claude Code 2.1.318, Team plan, macOS):

  1. Set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 in org managed settings. The same org already sets DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING, DISABLE_FEEDBACK_COMMAND and CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY.
  2. Call the SDK usage method (usage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET). Result: rate_limits: null, every time.
  3. Remove only that variable from managed settings and restart. The same call returns five_hour, seven_day and the per-model weekly window.

Downstream report: https://github.com/pingdotgg/t3code/issues/27492 (T3 Code shows "Could not read limits").

Suggested Improvement

Either:

  • add "the plan-usage fetch (/api/oauth/usage)" to the list in the env-vars row and on the data-usage page, or
  • treat the usage fetch as essential traffic. It only reads the account's own limits, the same data the status line already gets from response headers.

The second seems more useful. Admins who set the variable to turn off telemetry don't intend to hide their members' plan limits.

Impact

High - Prevents users from using a feature

Additional Context

Possibly related: #96124 (/usage shows no rate-limit bars while the status line has rate_limits). The reporter suspects CLAUDE_CODE_OAUTH_TOKEN auth. This variable is another cause of the same symptom.

Dominant language
TypeScript
Stars
154k
Forks
25.6k
Avg merge
12h 27m
Merged PRs (30d)
4

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anthropics/claude-code

All issues in anthropics/claude-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.