# ed usage limits

> Prints the most recent rate limit observation for each provider Edith tracks.

- Canonical URL: https://getedith.pro/docs/cli/usage/limits
- Updated: 2026-12-02

Prints the most recent rate limit observation for each provider Edith tracks.

```
ed usage limits [--refresh] [--json]
```

## Options

| Name | Type / values | Default | What it does |
| --- | --- | --- | --- |
| `--refresh` | flag | off | Ask the background agent to poll providers again and wait up to 20 seconds before reading the file. Fails when Edith's background services do not answer |
| `--json` | flag | off | Emit JSON on stdout |

## `--json` shape

A top-level array, one object per provider that has ever been recorded, in the
fixed order `codex`, `claude`, `cursor`, then `grok`. `session` and `weekly`
are each either an object or `null`. For Claude and Codex, `session` is the
5-hour window and `weekly` is the 7-day window. Claude also has `fable`, its
separate weekly Fable window, or `null` when unavailable. For Cursor, `session` is the
Cursor Models pool (Cursor Grok and Composer) and `weekly` is the Other Models
pool. Both Cursor pools reset together at the billing cycle. For Grok, `session`
is always `null`. `weekly` is the plan allowance: one pool for Chat, Imagine,
Voice, Build and API on a paid plan, sized by the plan and reset on the
account's own clock. `period` is `weekly`, `monthly` or `daily`. `products`
splits that same pool, `tier` is the plan name when Grok has one, and
`prepaidBalance`, `onDemandUsed` and `onDemandCap` are dollar balances for
extra credits and pay as you go. Those dollar fields are omitted for the other
providers. A free plan can report a daily pool instead of a weekly one. xAI
does not publish a message or token quota, so the percent is the live number.

The human table is one row per pool. `LIMIT` names the pool, `USED` is its
percent, and `RESETS` is that pool's reset as a coarse duration, `3h 10m` or
`2d 4h`, clamped at zero. A `-` means the provider has not reported that pool.
Grok prints its allowance, and a row for each product only when more than one
product spent the pool. When extra credits or pay as you go are in use, a line
under the table names those dollar balances.

```json
[
  {
    "label": "Codex",
    "observedAt": "2026-08-08T16:39:59Z",
    "provider": "codex",
    "session": null,
    "weekly": {
      "percent": 0,
      "resetsAt": "2026-08-15T16:39:59Z",
      "resetsInSeconds": 604797.62
    }
  },
  {
    "label": "Claude",
    "observedAt": "2026-08-08T16:39:58Z",
    "provider": "claude",
    "session": {
      "percent": 30,
      "resetsAt": "2026-08-08T19:50:00Z",
      "resetsInSeconds": 11402.481
    },
    "weekly": {
      "percent": 61,
      "resetsAt": "2026-08-13T08:00:00Z",
      "resetsInSeconds": 400798.117
    }
  }
]
```

## Examples

```
ed usage limits
ed usage limits --json
ed usage limits --refresh
ed usage limits --json | jq -r '.[] | select(.provider == "claude") | .session.percent'
```

## Behaviour

Without `--refresh` the command mutates nothing and needs no app: it scans
backward through `limits-history.jsonl` and reports the newest valid line it
finds for each provider. One provider's newer rows cannot hide another
provider's history, and a partial final row is ignored.

The background agent polls Claude's usage API using the saved Claude Code login.
It reads only the `Claude Code-credentials` Keychain item, without prompting or
changing it, and requires an unexpired token with `user:profile` scope. With
`CLAUDE_CONFIG_DIR`, it reads that profile's `.credentials.json` instead and does
not fall back to another account's Keychain login. It reloads credentials on each
poll so renewals made by Claude Code are picked up.

When no valid saved login is available, Edith tries `CLAUDE_CODE_OAUTH_TOKEN`
from its process environment or your login shell, including `.zshrc`.
Inference-only tokens cannot read usage: the API returns HTTP 403, which appears
in the limits menu as a scope error. The token stays in memory and is sent only
to `api.anthropic.com`; redirects are refused. Edith does not read Chrome cookies
or Chrome Safe Storage.
Session, weekly, and Fable windows include usage from web and cloud tasks.

Claude Code's status line through [`ed usage statusline record`](https://getedith.pro/docs/cli/usage/statusline)
remains a fallback while its session window is current. Once that window expires,
a failed API refresh leaves the menu bar unavailable rather than showing an
old weekly zero. Other providers are also polled by the background agent.

`percent` is what the provider reported, stored rounded to one decimal place.
`resetsAt` is the reset time the provider gave, or `null` when it gave none, and
`resetsInSeconds` is computed at print time from your clock, so it goes negative
once the reset moment has passed.

`--refresh` asks the background agent to poll the providers again, which for
Claude includes fetching its usage API with the selected OAuth credential, and waits up
to 20 seconds for `limitsUpdated` before reading the file. Fails when Edith's background services
is not running: exit 4 with `refreshing the rate limits needs the background
agent`, hinted with `run ed agent restart or enable the background agent in
Settings`. The completion signal reports that the poll finished, including
provider failures. The CLI then reads saved observations; check the limits menu
for refresh errors. If no completion arrives within 20 seconds, the command
fails with `the background agent did not refresh the rate limits in time`.

The listener goes up before the request goes out, so an app that answers within
the same instant cannot beat it and a poll that worked is never reported as
silence. The numbers printed afterwards are read from the file rather than out
of the reply.

Even a successful refresh does not guarantee a newer `observedAt`: the app
appends a history row only when the values differ from the previous one, so
polling twice inside a quiet window leaves the timestamp where it was.

When no provider has ever been recorded the command exits 4 with `no limit
history yet`, hinted with `enable the Agent Usage extension and let Edith poll
once`. That check comes after the refresh, so a `--refresh` the app answers on a
fresh install reports the emptiness afterwards if nothing landed.

```
$ ed usage limits
PROVIDER  LIMIT                USED   RESETS  OBSERVED
Claude    5-hour limit         42.0%  2h 29m  2026-08-08T16:39:58Z
Claude    Weekly · all models  18.0%  4d 20h  2026-08-08T16:39:58Z
```

## Where to go next

- [`ed usage statusline`](https://getedith.pro/docs/cli/usage/statusline), where Claude's numbers come from
- [`ed usage`](https://getedith.pro/docs/cli/usage), the rest of this group
- [All `ed` commands](https://getedith.pro/docs/cli)

## Get Edith

Edith is a native Mac app for macOS 14 or later on Apple silicon with 100+ extensions, the `ed` command line and an MCP server. $35 once for one Mac, plus $7 for each additional Mac, with no subscription and a 30-day refund.

- [Buy Edith](https://getedith.pro/pricing): $35 once for one Mac, plus $7 for each additional Mac
- [Download Edith](https://getedith.pro/download): the installer, or Homebrew
