🐢 and 🐇 in My Claude Code Status Line: Now Watching Fable A developer extended their Claude Code status line to track per-model weekly quota buckets after discovering that the tool's built-in 7-day indicator only reflects the all-models limit, allowing Fable usage to hit 100% while the display showed 47%. The updated setup uses two scripts — statusline.sh and a new usage-fetch.sh — that poll Anthropic's undocumented OAuth usage endpoint every five minutes and cache per-model percentages for display, after the developer incurred roughly $200 in extra usage charges. My Claude Code status line races a tortoise against a hare to show whether I'm burning quota faster than a steady pace. Last time https://dev.to/suruseas/and-in-my-claude-code-status-line-now-watching-the-week-1m1e I switched the main bar to the 7-day window. I'd kept Fable away from long-running agents — it goes through tokens fast. Then Fable 5.1 landed. The announcement https://www.anthropic.com/claude-fable-and-mythos-5-1 said it's "more comfortable with long, unattended work than Fable 5," and estimated it would cost about 25% less than Fable 5 for typical workloads — up to about 45% less for highly agentic work. I wanted to see how it would hold up, so I left agents running on it. The status line said the week was fine, and I found out afterwards that I'd gone through Fable's own weekly limit and into extra usage — about $200 of it. I hadn't known that Fable's weekly limit could also be extended with extra usage. The status line wasn't wrong. It was watching the wrong bucket. Besides the all-models 7-day window, there are per-model weekly limits. /usage shows them, but the status line payload doesn't carry them: rate limits.seven day is the all-models bucket, even while you're on Fable. So 7d:47% can look perfectly relaxed while Fable is at 100%. Now the line looks like this: Opus 5 ·········🐇🐢········· 7d all :47%@9/16 | ·🐇·🐢······ 5h:15%@14:50 | Fable 7d:87% ⚠️ 7d all — renamed from 7d , so it's obvious it's not model-specific. Fable 7d:87% ⚠️ — the per-model weekly bucket. Which per-model buckets get shown: Fable 7d:… . ⚠️ on a per-model segment uses the same tortoise rule as the bars: usage percentage elapsed fraction of the window. Unlike the bars, it's suppressed below 25%, so a fresh window doesn't flag on the first few messages. 📦 The full code is in this gist https://gist.github.com/suruseas/49ba6edfb2b8daf94cde32fd2a6b59c0 — both scripts, the settings snippet, and a README. The sections below walk through it. The per-model numbers come from https://api.anthropic.com/api/oauth/usage — the endpoint /usage reads — authenticated with the Claude Code OAuth token. It's undocumented, so use this at your own risk. More on that at the end. This version is two scripts instead of one. Both live in ~/.claude/ : ~/.claude/ ├── settings.json statusLine points at statusline.sh only ├── statusline.sh updated — draws the line, starts usage-fetch.sh ├── usage-fetch.sh new — calls the usage endpoint, writes the cache └── usage-cache.json written by usage-fetch.sh, read by statusline.sh settings.json only knows about statusline.sh . You never run usage-fetch.sh yourself — statusline.sh starts it in the background at most once every 5 minutes, and reads whatever it last cached: on every render : Claude Code → statusline.sh → reads usage-cache.json → prints the line every 5 minutes : statusline.sh → starts usage-fetch.sh in the background in background : usage-fetch.sh → calls the usage endpoint → writes usage-cache.json The relevant part of the response: { "limits": { "kind": "weekly scoped", "scope": { "model": { "display name": "Fable" } }, "percent": 0.87, "resets at": "2026-09-16T09:00:00.126747+00:00" } } The script keeps only the per-model weekly buckets and caches them: {"fetched at":1789266899,"buckets": {"name":"Fable","pct":87,"resets at":1789549199} } bash /bin/bash Fetch per-model weekly quota buckets and cache them for statusline.sh. set -u CACHE=~/.claude/usage-cache.json LOCK=~/.claude/.usage-fetch.lock ATTEMPT=~/.claude/.usage-fetch-attempt Single flight. A lock older than 2min is stale killed mid-fetch . if -d "$LOCK" ; then -n "$ find "$LOCK" -maxdepth 0 -mmin +2 2 /dev/null " && rmdir "$LOCK" 2 /dev/null fi mkdir "$LOCK" 2 /dev/null || exit 0 trap 'rmdir "$LOCK" 2 /dev/null' EXIT Record the attempt first, so a failing fetch backs off like a successful one instead of re-firing on every render. date +%s "$ATTEMPT" OAuth token: keychain on macOS, credentials file elsewhere. Never written out. TOKEN=$ security find-generic-password -s "Claude Code-credentials" -w 2 /dev/null \ | jq -r '.claudeAiOauth.accessToken // .accessToken // .access token // empty' 2 /dev/null -n "${TOKEN:-}" || TOKEN=$ jq -r '.claudeAiOauth.accessToken // .accessToken // .access token // empty' \ ~/.claude/.credentials.json 2 /dev/null -n "${TOKEN:-}" || exit 0 RESP=$ curl -sS --max-time 8 https://api.anthropic.com/api/oauth/usage \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -H "anthropic-beta: oauth-2025-04-20" 2 /dev/null unset TOKEN -n "$RESP" || exit 0 Keep only the weekly per-model windows. percent comes back as a 0-1 fraction, but tolerate a real percentage in case that ever changes. OUT=$ printf '%s' "$RESP" | jq -c --argjson now "$ date +%s " ' resets at arrives as "2026-09-16T09:00:00.126747+00:00" - fractional seconds and an offset, neither of which jq fromdate accepts. def iso2epoch: if type = "string" then null else capture "^ ?