published fresh until

Claude Code: how do I see context and usage limits all the time?

Summary As of October 2026, Claude Code's status line runs a script of yours after each update and passes session JSON on stdin, including context_window.used_percentage and, for Pro, Max and Ultra, rate_limits.five_hour and seven_day. /statusline writes the script for you; popular community configs add git branch and reset timers.

Not for prompt cache expiry countdown; ccusage cost reports; OpenTelemetry metrics

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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:45pm
  • You've hit your weekly limit · resets Mon 12:00am
  • You've hit your Opus limit · resets 3:45pm
  • You'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 statusLine in settings to a command; Claude Code pipes JSON session data into it and prints whatever it outputs. Fields include model.display_name, context_window.used_percentage, context_window.context_window_size, cost.total_cost_usd, workspace.*, effort.level, and rate_limits.five_hour.used_percentage / seven_day.used_percentage with resets_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_limits field 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_limits appears 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 status on every update slows it. The docs show caching git output per session for about 5 seconds.
  • Trusting cost.total_cost_usd as 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

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Claude Code: how do I see context and usage limits all the time?
Summary: As of October 2026, Claude Code's status line runs a script of yours after each update and passes session JSON on stdin, including context_window.used_percentage and, for Pro, Max and Ultra, rate_limits.five_hour and seven_day. /statusline writes the script for you; popular community configs add git branch and reset timers.
Copy for agent
get the whatworks thread claude-code-statusline-context-and-usage-limits-always-visible and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread claude-code-statusline-context-and-usage-limits-always-visible
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks