Skip to content

[FEATURE] Add CLI flag to output usage/quota information non-interactively #20399

Closed

Description

@mloureiro

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

Currently, the /usage slash command shows subscription quota information (session limits, weekly limits, reset times) but only works within an interactive Claude Code session. There's no way to retrieve this information programmatically from the command line.

I want to monitor my usage limits without starting an interactive session - either as a quick check or as a live dashboard/widget that updates in real-time as I work.

Proposed Solution

Add a --usage flag (or usage subcommand) that outputs quota information and exits:

# Simple text output
claude --usage

# JSON output for scripting
claude --usage --output-format json

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

Example output (text)

Current session:       37% used (resets 4:59pm)
Current week (all):    54% used (resets Jan 26 at 1:59pm)
Current week (Sonnet):  0% used

Example output (JSON)

{
  "session": {
    "used_percent": 37,
    "resets_at": "2026-01-23T16:59:00Z"
  },
  "week_all_models": {
    "used_percent": 54,
    "resets_at": "2026-01-26T13:59:00Z"
  },
  "week_sonnet": {
    "used_percent": 0,
    "resets_at": "2026-01-26T13:59:00Z"
  }
}

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)

Alternative Solutions

  • Parsing ~/.claude/stats-cache.json - only contains local usage stats, not subscription limits
  • Using expect to automate the interactive session - fragile and slow
  • Third-party tools - require additional dependencies

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

  1. I'm working with Claude Code throughout the day on multiple projects
  2. I want to keep track of my session/weekly limits without interrupting my workflow
  3. With this feature, I could run claude --usage --watch in a small terminal pane or feed claude --usage --output-format json to a macOS widget
  4. This would let me see my usage grow in real-time and know when I'm approaching limits before getting rate-limited

Activity

  1. changed the title [-]Add CLI flag to output usage/quota information non-interactively[/-] [+][FEATURE] Add CLI flag to output usage/quota information non-interactively[/+] on Jan 23, 2026
  2. github-actions commented on Jan 23, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. Add Quota Information Access to Claude Code CLI #13585
    2. [FEATURE] Programmatic access to usage data for scheduled automation (claude --status --json) #16629
    3. Make /status and/or login account checkable from command line #1886

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  3. mloureiro commented on Jan 23, 2026

    @mloureiro
    Author

    Closing as duplicate of #13585 which covers the same request more comprehensively.

  4. github-actions commented on Jan 31, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  5. locked as resolved and limited conversation to collaborators on Jan 31, 2026
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

    area:tuienhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions