Skip to content

Write plan usage (5-hour / weekly / monthly) to a local file so tools can show it without the API key #1161

Open

Description

@33sigma

Request

Have the CLI write the plan quota it already shows in /usage to a local file, for example ~/.commandcode/usage.json, and update it whenever the CLI refreshes usage. Suggested shape:

{
  "updatedAt": "2026-11-18T19:05:00Z",
  "plan": "goat",
  "windows": [
    { "id": "5h",     "usedPercent": 88, "resetsAt": "2026-11-18T22:00:00Z" },
    { "id": "weekly", "usedPercent": 41, "resetsAt": "2026-11-22T00:00:00Z" },
    { "id": "monthly","usedPercent": 12, "resetsAt": "2026-12-01T00:00:00Z" }
  ]
}

A documented, read-only usage endpoint would also work, but the local file is the smallest change and requires no credentials for consumers.

Why

Orca (stablyai/orca) shows a usage bar for Claude Code, Codex, Gemini, OpenCode and others by reading files those agents already write to disk. It makes no network calls and handles no API keys. Command Code is the only agent many of us run there without a usage readout.

There are already three community PRs in Orca that try to add it: stablyai/orca#8589, stablyai/orca#23600 and stablyai/orca#30295. None has been merged. All three have to read the API key from ~/.commandcode/auth.json and call an undocumented billing API. That conflicts with how Orca's other usage providers work, and the PRs would break if that API changed. Today ~/.commandcode/cache contains only model-catalog, so there is nothing safe for them to read instead.

If the CLI wrote that file, any of those PRs could be reduced to a small file reader. Statuslines, editors and scripts could use it too, without touching the key.

Related: #904, #675, #889 (requests for programmatic quota access), stablyai/orca#30294 and stablyai/orca#40600.

Observed on CLI 1.88.4, macOS, GOAT plan.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions