What this thread does
Point statusLine at a command that prints rate_limits.five_hour.used_percentage and context_window.used_percentage, and when a limit does hit, read the exact message below and run /usage (checked 2026-10-31, Claude Code docs; untested here). As of October 2026. Not for: prompt cache expiry countdown, ccusage cost reports, OpenTelemetry metrics.
Diagnostic: You've hit your session limit
Exact messages from the error reference (Anthropic):
You've hit your session limit · resets 3:45pmYou've hit your weekly limit · resets Mon 12:00amYou've hit your Opus limit · resets 3:45pmYou've hit your Sonnet limit · resets 3:45pm
Session and weekly limits are shared across all models, so /model does not restore access. The Opus and Sonnet limits cover that model family only: /model to a model outside it keeps you working, and the next request re-reads the whole conversation without cache hits. Options: wait for the reset time; /usage to see plan limits and reset times; /usage-credits to buy extra usage (Pro, Max, Ultra) or request it from an admin (Team, Enterprise); in an interactive claude.ai session turn on Continue automatically at usage limit in /config to wait and resume after the reset.
A /usage note such as rate limited until 3:14am only means Claude Code cannot fetch your plan limits until then, not that your work is limited; press r after that time. On Team and Enterprise the allowance is a per-seat rolling five-hour and weekly window shared with Claude chat and Cowork (Manage costs); the docs do not say this for Pro or Max. No user reports of these message variants beyond the docs.
The problem
You only find out the context is nearly full when auto-compact kicks in, and you only learn about your usage limit when you hit it. You want both on screen at all times.
What the sources show
- Official. The status line docs (checked 2026-10-31): set
statusLinein settings to a command; Claude Code pipes JSON session data into it and prints whatever it outputs. Fields includemodel.display_name,context_window.used_percentage,context_window.context_window_size,cost.total_cost_usd,workspace.*,effort.level, andrate_limits.five_hour.used_percentage/seven_day.used_percentagewithresets_at. It runs locally and costs no tokens. - Demand. My minimal statusline config (u/xleddyl, 27 Feb 2026): model, folder and branch, 5h and 7d usage with time to reset, and context use, built from two shell scripts with curl and jq. Back then the usage numbers came from hooks calling an API; the documented
rate_limitsfield now gives them directly. A later post called it underrated for catching runaway usage early. - Ready-made. sirmalloc/ccstatusline and Owloops/claude-powerline (MIT) are the widely used community options; both install through npm/npx. Read the code first, since a status line runs as a shell command on every update.
How to apply it
1. Easiest: in Claude Code type /statusline show model, context percentage as a bar, 5h and 7d usage with reset time, git branch. It writes a script into ~/.claude/ and updates your settings. 2. Manual minimum, in ~/.claude/settings.json:
{ "statusLine": { "type": "command", "command": "~/.claude/statusline.sh" } }
The script reads stdin with jq, for example .context_window.used_percentage // 0 and .rate_limits.five_hour.used_percentage // empty. Make it executable. 3. Add "refreshInterval": 5 if you show clocks or reset countdowns, because updates are event-driven and go quiet when the session is idle. 4. Remove it by asking /statusline to delete it, or by deleting the statusLine key.
Mistakes to check
- No rate limits shown. Per the docs,
rate_limitsappears only for claude.ai Pro, Max and Ultra (or behind a gateway with a spend limit) and only after the first API response; each window can be absent. Use//fallbacks in jq so the line does not print "null". - Lag in large repos. The script runs often;
git statuson every update slows it. The docs show caching git output per session for about 5 seconds. - Trusting
cost.total_cost_usdas your bill. It is a client-side estimate at list price. - Lost keyboard hints: a custom status line hides some footer hints such as "? for shortcuts" and "hold space to speak".
Limits
Untested. Field names are from the docs as checked 2026-10-31. The Reddit posts and their counts could not be re-checked, and what ccstatusline and claude-powerline do internally is not reviewed.
Started from a post by @xleddyl, packaged by the editor. Original post