Monitor cost & rate limits
Claude Code gives you built-in visibility into how much you're using and how close you are to a limit. Knowing where to look turns a surprise lockout into a quick adjustment.
/usage — your plan windows
Run /usage to see your session token use plus plan usage bars:
- A 5-hour window (the rolling session limit).
- A weekly window.
/usage also attributes usage to what's consuming it — skills, subagents, and MCP servers — so you can see what's expensive. Press d and w to switch between the 5-hour and weekly views.
When you're near a limit, /usage shows the time until your window resets, which is the number you actually plan around.
/context — context-window usage
Run /context to see how full the current conversation's context window is. A bloated context slows responses and costs more tokens per turn. When it's getting full, run /clear to start fresh and free it up.
/cost and the billing caveat
/cost prints dollar figures for the session.
WARNING
On Max and Team plans, the dollar figures from /cost do not reflect actual billing — those plans are subscription-based, not pay-per-token. Don't treat /cost as your bill. Watch the usage bars in /usage instead — they're what govern access.
A live status line
Instead of running /usage repeatedly, keep a status line pinned to the bottom of the prompt that always shows your model, context usage, your 5-hour and weekly limits (with bars and time-to-reset), the git branch, session time, and free disk:
🤖 Opus 4.8 🧠 [███░░░░] 48%
🟢 5h [███░░░░] 32% ⟳ 3h 3m 📅 7d [███░░░░] 31% ⟳ 4d 10h
🌿 main +19 -8 ⏱ 4h 27m 💾 19.9G/48.0GThe one-command setup installs this for you — via ccstatusline — and wires it into ~/.claude/settings.json. To set it up by hand, or to use the no-Node statusline.sh alternative (just bash + jq + git), see the status-line assets.
TIP
A status line that shows remaining context and time-to-reset is the cheapest insurance against an unexpected limit mid-task. It's the whole point of this guide's setup — you never have to wonder how much plan you've got left.
Enterprise & Team accounts
The 5-hour / weekly usage % widgets read the five_hour / seven_day buckets from Anthropic's usage API. Enterprise and Team seats return those buckets as null, so the usage widgets render [Timeout] — a back-off label, not a real network timeout (the API answers 200 in under half a second). Those plans bill against a monthly pay-as-you-go bucket instead.
The setup handles this automatically: setup.sh installs a launcher (profile-switch.sh) that detects your account's subscriptionType and, on enterprise/team seats whose payload has no usable buckets, swaps to an enterprise profile showing the 5-hour reset timer plus your monthly credit remaining — no [Timeout]. Consumer (Pro/Max) accounts keep the usage bars, and so do enterprise/team seats whose payload delivers real five_hour/seven_day buckets. Run ./setup.sh --check to see which profile is active. Details: status-line assets.
Sessions on a non-Anthropic endpoint
/usage, /cost, and the usage bars on this page are backed by Anthropic's usage API, so none of them apply to a session running against a custom ANTHROPIC_BASE_URL. (/context still renders, but on a custom endpoint the window size it measures against is the client's assumption, not your provider's real limit.) Worse, the usage widgets don't blank out there: they fall back to your Anthropic quota and render it beside the other provider's model. setup.sh installs a third profile that carries no usage widgets for exactly that reason. See Run against a non-Anthropic endpoint.
What to do when you hit a limit
When you're throttled, you have several quick levers:
| Lever | Action |
|---|---|
| See the reset | /usage shows the time until your window resets. |
| Switch model | Drop to Sonnet or Haiku for cheaper, faster turns. |
| Lower effort | Reduce reasoning depth with /effort. |
| Free context | Run /clear to drop accumulated context. |
The fastest recovery is usually a combination: /clear to reset context, then switch to a lighter model for routine work and save the heavy model for the hard parts.
NOTE
Hitting limits often means the wrong model is doing routine work, or context is bloated. Both are fixable habits, not hard walls.
Go deeper
For strategies that keep you under the limits in the first place — model selection, scoping prompts, and context hygiene — see Cost optimization.
Related
- One-command setup writes the
~/.claude/settings.jsonyou'll extend with astatusLine. - Terminal & Ghostty setup for the environment around all this.