Guides · Updated October 22, 2026
Claude Code usage limit reached: why it happens and how to monitor it
“You’ve hit your session limit” in the middle of a task usually means one long or looping session used far more of your plan than it looked like. This guide covers which limits Claude Code has on Pro and Max, what each message means, why usage climbs faster than you expect, how to keep an eye on it while you work, and how to stop a runaway session before it eats your week.
The limits on a Claude subscription
From Anthropic’s Claude Code with Pro or Max and usage limits help articles:
- A session limit that resets every five hours.
- A weekly limit. On Max it resets at a fixed time each week assigned to your account, not seven days after you start; Settings → Usage on claude.ai shows your next reset.
- A separate weekly limit for Fable on Max plans.
- Shared across products. claude.ai, Claude Code and Claude Desktop all count against the same limits, so a long chat in the browser leaves less for the terminal.
- Usage counts against the session and weekly allowances at the same time, so one heavy burst can use up the week before the 5-hour window even resets.
Team and Enterprise seats work the same way: a per-seat allowance with a rolling five-hour window and a weekly window, shared with Claude chat and Cowork, sized by seat tier (Manage costs). On an API key there is no plan limit at all; you are billed per token, and the controls are in the spending limit guide.
Which limit did you hit?
The message tells you. From Claude Code’s error reference:
| Message | What it means | Does /model help? |
|---|---|---|
You've hit your session limit · resets 3:45pm | The 5-hour window is used up | No, it is shared across models |
You've hit your weekly limit · resets Mon 12:00am | The weekly allowance is used up | No |
You've hit your Opus limit / Sonnet limit | A limit for that model family only | Yes: switch to a model outside that family |
You've hit your monthly spend limit (and the individual, org and team variants) | You are past the plan and on usage credits, and the credits hit a spend limit | No; raise the limit or wait for the plan reset |
Server is temporarily limiting requests (not your usage limit) | A short server-side throttle, retried automatically | Not needed; it isn’t your quota |
A context or auto-compact warning is also not a usage limit: the conversation is close to the size where Claude Code summarizes older history.
Why usage climbs faster than you expect
Claude Code sends your full conversation with every request, and each tool call sends another request carrying the results. Anthropic’s cost docs list the usual reasons a session that has been open for hours draws more than your activity suggests:
- Long context. Even a one-line question in an all-day session re-reads the whole conversation (at the cached rate when the cache is warm).
- Cache misses. The first message after a break longer than the cache lifetime reprocesses your full context.
- Things that run while you aren’t typing: session-scoped scheduled tasks such as
/loop, goal check-ins, and messages from your other sessions, each sending the full context. - Subagents, workflows and agent teams. Each one makes its own requests on top of the main conversation.
- Compaction.
/compactreads the conversation it summarizes, so compacting a huge context is itself a large request./clearcosts nothing.
And the one the docs can’t list: an agent stuck retrying the same failing command. Every retry re-sends the growing context, so a loop gets more expensive with each turn.
How to monitor it while you work
/usageshows your plan usage bars with reset times, a usage-credits row if credits are on, and a breakdown of what is using your limits: shares for skills, subagents, plugins and individual MCP servers, the heaviest/looptasks, and recommendations such as trimming a largeCLAUDE.md. Pressdorwto switch between the last 24 hours and 7 days. On v2.1.305 or later,fapplies the recommendations it can. The breakdown is approximate and only covers sessions on this machine.- Warnings. Before a window runs out Claude Code warns you, for example
You've used 85% of your session limit · resets 3:45pm. - A status line. For Pro and Max, Claude Code passes a
rate_limitsobject to your status line script after the first response, withfive_hourandseven_daywindows, each carryingused_percentageandresets_at. A minimal script:
#!/bin/bash
# ~/.claude/statusline.sh (chmod +x), then in ~/.claude/settings.json:
# "statusLine": { "type": "command", "command": "~/.claude/statusline.sh" }
input=$(cat)
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')
OUT=""
[ -n "$FIVE_H" ] && OUT="5h: $(printf '%.0f' "$FIVE_H")%"
[ -n "$WEEK" ] && OUT="${OUT:+$OUT }7d: $(printf '%.0f' "$WEEK")%"
echo "${OUT:-no plan data yet}"In the Desktop app, the usage ring next to the model picker shows the same thing.
What to do when you hit it
- Wait. The message gives the reset time. Since v2.1.234, an interactive session signed in with a subscription waits in place and continues the interrupted task after the reset on its own (it re-arms at most twice in a row). Press
Escto cancel the wait, or turn off Continue automatically at usage limit in/config. - Switch models with
/model, but only for an Opus or Sonnet limit. The first request after a switch re-reads the whole conversation with no cache hits. - Turn on usage credits with
/usage-creditsto keep going at standard API rates, billed on top of your plan, until your monthly spend limit or balance runs out. Set that monthly limit if you do. The monthly API credits included with Max can’t be used for this. - Upgrade (Pro to Max 5x, or Max 5x to 20x) if you hit the limit every week doing normal work.
Before you continue, look at what the session was doing. Automatic continue means a session that was looping when it ran out will pick up the loop again after the reset, and spend the next window the same way.
Use less of your limit per task
/clearbetween unrelated tasks (use/renamefirst so you can/resumeit later).- Use Sonnet for most coding and keep Opus for hard problems; give simple subagents
model: haiku. - Lower
/effortfor routine work; thinking tokens count as output. - Disable MCP servers you aren’t using (
/mcp) and keepCLAUDE.mdshort, since it loads into every session. - Press
Escas soon as Claude heads the wrong way, instead of letting it finish.
Stop runaway sessions before they eat the week
Plan limits stop you after the usage is gone. To stop one bad session early, the check has to run on every step. Claude Code’s PreToolUse hook does that, and LoopGuard is an open-source (MIT) CLI that installs one. It reads the session transcript Claude Code already writes (subagent transcripts included), prices the tokens at API list prices, and on every tool call checks a per-session cap, a daily cap and loop heuristics. No proxy and no API key, so it works on Pro and Max.
npm i -g loopguard-cli # puts `loopguard` on your PATH loopguard init --agent claude # adds PreToolUse + Stop hooks to ~/.claude/settings.json (backed up first) loopguard config set sessionCapUsd 10 # estimated $ per session (default 25) loopguard config set dailyCapUsd 40 # estimated $ per local day, all guarded agents (default 100) loopguard report --by session # what your recent sessions would have cost at API prices
- The same tool call 5 times within 10 minutes, with no change to the files or its output in between, is denied, and a $10 jump within 5 minutes ends the session (
loop.maxRepeats,loop.spiralUsd), which is the usual shape of a session that quietly burns a 5-hour window. - At 80% of a cap Claude Code shows a warning; at the cap the next tool call is denied and the session is ended with a reason.
loopguard pause 15lifts enforcement for 15 minutes when you do want to keep going.
Be clear about what this measures. On a subscription you aren’t billed per token, and Anthropic doesn’t publish how many tokens a 5-hour window holds, so LoopGuard does not read your plan percentage. The dollar figure is an estimate at API list prices: a consistent measure of how heavy a session is, which you can calibrate against /usage after a few days (for example, if $15 of estimated spend is roughly your 5-hour window, set sessionCapUsd below that). Checks run when Claude calls a tool or finishes a turn, so a cap can be passed by up to one turn.
Related
- How to stop runaway Claude Code, Codex and Cursor agent loops
- How to track AI coding agent token costs per session
- How to set a spending limit for Claude Code
- How to limit Cursor agent usage costs
- How to cap OpenAI Codex CLI spend
- How to set a hard budget for AI coding agents in CI
- Claude Code stuck in a loop: how to break it and stop it repeating the same command
- Codex usage limit reached: 5-hour and weekly limits explained
- Cursor agent stuck in a loop: how to stop it, roll back, and keep it from repeating
- Why Claude Code uses so many tokens, and how to use fewer
- How to set a budget limit for Aider
- GitHub Copilot agent mode stuck in a loop: how to stop it and keep it from repeating
- Cline stuck in a loop: how to stop it, roll back, and cap what it spends
- Gemini CLI usage limits: daily quotas, the June 2026 change, and keeping costs in check
- Codex stuck in a loop: how to stop it, undo it, and keep it from repeating