Skip to content

Add Quota Information Access to Claude Code CLI #13585

Open

Description

@Data-Wise

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Description

Problem

Claude Desktop displays quota information (session %, weekly %) in the UI, but this data is not accessible to Claude Code CLI users or automation scripts. This forces users to manually check the desktop app and record values, preventing automated monitoring and workflow optimization.

Request

Expose quota information via Claude Code CLI through one of these methods:

  1. New claude quota command (recommended)
  2. API endpoint that CLI can query
  3. Environment variables set by Claude Code
  4. Local configuration file that gets updated

Example Use Cases

# Get current quota
$ claude quota
Session: 78%
Weekly (All): 17%
Weekly (Sonnet): 5%

# JSON for scripting
$ claude quota --json
{"session": 78, "weekly_all": 17, "weekly_sonnet": 5}

# Enable/disable features based on quota
if [ $(claude quota --session) -gt 80 ]; then
  export ALWAYS_THINKING=false
else
  export ALWAYS_THINKING=true
fi

Why This Matters

  • ✅ Enables automated quota monitoring
  • ✅ Allows workflow optimization based on resource limits
  • ✅ Reduces manual, repetitive checking
  • ✅ Enables third-party tool integration
  • ✅ Data already exists; just needs exposure

Proposed Solution

Proposed Solution

Option 1: CLI Command (Recommended)

# Basic usage
claude quota

# Output:
# Session: 78% (resets in 3h 20m)
# Weekly (All): 17% (resets in 6 days)
# Weekly (Sonnet): 5% (resets in 6 days)

# JSON output
claude quota --json
# { "session_percent": 78, "weekly_all_percent": 17, "weekly_sonnet_percent": 5 }

# Individual values
claude quota --session    # 78
claude quota --weekly-all # 17
claude quota --weekly-sonnet # 5

# With reset times
claude quota --json --with-reset-times

Option 2: Environment Variables

# Set by Claude Code when running
export CLAUDE_QUOTA_SESSION=78
export CLAUDE_QUOTA_WEEKLY_ALL=17
export CLAUDE_QUOTA_WEEKLY_SONNET=5

Option 3: Config File

// ~/.claude/quota.json (auto-updated)
{
  "session": {
    "percent": 78,
    "resets_in_seconds": 12600
  },
  "weekly_all": {
    "percent": 17,
    "resets_at": "2025-12-16T13:59:00Z"
  },
  "weekly_sonnet": {
    "percent": 5,
    "resets_at": "2025-12-16T19:59:00Z"
  }
}

Benefits

For Users

  • Automated quota monitoring without manual checking
  • Ability to build quota-aware workflows
  • Better resource management
  • Integration with terminal tools (statusline, etc.)

For Anthropic

  • Improved user experience
  • Enables ecosystem of tools
  • Reduces support burden
  • Competitive advantage

No Downsides

  • No security issues (quota is per-user, already in UI)
  • No breaking changes (new feature only)
  • Low implementation effort (data already exists)

Alternative Solutions

Current Workaround (User Experience)

Every 3-4 hours:
1. Open Claude Desktop
2. Check quota percentages
3. Manually run script: cq update 78 17 5
4. Continue work

This is tedious, error-prone, and prevents automation.

Priority

High - Significant impact on productivity

Feature Category

Interactive mode (TUI)

Use Case Example

Example Use Cases

# Get current quota
$ claude quota
Session: 78%
Weekly (All): 17%
Weekly (Sonnet): 5%

# JSON for scripting
$ claude quota --json
{"session": 78, "weekly_all": 17, "weekly_sonnet": 5}

# Enable/disable features based on quota
if [ $(claude quota --session) -gt 80 ]; then
  export ALWAYS_THINKING=false
else
  export ALWAYS_THINKING=true
fi

Additional Context

Technical Notes

Data Already Exists

  • Claude Desktop displays this data
  • Calculated server-side
  • Just needs CLI exposure

Implementation Considerations

  • Rate limiting (if needed) - recommend none (local data)
  • Backwards compatibility - not an issue (new feature)
  • Cross-platform support - should work on all platforms
  • Error handling - graceful fallback when not available

Related

  • Users unable to monitor quota automatically
  • Cannot integrate quota data into workflows
  • No programmatic access to resource limits
  • Third-party tools cannot access quota data

Additional Context

Current User Solution (Workaround)

Users have built their own quota tracking:

  • Manual cq update command
  • Daemon that sends reminders every 5 minutes
  • Cannot auto-fetch because no API exists
  • Result: Still manual, just with notifications

Ideal User Solution

With this feature:

  • claude quota command provides current data
  • Daemons can automatically fetch and display
  • Tools can build quota-aware features
  • No manual intervention needed

Example: Terminal Status Line Integration

With quota API, tools like Powerlevel10k could display:

╭─ 📁 my-project  main │ ⚡78% W:17%
╰─ Claude Haiku │ 14:23 │ ⏱ 2h 45m

Currently impossible without access to quota data.


Acceptance Criteria

  • claude quota command available
  • Returns current session/weekly percentages
  • JSON output for scripting
  • Works across all platforms
  • Documentation provided
  • Examples in help text
  • No breaking changes

Priority

High - Enables many user workflows and integrations


References

Activity

  1. added
    enhancement
    on Dec 10, 2025
  2. blarvin commented on Jan 10, 2026

    @blarvin

    Cross-Platform Usage Visibility Gap

    This request is even more critical when you consider that Claude Pro usage is shared across all platforms (web, mobile, desktop apps, and Claude Code CLI).

    The Problem

    Currently, Claude Code has zero visibility into the user's total Claude Pro usage, even though:

    • Every message sent via Claude Code counts toward the same Pro quota as web/mobile/desktop
    • The web interface at claude.ai shows a usage bar with remaining allowance and reset time
    • Third-party tools like ccusage and claude-monitor can only track local JSONL files from Claude Code sessions
    • These tools cannot show:
      • Total Claude Pro monthly/weekly allowance
      • Cross-platform usage (mobile, desktop, web contributions)
      • Time until usage limit resets
      • Remaining quota percentage

    Real-World Impact

    CLI-first users who rarely open the web interface have no way to know if they're approaching their limits until they hit them unexpectedly during important work sessions. This is especially problematic because:

    • You might use Claude on mobile during the day
    • Then switch to Claude Code in the evening
    • And have no idea you're at 90% quota already

    Additional Solution: Official MCP Server

    In addition to the CLI command approach outlined in this issue, consider providing an official MCP server like @anthropic/claude-usage that exposes:

    • Current usage percentage across all platforms
    • Tokens/messages remaining in current period
    • Time until reset
    • Optional breakdown by platform

    This would enable the entire MCP ecosystem to build quota-aware tools and integrations.

    Expected Behavior

    Running /usage or a similar command should show the same data visible on claude.ai:

    Claude Pro Usage (Week of Jan 6-12, 2026)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    Usage:  [████████████░░░░░░░] 62%
    Remaining: 38% (15.2M tokens)
    Resets in: 3 days, 14 hours
    

    This affects everyone who uses Claude Code as part of a multi-platform workflow, which is likely the majority of Pro users.

  3. mloureiro commented on Jan 23, 2026

    @mloureiro

    +1 for this feature!

    One additional idea that could complement the proposed claude quota command: a watch/live mode for real-time monitoring:

    # Live mode - continuously updates (for dashboards/widgets)
    claude quota --watch
    claude quota --watch --interval 30   # refresh every 30 seconds

    Watch mode behavior:

    • Clears and redraws the output on each refresh (like watch or htop)
    • Default refresh interval: 30-60 seconds (to avoid excessive API calls)
    • Could be used in a terminal pane, tmux window, or as input for macOS widgets (via JSON output with --json)

    This would allow users to keep a small terminal open as a live usage dashboard while working.

  4. rcontrerasv commented on Jan 30, 2026

    @rcontrerasv

    +1 on this. The cross-platform visibility gap is the biggest pain point. Local JSONL parsing can approximate CLI usage, but it completely misses consumption from claude.ai, mobile, and desktop apps — so any local tool will always show inaccurate percentages compared to /usage.

    An official API endpoint or MCP server exposing the same data as /usage (current %, reset times, per-window breakdown) would be extremely valuable. Even a simple JSON output from claude quota --json would unlock a whole ecosystem of monitoring tools.

  5. trillium commented on Feb 8, 2026

    @trillium

    Working solution: OAuth usage API endpoint

    For anyone building status line integrations, there's already a working endpoint that returns the exact same data as /limits:

    GET https://api.anthropic.com/api/oauth/usage
    

    Auth: Bearer token from macOS Keychain:

    security find-generic-password -s "Claude Code-credentials" -w
    # Returns JSON with claudeAiOauth.accessToken

    Response:

    {
      "five_hour": {"utilization": 2.0, "resets_at": "2026-02-08T12:00:00+00:00"},
      "seven_day": {"utilization": 35.0, "resets_at": "2026-02-12T03:00:00+00:00"},
      "seven_day_sonnet": {"utilization": 3.0, "resets_at": "2026-02-12T19:00:00+00:00"},
      "seven_day_opus": null
    }

    utilization values are percentages matching what /limits shows.

    I've integrated this into a status line script with 60s caching. Works reliably.

  6. frr149 commented on Feb 23, 2026

    @frr149

    Real-world perspective: building a production macOS app on top of these internal endpoints

    I'm the developer of Tokamak for Claude, a macOS menu bar app that monitors Claude Max quota and Claude Code session statistics. It's in the App Store review pipeline right now. I want to share what building on top of internal, undocumented endpoints actually looks like in practice — and why a public API is essential.

    What we currently do (and why it's fragile)

    Tokamak polls two internal endpoints:

    • GET /api/organizations — to discover the user's org UUID and detect plan type (Max/Pro)
    • GET /api/organizations/{org_id}/usage — for real-time utilization windows (5h, 7d, 7d-sonnet, 7d-opus, 7d-cowork, etc.)

    Authentication requires a sessionKey cookie from claude.ai, obtained via a hidden WKWebView that loads the login page. This is inherently fragile:

    1. Cookie-based auth breaks regularly. Cloudflare challenges, cookie rotation, and SameSite policies mean the session can become invalid without warning.
    2. No schema contract. The response shape has changed multiple times. We've built a bidirectional schema validation system that captures production responses and compares them against our DTOs to detect drift — because there's no versioned schema to rely on.
    3. Undocumented fields appear and disappear. Example: iguana_necktie showed up as a null window one day. seven_day_cowork and seven_day_oauth_apps appeared without any changelog. We handle all windows as optional and degrade gracefully, but this is defensive programming against an API that could break us at any time.
    4. Rate limiting is guesswork. We poll every 30s with exponential backoff (up to 5min), but there's no documented rate limit. We've hit 429s and had to guess appropriate retry behavior.

    What a public API would unlock

    A stable GET /api/v1/usage (or claude quota --json) with:

    • Versioned schema — so breaking changes are announced, not discovered
    • OAuth or API key auth — instead of session cookies
    • Documented rate limits — so tools can poll responsibly
    • All quota windows — including the newer ones (cowork, oauth_apps, opus, extra_usage)
    • Reset timestamps — already present in the internal API, just needs to be official

    This would benefit not just Tokamak but the growing ecosystem: CodexBar, terminal statusline integrations, automation scripts, and anyone who wants to build quota-aware workflows.

    The broader ask

    Other AI providers already offer this:

    • OpenAI: GET /v1/organization/usage with proper API key auth
    • GitHub Copilot: Usage metrics in the REST API

    Claude is the only major provider where monitoring your own quota requires reverse-engineering internal web endpoints. For a platform that's actively encouraging developers to build with Claude Code, having no official way to check "how much quota do I have left?" is a significant gap.

    I'd strongly advocate for Option 1 (CLI command) from the original proposal plus a documented REST endpoint. The CLI command helps individual users; the REST endpoint enables the tool ecosystem.

    Happy to help test any beta implementation against Tokamak's existing infrastructure.

  7. ibehnam commented on Feb 23, 2026

    @ibehnam

    Correction to the OAuth endpoint details above — there's a required header that was missing, and the response schema has expanded.

    GET https://api.anthropic.com/api/oauth/usage
    Authorization: Bearer <access_token>
    anthropic-beta: oauth-2025-04-20
    

    Without the anthropic-beta header, the endpoint returns an authentication_error.

    Getting the token (macOS):

    security find-generic-password -s "Claude Code-credentials" -w \
      | python3 -c "import sys,json; print(json.load(sys.stdin)['claudeAiOauth']['accessToken'])"

    Full response (as of Feb 2026):

    {
      "five_hour": {
        "utilization": 5.0,
        "resets_at": "2026-02-23T22:00:00.177194+00:00"
      },
      "seven_day": {
        "utilization": 59.0,
        "resets_at": "2026-02-27T01:00:00.177214+00:00"
      },
      "seven_day_oauth_apps": null,
      "seven_day_opus": null,
      "seven_day_sonnet": {
        "utilization": 5.0,
        "resets_at": "2026-02-27T06:00:00.177221+00:00"
      },
      "seven_day_cowork": null,
      "iguana_necktie": null,
      "extra_usage": {
        "is_enabled": true,
        "monthly_limit": 5000,
        "used_credits": 0.0,
        "utilization": null
      }
    }

    Changes from @trillium's original response format:

    • seven_day_oauth_apps, seven_day_cowork, iguana_necktie windows added (all nullable)
    • extra_usage object added (tracks overuse billing: enabled status, monthly limit, used credits)

    One-liner to test:

    curl -s "https://api.anthropic.com/api/oauth/usage" \
      -H "Authorization: Bearer $(security find-generic-password -s 'Claude Code-credentials' -w | python3 -c "import sys,json; print(json.load(sys.stdin)['claudeAiOauth']['accessToken'])")" \
      -H "anthropic-beta: oauth-2025-04-20" | python3 -m json.tool
  8. luvidal commented on Mar 10, 2026

    @luvidal

    The gap is blocking real tools from shipping

    This issue perfectly captures why proper API exposure matters. We already have:

    • Production tools (Tokamak) reverse-engineering internal endpoints to work around this
    • Multiple workarounds documented (OAuth endpoint, tmux scraping, local parsing)
    • Clear demand from CLI-first users who can't see their quota until they hit the wall

    Why this matters for Anthropic:
    Making this official would immediately:

    1. Replace fragile reverse-engineered solutions with a stable contract
    2. Enable the tool ecosystem (statusline widgets, dashboards, quota-aware automation)
    3. Bring Claude parity with OpenAI's /v1/organization/usage endpoint

    The implementation exists. The OAuth endpoint already returns exactly what /limits shows — just needs to be documented and stable. A simple claude quota --json command or versioned REST API would unblock dozens of tools users are already trying to build.

    This isn't a nice-to-have. Users are currently choosing to ignore quota warnings and hit limits unexpectedly because there's no programmatic way to monitor across platforms. That's a UX failure we can fix right now.

  9. Astro-Han commented on Mar 24, 2026

    @Astro-Han

    Progress on the data access front: since v2.1.80, rate_limits (five_hour/seven_day used_percentage + resets_at) are in the statusline stdin JSON. Not a standalone claude quota --json command yet, but the data is no longer locked behind internal endpoints — statusline scripts can read it without OAuth workarounds.

    claude-lens reads these fields for real-time quota display. The Tokamak approach for a full CLI/menu bar solution is complementary.

  10. FUsIon80 commented on Apr 19, 2026

    @FUsIon80

    +1

  11. a-athaullah commented on Apr 21, 2026

    @a-athaullah

    +1 — Strong use case from building a web UI wrapper around Claude Code CLI.

    We're building an internal bug triage tool that spawns Claude Code CLI via child_process.spawn with --output-format stream-json. The web dashboard manages parallel investigation sessions and needs to show operators:

    1. Current session usage — so operators know if they can start another investigation or need to wait for reset
    2. Weekly usage — to plan investigation workload across the week
    3. Reset countdown — to show when capacity becomes available

    Currently the only way to see this is in the Claude Code status bar during an interactive session, but our tool runs in --print mode where the status bar isn't available.

    Ideal for our case: A claude usage --json command we can poll, or even better, usage info included in the stream-json output events (e.g., a usage_update event type alongside result events). The latter would let us update the dashboard in real-time without additional polling.

    This would save us from having to manually track/estimate token budgets as a poor approximation of the actual rate limits.

  12. FabianKostenzer commented on Apr 27, 2026

    @FabianKostenzer

    This is what works reliably for me, on ubuntu:

    claude --init-only #Inititialize to refresh auth token for usage request to work
    accessToken=$(jq -r '.claudeAiOauth.accessToken' ~/.claude/.credentials.json)
    usageResponse=$(curl -s https://api.anthropic.com/api/oauth/usage -H "Authorization: Bearer $accessToken" -H "anthropic-beta: oauth-2025-04-20")
    weeklyUsage=$(jq -r '.seven_day.utilization' <<< "$usageResponse" | cut -d. -f1)

    In this example, I get the weeklyUsage in bash runtime as a number (eg. 73).
    See the full response of https://api.anthropic.com/api/oauth/usage for other metrics, like session usage (five_hour).

  13. 12 remaining items

  14. urakkaamyx commented on Jul 17, 2026

    @urakkaamyx

    There is the undocumented api endpoint that provides all this info, without the need for a AnthropicsAPIkey, but unfortunately its probably against TOS.

    Its the same exact endpoint that the App desktop/mobile app uses to show you what your at.
    https://claude.ai/api/organizations/{orgID}/usage

    You still have to be logged in to use it though.

  15. wshallwshall commented on Aug 4, 2026

    @wshallwshall

    The ask here is @amphro's, unchanged — rate_limits in hook input, and available headless. I want to add the part I have not seen stated: a session cannot learn which account governs it, so a quota reading can be confidently wrong and look completely normal.

    That is the failure I care about, and it is not budgeting. With several concurrent sessions on one account-wide pool, the thing that costs real work is a session hitting a cutoff mid-task with uncommitted changes. The whole point of reading quota is to commit and hand off before that happens — so a number that is wrong is worse than no number at all, because it is the number a session uses to decide it is safe to keep going.

    The payload names no account. rate_limits describes a per-account pool without identifying which account it belongs to, and nothing else in a session's inputs does either. So a monitor has to hardcode which credentials to read. On a box with more than one Claude account signed in, it will happily display another account's headroom, labelled as this session's, with no indication anything is off. Mine did exactly that — the warning banner every session sees names an account that does not necessarily govern that session.

    And the one surface that carries rate_limits has no host on two of the three ways I run Claude Code. It arrives on a statusLine command's stdin and nowhere else, so quota state cannot be subscribed to — it has to be collected by a statusLine and published somewhere shared, which forces a one-publisher/N-readers design nobody would choose. Then:

    • The statusLine is part of the TUI render tree, so it never executes under claude -p or the SDK. A headless coordinator can read what an interactive session publishes and can never publish it itself — backwards from where the need is.
    • I work in the desktop app, which renders no status line. My collector is correctly wired and has never executed once: the first thing its command does is append to a heartbeat log, and that log does not exist, nor do either of its publish targets. (Strictly that shows it has not run since I added the heartbeat line — but there is no status line for it to run in, which is the simpler reading.)

    So the documented workaround everyone in this thread is describing — collect from a statusLine, publish to a file — has nowhere to run for a desktop or headless user. That is why I would rather have it in hook input than have the statusLine path improved.

    One ask, then: rate_limits in the SessionStart / UserPromptSubmit hook payload, or a headless-capable JSON usage output — plus whatever identifies the account the numbers belong to. The second half is small and it is what makes the first half safe to act on.

    Separately and minor: the payload carries five_hour and seven_day only — no per-model bucket. That was raised in #37227, which went stale, was auto-closed after inactivity and is now locked, so it reads as unresolved rather than decided. It matters here only because a green reading on the two visible windows says nothing about a third that could stop you.

    Setup: Windows 11, 2.1.219, solo dev, several concurrent sessions on one account. n=1.

  16. kalms commented on Aug 11, 2026

    @kalms

    +1 to this issue/feature. Would be extremely helpful for automation, dashboards etc.

  17. terabyte commented on Aug 25, 2026

    @terabyte

    Adding a data point that I think narrows this request considerably: the CLI
    already computes and returns this, for free. It just returns it as prose.

    $ claude -p "/usage" --output-format json
    

    The envelope reports total_cost_usd: 0, input_tokens: 0, output_tokens: 0,
    num_turns: 0, duration_api_ms: 0. It is answered client-side from state the
    client already holds, costs no quota, makes no API call, and returns in about
    2.5 seconds. The numbers are account-wide, matching what claude.ai/settings/usage
    reports, not a local approximation.

    The problem is that it lands in .result as human text:

    Current session: 8% used · resets Aug 25, 2:29pm (America/Los_Angeles)
    Current week (all models): 85% used · resets Aug 26, 7:59pm (America/Los_Angeles)
    Current week (Fable): 0% used
    

    So consumers regex it, and prose is not a contract. A concrete failure I hit
    building on this: the minutes are omitted on the hour, so the same reset renders
    as either 7:59pm or 8pm depending on sub-second rounding of a 7:59:59.x
    instant, and it genuinely alternates between calls. My parser required H:MM,
    matched roughly two calls in three, and silently produced a null reset on the
    rest. Nothing errored; a scheduler downstream just started pacing against a
    missing value.

    Without a supported path, what I had before this was worse: Playwright driving a
    real Chrome under Xvfb against claude.ai/api/organizations/<org>/usage, because
    that endpoint sits behind Cloudflare and rejects non-browser requests. It needs a
    logged-in browser profile on the machine, breaks whenever the page changes, and
    is not something I would ask anyone else to run.

    My use case is pacing unattended work: deciding whether to start a long job now
    or wait for the 5-hour window to reset, and staying inside the weekly allowance.
    That needs the reset timestamps as much as the percentages.

    One gap worth naming, because it is the only reason I cannot delete the scraper
    outright: /usage does not report extra-usage credits, and /usage-credits
    returns a link rather than the numbers.

    $ claude -p "/usage-credits" --output-format json | jq -r .result
    Visit https://claude.ai/settings/usage?from=cc_cli_limit_message to manage usage credits.
    

    I am not asking for that here, and I barely use credits. I mention it only
    because it is the remaining reason a browser-scraping path exists at all in my
    setup.

    Two minimal shapes, either of which would be enough:

    1. Emit structured fields alongside .result when --output-format json is
      passed, since the values already exist at that point.
    2. Or include them in the statusline payload, which already carries
      cost.total_cost_usd and context_window and is polled by exactly the
      tooling that wants this.

    Happy to test either.

  18. Kaique-Almeida commented on Sep 15, 2026

    @Kaique-Almeida

    +1 on this — wanted to add a concrete data point that might help make the case.

    The claude.ai web app already calls an internal endpoint that returns exactly the data this issue is asking for:

    GET https://claude.ai/api/organizations/{org_id}/usage
    

    Response (observed live, fields relevant here):

    {
      "five_hour": {
        "utilization": 21,
        "resets_at": "2026-09-15T07:00:00.699351+00:00",
        "limit_dollars": null,
        "used_dollars": null,
        "remaining_dollars": null,
        "locked_reason": null
      },
      "seven_day": {
        "utilization": 29,
        "resets_at": "2026-09-19T09:00:00.699367+00:00",
        "limit_dollars": null,
        "used_dollars": null,
        "remaining_dollars": null,
        "locked_reason": null
      }
    }

    So this isn't a "please compute something new" request — the server-side data and computation already exist and already power the "Usage" screen in the app. The ask is just to expose it through a supported, documented, non-interactive interface (claude quota / --json as proposed above), instead of only the interactive /usage TUI.

    For context on why this matters beyond convenience: without an official endpoint, the only alternative is scraping the authenticated web endpoint directly, which is fragile (session cookies expire) and also sits behind Cloudflare bot-protection that blocks plain scripted requests even with a valid cookie — which is by design, and not something users should be trying to work around. An official CLI/API surface would remove the incentive to do that entirely.

    Competing tools already ship this, for reference: Google's Antigravity CLI supports agy -p "/usage" --output-format json, returning structured remaining_fraction/reset_time per quota group at zero token cost (checking usage doesn't spend usage).

    Concrete use case on my end: local hybrid-agent setup (small local model + Claude Code as an escalation/coordinator) where I want a lightweight desktop widget showing live quota alongside other providers I already track this way — would love to drop the scraping workaround for an official source.

  19. 3dnow commented on Oct 5, 2026

    @3dnow

    A data point for the in-session half of this: since 2.1.287, mods get the 5-hour and 7-day figures without scraping. $.session.usage() returns them as rateLimits (kind, percentUsed, resetsAt), and the session.measure event fires when they change. A mod can also $.fs.write them to a file for scripts outside the session.

    Per-model weeklies (Fable, Opus) are not in that API yet. The two local sources I found are the limits[] entries of kind weekly_scoped in cachedUsageUtilization (~/.claude.json), and claude -p --no-session-persistence /usage, which costs no tokens, as @terabyte noted.

    WeekToken uses both, if you want a working example: https://github.com/3dnow/claude-mods

  20. oddessentials commented on Oct 22, 2026

    @oddessentials

    For CLI users in the meantime: Agent Guild (my project) shows the 5-hour and 7-day used % and reset time for each signed-in Claude Code account, plus Codex CLI's limits, refreshed every minute while the page is open. It reads the same data the Desktop meter does, so an official endpoint would still be welcome. https://github.com/oddessentials/agent-guild

  21. jacobyoby commented on Nov 1, 2026

    @jacobyoby

    Workaround: https://github.com/jacobrakaiFoundation/claude-mods/tree/main/mods/usage-meter

    A line above the prompt, in the terminal and the desktop Code tab, with context fill, the 5h and 7d rate-limit windows (with reset countdowns) and session cost, as meters that turn amber at 80% and red at 95%. Install: /plugin install usage-meter --marketplace jacobrakaiFoundation/claude-mods.

  22. jake1164 commented on Nov 3, 2026

    @jake1164

    Following up on the suggestions earlier in this thread to use GET https://api.anthropic.com/api/oauth/usage for monitoring subscription usage.

    I'm developing [Presto AI Dash](https://github.com/jake1164/presto-ai-dash), a free, open-source AI usage dashboard.

    Our local collector reads Claude usage data, but the readings remain stale until I manually run /usage in VS Code, even while actively using Claude. We tested claude -p "/usage" as an alternative, but the process reported model token usage and an estimated cost.

    The OAuth endpoint, however, successfully returned fresh 5-hour and 7-day utilization without invoking inference.

    My concern is Anthropic's [authentication guidance](https://code.claude.com/docs/en/legal-and-compliance#authentication-and-credential-use).

    The guidance states that third-party developers may not collect, store, or intermediate Claude.ai credentials or session tokens, and that Anthropic may enforce these restrictions without prior notice.

    However, it's unclear whether this applies to a user-operated, local collector making read-only requests with existing Claude Code credentials. The credentials would remain on the user's computer and would never be transmitted to our dashboard or any third-party service.

    Has Anthropic clarified whether this specific use is permitted?

    I'm comfortable with an undocumented API potentially breaking. I'm not comfortable shipping something that could violate the terms of service or put users' accounts at risk.

    If this isn't permitted, is there an approved way to retrieve fresh subscription usage without consuming tokens?

  23. chiarorosa commented on Nov 10, 2026

    @chiarorosa

    For Windows users in the meantime: I built CCT (claude-codex-taskbar), an open-source taskbar widget that shows Claude Code's 5-hour and weekly % used and reset times, plus Codex limits, right in the Windows 11/10 taskbar. It reads credentials read-only, never refreshes tokens, and has no telemetry. It's a single native Rust exe under 1 MB. https://github.com/chiarorosa/claude-codex-taskbar

    Disclosure: I'm the author. A stable, documented interface for these figures, as this issue asks, would let tools like this stop relying on an undocumented endpoint.

    If it helps, a star on the repo is appreciated, and contributions are welcome there too.

  24. tnek213 commented on Nov 28, 2026

    @tnek213

    +1 it is extremely strange to me that this isn't fixed one year after this issue was created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions