Blog · · Dimitris Kyriakakis
Claude Code usage limits: see how much you have left before you hit them
The usage limit always shows up at the worst moment, in the middle of a task, with the agent halfway through a change. Claude Code tells you when the window resets, which is useful and also too late.
If you're on a Pro or Max plan, you have 2 limits to watch: a 5-hour session window and a weekly one. Both are shared across Claude's products, so time in the Claude app counts against the same limit as your Claude Code sessions. The numbers are there to read before you hit them, in 3 places.
/usage in the session
/usage shows the session's cost, your plan's usage limits and some activity stats. /cost and /stats open the same thing, so whichever one you remember works.
It's the quickest check and it needs no setup. The catch is that you have to remember to type it, and you do that when you're already worried.
The usage page on claude.ai
Settings → Usage on claude.ai shows your 5-hour session and weekly limits for the whole account, outside any one session. That's the page to look at when you're deciding whether to start a big task now or after the reset.
Your limits in the status line
The status line is the bar under Claude Code's input, and you can make it run your own script. Claude Code passes the script the session's data as JSON, including rate_limits with the used percentage and reset time of both windows. We'll put both on the bar and the time the 5-hour window resets.
First the script, saved as ~/.claude/statusline.sh:
#!/bin/bash
input=$(cat)
five=$(echo "$input" | jq -r '.rate_limits.five_hour.used_percentage // empty')
week=$(echo "$input" | jq -r '.rate_limits.seven_day.used_percentage // empty')
reset=$(echo "$input" | jq -r '.rate_limits.five_hour.resets_at // empty')
if [ -z "$five" ]; then
echo "limits: after the first reply"
exit 0
fi
echo "5h ${five%.*}% · week ${week%.*}% · resets $(date -r "$reset" +%H:%M)"
input=$(cat)reads the JSON Claude Code sends on stdin.// emptykeepsjqquiet when a field is missing.rate_limitsonly exists for Pro and Max subscribers, and only after the first reply in a session, so the script has to cope with nothing being there.${five%.*}drops the decimals, anddate -rturns the reset time, in Unix seconds, into a clock time.
The output looks like 5h 42% · week 18% · resets 16:21. Make the script executable with chmod +x ~/.claude/statusline.sh, then point Claude Code at it in ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.sh"
}
}
jq is at /usr/bin/jq on recent macOS versions. If which jq finds nothing, brew install jq sorts it out.
💡 The status line is in view the whole session, so you see the 5-hour number climb instead of finding out when the limit hits.
More than one account, more than one agent
The status line shows the limits of the session in front of you. It doesn't show your second Claude account, your Codex limits or your Cursor plan, and it doesn't help when the session is in a tab you aren't looking at.
That's where AgentNod comes in on my Mac. Its dashboard has a Runway tile with the account that has the most room left and when its limit resets, plus the one closest to empty. Under it, every account gets bars for its limits with the time to the next reset, session and weekly for Claude and Codex, and a bar turns amber, then red, as it runs out. The same figures can sit in the menu bar.
The account limits come from OpenUsage, an open-source app, over its local API, and Codex limits also come from Codex's own log. AgentNod never reads your credentials or calls a vendor's API. Per-session tokens, context and an estimated cost come from each agent's transcript on the Mac, and the cost is at public list prices, so on a subscription read it as usage, never as a bill.
With one Claude account, the status line script above is enough, and it takes 2 minutes to set up.