See your Claude limits in the status line
Show your 5-hour and weekly Claude usage at the bottom of Claude Code, in red from 80%, so you never have to go and check.
From a post on XMost people find out they're out of Claude when a job stops halfway. Checking all the time doesn't work either, because nobody keeps it up. So put the number where you'll see it without looking: Claude Code's status line can show your 5-hour and weekly usage all the time, and turn red at 80%.
What you need
- Claude Code, on a Claude Pro, Max or Ultra plan. The usage numbers are only sent for Pro, Max or Ultra. On a plan with no 5-hour limit, only the week shows.
- For the file below:
jq, a small JSON tool, on macOS or Linux.
The one-line way
In Claude Code, type:
/statusline show my 5-hour and weekly usage as percentages, in red at 80% and upClaude Code writes a small script in ~/.claude/ and adds it to your settings. From then on, the line at the bottom of the screen shows both numbers.
Or set it up yourself
- Save this as
~/.claude/statusline.sh:
#!/bin/bash
# Claude Code status line: your 5-hour and weekly usage, red at 80% and up.
input=$(cat)
RED=$'\033[31m'
RESET=$'\033[0m'
show() {
# $1 = label, $2 = percentage (may be empty)
[ -z "$2" ] && return
local pct
pct=$(printf '%.0f' "$2")
if [ "$pct" -ge 80 ]; then
printf '%s%s %s%%%s' "$RED" "$1" "$pct" "$RESET"
else
printf '%s %s%%' "$1" "$pct"
fi
}
FIVE_H=$(echo "$input" | jq -r '.rate_limits.five_hour.used_percentage // empty')
WEEK=$(echo "$input" | jq -r '.rate_limits.seven_day.used_percentage // empty')
A=$(show "5h" "$FIVE_H")
B=$(show "week" "$WEEK")
if [ -n "$A" ] && [ -n "$B" ]; then
echo "$A · $B"
elif [ -n "$A$B" ]; then
echo "$A$B"
else
echo "limits appear after Claude's first reply"
fi- Make it runnable:
chmod +x ~/.claude/statusline.sh- Add this to
~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.sh"
}
}If the file already has settings, add the statusLine part next to them.
Good to know
- The numbers appear after Claude's first reply in a session. Until then the line says so.
- The 5-hour number is your rolling 5-hour window. The week is your 7-day limit. They're your plan's own limits.
- On Windows, Claude Code runs the status line through Git Bash or PowerShell. The status line docs have a PowerShell version.
- To remove it, type
/statusline remove it.
Don't go looking for the number. Make the number come to you.