Claude Code status line usage: limits while you work

Short answer: Claude Code status line usage can show your plan allowance beneath the prompt: the percentage used and reset time for each available window. Run /statusline and describe the display you want, or install the script below. Keep context usage separately labelled. Missing plan data means unavailable, not 0% used or an exhausted allowance.

Which usage number should you put on screen?

Choose the number that answers your question. A context meter tells you about the conversation; a plan meter tells you about your allowance.

Your questionRead thisSuggested label
How full is this conversation?context_window.used_percentagecontext
How much of my short window have I spent?rate_limits.five_hour.used_percentage5h used
How much of my weekly window have I spent?rate_limits.seven_day.used_percentageweek used
When does that allowance return?That window's resets_atreset

For example, an illustrative line might read context 72% | 5h used 18% | week used 64%. The largest number is the conversation meter. It would be a mistake to read it as 72% of your subscription spent.

The Session cost in /usage is another measure again. Anthropic describes it as a token-based cost estimate intended for API users. Subscribers should use the plan bars to judge their included allowance. Our guide to checking Claude Code usage explains that screen.

How do you set up Claude Code status line usage?

The quickest route is to ask Claude Code to configure it:

/statusline show each available plan usage window with percentage used and local reset date and time. Label context separately. Show unavailable when a value is missing.

Review the generated file edits. If you already have a status line you like, ask to add those fields to it rather than replacing the whole display. Keep a copy of your existing script and settings first.

For a small display you can inspect yourself, use the following alternative. It needs Python 3 on your command path and reads only the JSON supplied on standard input. It makes no network requests and reads no credentials.

Save this as ~/.claude/usage-line.py:

import json
import sys
from datetime import datetime

data = json.load(sys.stdin)
parts = []
context = (data.get("context_window") or {}).get("used_percentage")
parts.append("context unavailable" if context is None
             else f"context {context:.0f}%")

limits = data.get("rate_limits") or {}
for key, label in (("five_hour", "5h"), ("seven_day", "week")):
    window = limits.get(key) or {}
    used = window.get("used_percentage")
    if used is None:
        parts.append(f"{label} unavailable")
        continue
    text = f"{label} used {used:.0f}%"
    reset = window.get("resets_at")
    if reset is not None:
        local = datetime.fromtimestamp(reset).astimezone()
        text += f" (reset {local:%d %b %H:%M %Z})"
    parts.append(text)

print(" | ".join(parts))

Add the following property to ~/.claude/settings.json. Merge it into the existing JSON object; do not replace your other settings. Substitute your actual absolute path for /Users/YOURNAME:

{
  "statusLine": {
    "type": "command",
    "command": "python3 /Users/YOURNAME/.claude/usage-line.py"
  }
}

The interpreter runs the file, so this version does not need chmod +x. For a path containing spaces, quote the script path inside the JSON command string. This example targets macOS and Linux; Windows users should adapt the interpreter and path to their installation.

How can you test it without spending allowance?

Pipe sample JSON into the script from your terminal:

printf '%s\n' '{"context_window":{"used_percentage":72},"rate_limits":{"five_hour":{"used_percentage":0},"seven_day":{"used_percentage":64}}}' | python3 ~/.claude/usage-line.py

Expected output:

context 72% | 5h used 0% | week used 64%

Then try missing data:

printf '%s\n' '{}' | python3 ~/.claude/usage-line.py

That should print context unavailable | 5h unavailable | week unavailable. The distinction matters: a real zero survives the first test, while an absent value stays absent in the second. Neither test calls Claude or uses your subscription.

To test reset formatting, add a resets_at Unix timestamp in seconds to either sample window. The script prints a local date, time and timezone, so a weekly reset cannot be mistaken for a reset later today.

Why are the plan limits blank or unavailable?

Check when and how you signed in before changing the script. Anthropic documents subscription rate-limit fields for Pro, Max and Ultra after the session's first API response. Individual windows can be absent, and a window disappears when its reset timestamp passes. An absent 5-hour field alone cannot tell you whether you have hit a limit.

If the sample works but the live display does not, check the configured path, your Python command and any project settings overriding your user settings. Use /usage to check the account's bars directly. For the schedules themselves, see when Claude Code limits reset.

FAQ

Will a status line give me more usage?

No. It helps you decide when to start a task or save allowance. Changing the display does not refill a weekly limit.

Is a percentage a forecast of when I will run out?

No. A percentage and reset time are observations, not a prediction of future work. If you want a forecast outside the terminal too, Leeway shows usage and an estimated run-out time at your current pace in your Mac's menu bar.

Should I paste an API key into the script?

No. This script has no key setting. It formats supplied data; adding a credential would not make a missing subscription window appear.

Sources