Agentcode

Claude Code usage limits: how the five-hour window and the weekly cap actually work

Aug 16, 2026 · 9 min read · By Marcus Lee, Engineering

Agent Run

Pick a task

Plan

  • planning

Files changed

Test run

0 failed

Pull request

Open

You review and merge. Agentcode never merges on its own.

Claude Code enforces two limits at once: a rolling five-hour window that refills continuously, and a weekly cap that resets on a fixed day and time your account is assigned. Both are shared with Claude on the web, on desktop, and with Cowork, so time spent in chat reduces what is left for coding. Most complaints about harsh limits are weekly-cap hits rather than five-hour hits, and the fix is usually context discipline rather than a bigger plan.

That shared pool is the part that catches people out. You are not buying a coding quota; you are buying a Claude plan, and Claude Code is one of several things that spend it. A morning summarizing documents in chat is a morning of coding allowance gone, and nothing in the interface warns you that the two are connected.

What are the Claude Code usage limits?

Anthropic runs two overlapping windows on every paid plan. The five-hour window is rolling, which means it refills continuously rather than resetting at a fixed hour, so waiting genuinely clears it. The weekly cap is the opposite: it resets at a fixed time each week that Anthropic assigns to your account, and that day and time stay the same no matter when you started working or when you subscribed.

LimitHow it resetsWhat it covers
Five-hour session windowRolling, refills continuouslyAll models, all Claude surfaces
Weekly capFixed day and time, assigned per accountAll models; Max and Team premium dashboards also show a separate Sonnet-only bar

Pro subscribers see one weekly bar covering all models. Max and Team premium seats see two, one for all models and one for Sonnet specifically. That second bar is a useful signal: if your all-models bar is full while the Sonnet bar has room, you have been defaulting to an expensive model for work that did not need it.

Does Claude Code count against your Claude usage limits?

Yes, and it draws on the same pool as everything else on your account. Anthropic documents this directly for Team and Enterprise plans, where each member's Claude Code usage comes out of a per-seat allowance shared with Claude chat and Cowork. The same is true on individual Pro and Max plans. Your activity on web, desktop, mobile and in the CLI all lands in one bucket.

There is a practical consequence worth planning around. If you give a developer a seat expecting them to spend it on code, and they also use Claude as their general assistant all day, the coding capacity you actually bought is smaller than the plan implies. Teams that hit weekly caps constantly are often not coding too much; they are doing everything else on the same seat.

Why does usage climb in a long session?

Because Claude Code sends your whole conversation with every request. Each time it uses a tool, it sends another request carrying that batch of tool results with it. A one-line question in a session that has been open all day still draws usage for the entire accumulated history. This is the single most common reason a quiet-feeling afternoon burns a surprising share of a weekly cap.

Prompt caching softens it, but caching has a lifetime, and the lifetime changes underneath you. On a subscription the cache lasts an hour. The moment you start drawing on usage credits it drops to five minutes, and on an API key or a cloud provider it is five minutes by default. So the first message after a coffee break can quietly reprocess your full context at full price. If you want the one-hour lifetime while running on usage credits, there is an environment variable for it.

Three other things keep consuming while you are not looking. A scheduled task fires on its interval even when the session is idle, sending your full context each time. A message delivered from another of your sessions arrives as a new turn, also carrying full context. And agent teams are the big one: teammates running in plan mode use roughly seven times the tokens of a standard session, because each teammate maintains its own context window and runs as a separate instance.

What actually drains a Claude Code allowance, in order

CauseWhy it costs so muchThe fix
Non-coding work on the same planChat and Cowork spend the identical allowanceSeparate accounts, or budget for it honestly
Never clearing the sessionFull history ships with every request/clear between unrelated tasks
Agent teams in plan modeAbout 7x a standard sessionSmall teams, Sonnet teammates, shut them down when done
Defaulting to the expensive modelOpus for work Sonnet handles fine/model, or set a default in /config
Cache misses after a breakFull context reprocessed at full rateKnow the one-hour and five-minute lifetimes
Extended thinking on simple tasksThinking tokens bill as output tokensLower the effort level with /effort

Run /usage to see where you stand. On a paid plan it shows your plan bars plus an attribution breakdown: how much recent usage went to skills, subagents, plugins and individual MCP servers, each as a percentage. It also raises behavior flags when something like long context or cache misses accounts for 10 percent or more of recent usage. Press d or w to switch between the last 24 hours and the last 7 days.

One caveat on that command: the figures come from local session history on that machine, so usage from your other devices and from claude.ai is not included. The bars are right, the session numbers are partial.

What happens when you hit the limit?

You get told which ceiling you hit, and the message shows when the window resets. Switching models does not rescue you, because the session and weekly windows are shared across all models. The exception is the model-specific "You've hit your Opus limit" message, where changing model does keep you working.

From there you have two options. Wait, which genuinely works for the five-hour window because it refills continuously. Or turn on usage credits and keep going past the allowance, which is available to Pro and Max subscribers directly and to Team and Enterprise members through an admin. Running /usage-credits opens the right settings page for your role, or sends a request to your admins if you do not have billing access.

How much does Claude Code cost per developer per month?

Anthropic publishes its own numbers, which is unusual and useful. Across enterprise deployments the average is around $13 per developer per active day and $150 to $250 per developer per month, with costs staying under $30 per active day for 90 percent of users.

Read those carefully, because they describe metered consumption on Enterprise or API billing. On Pro, Max or Team seats you pay the seat price and consumption inside the allowance is not billed in dollars at all. The figures are still the best available proxy for how heavy this workload is, and they are the reason a credit-metered competitor looks so different on paper: we put that comparison side by side in GitHub Copilot vs Claude Code, where a $19 Copilot Business seat includes about a day and a half of usage at Anthropic's own average rate.

How do you cap Claude Code spend for a team?

It depends on how your organization signs in, and if you mix methods each developer is metered according to the one they used.

SetupWhere you cap itPer-user reporting
Claude for Teams or EnterpriseSpend limits in admin settings; the seat allowance is the default ceilingSpend report CSV; Enterprise Analytics API on Enterprise
Claude Console (API)Workspace spend limitsConsole dashboard and the Claude Code Analytics API
Bedrock, Google Cloud, Microsoft FoundryYour cloud's own budget controlsOpenTelemetry, or an LLM gateway

On Teams and Enterprise the seat allowance already is a ceiling, which is the cleanest cost control in the category: do nothing and nobody can overspend. You only need explicit limits once you turn usage credits on, at which point you can set them per organization, per group, or per member. OpenTelemetry export works on every setup and is the only option that streams per-user token and cost metrics into your own observability stack in near real time.

Anthropic's own advice on rollout is worth repeating because it is the opposite of how most teams buy: start with a small pilot group, establish a baseline with the tracking tools, and only then go wider. If you are weighing a rollout across a whole engineering organization rather than a squad, the blocker is usually process maturity rather than tooling, and it is worth scoring how ready the organization actually is before committing to a few hundred seats. Budget more for a coding seat than a chat seat either way: one debugging session can consume more than a day of chat.

Practical habits that stop you hitting the cap

Clear between unrelated tasks. This is the highest-value habit by a distance, because stale context is charged on every subsequent message. Use /rename before clearing so you can find the session again with /resume.

Match the model to the job. Sonnet handles most coding work and costs less than Opus; keep Opus for architectural decisions and genuinely multi-step reasoning. For simple subagent tasks, specify Haiku in the subagent configuration.

Write specific prompts. "Improve this codebase" triggers broad scanning across files. "Add input validation to the login function in auth.ts" does not. And use plan mode on complex work, because approving an approach before implementation is far cheaper than paying for the wrong direction and then paying again to undo it.

Push verbose work out of your main context. Delegate test runs, documentation fetches and log processing to subagents so the noisy output stays in their context and only a summary comes back. Hooks can do the same job earlier: a hook that greps a 10,000-line log for errors turns tens of thousands of tokens into hundreds.

Is a bigger plan the answer?

Sometimes, and less often than people assume. If you are hitting the five-hour window several times a day while working normally, the plan is genuinely too small and Max 5x at $100 or Max 20x at $200 will fix it. If you are hitting the weekly cap while the five-hour window rarely troubles you, that pattern usually means long uncleared sessions, agent teams, or chat usage on the same account, and a bigger plan buys you a larger version of the same problem.

The honest framing is that Anthropic sells you time, not dollars. That is excellent when you use the tool hard, because heavy use costs the same as light use right up to the ceiling, and frustrating when you hit the ceiling, because no amount of budget makes the next hour available. Tools billed the other way, on a credit balance, trade that frustration for an invoice that grows instead. We compare both models across the field in AI coding tool pricing, and set Anthropic's windows against OpenAI's in Codex vs Claude Code usage limits. Plan-by-plan detail is on Claude Code pricing.

There is a third option that neither meter covers. If what you want is finished work rather than a session to supervise, an agent that runs on your repository and hands back a reviewable pull request does not need a five-hour window at all, because you are not sitting in the loop while it spends one. That is the shape Agentcode takes: flat billing, work arriving as pull requests on GitHub or GitLab, nothing to ration.

Try the demo

Watch the agent plan, edit, run tests, and open a pull request you review and merge.

No card to start · Review-first: the agent never merges