Claude and Claude Code limits explained

How Claude and Claude Code limits work, from the 5-hour session window and weekly limit to API rate limits, plus simple ways to use fewer tokens.

· 5 min read

Claude limits run out at the worst possible moment: halfway through a big task, Claude Code says the session is used up and asks you to wait. Most of the time the cause is not the amount of work but the way the conversation with the model is built. A long history, unused tools and switching models midway eat the limit faster than the task itself.

This guide explains which limits exist, what uses them up, how to check what is left and which habits stretch the limit across a whole working day.

What uses up the limit

Every Claude Code request sends the model much more than your latest message. It also carries the system instructions, the CLAUDE.md file, the built-in tool definitions, the tools of connected MCP servers and the entire conversation history. The longer the session, the more tokens each next step takes.

Diagram: what goes into every Claude Code request
The conversation history grows with every step and soon takes up most of the request.

That is why the same task can take very different amounts of tokens. In a fresh session with a short CLAUDE.md it goes through easily, while in a conversation that has run for hours it uses several times more. We explained how to count tokens in the article on Claude tokens.

Two kinds of limits: plan and key

Your limits depend on how you connect. If you signed in to Claude Code with a Pro or Max plan account, you get a 5-hour session window and a weekly limit. When the window runs out, Claude Code tells you and shows when you can continue.

Diagram: plan limits and API key limits
A plan has time windows, while a key has limits on request speed.

When you work through an API key, the plan windows do not apply. Instead there are rate limits: how many requests and tokens you can send per minute. Whoever issued the key sets them.

Plan sign-inAPI key
What is limitedThe 5-hour window and the weekRequests and tokens per minute
How to check what is leftThe /usage commandResponse headers and the dashboard
What you see at the limitA session limit messageA 429 error and a wait time

Claude API rate limits are counted separately for requests per minute, input tokens per minute and output tokens per minute. The allowance refills continuously instead of resetting once a minute. One useful detail: tokens read from the cache do not count toward the input token limit.

How to check what is left

Claude Code has two helpful commands. /usage shows how much of the current plan window you have used, and /context breaks down the context window into instructions, tools, files and history. If /context shows that half the space goes to MCP servers you never use, turn them off with /mcp.

When you work through a key, the dashboard is the easiest place to watch usage. The history lists every request, its model and how many tokens came from the cache.

Request history in the dashboard with token counts, demo data
The dashboard history shows the model and token counts of every request (demo data).

How to save your limit

Most of the savings come not from trimming requests but from keeping the session tidy. These habits make the biggest difference.

  1. Start each new task with /clear. The old history is no longer needed, yet it takes space in every request.
  2. Shrink a long session with /compact. You can add a note about what to keep, for example /compact keep the list of changed files.
  3. Pick the model for the task with /model. Sonnet 5.5 or Haiku 5.5 handle simple edits and code search well, while Opus 5.5 and Fable 5.2 are best kept for hard problems.
  4. Do not switch models midway without a reason. Each model has its own cache, so after a switch the whole history is read again.
  5. Keep CLAUDE.md short, under 200 lines. Move rarely used instructions into skills, which load only when needed.
  6. Turn off MCP servers you do not need. Each connected server adds its tools and instructions to the context of every request.
  7. Hand large searches to subagents. They read files in their own window and return only the result to the main conversation.
Checklist of habits that save the Claude Code limit
A short list worth keeping in front of you during a long session.

A word about the cache. Claude Code caches the start of each request: instructions, tools and the part of the conversation that has already happened. As long as that start stays the same, reading it again uses far less of the limit.

Running /compact and switching models both reset the cache. Do these at the start of your work rather than every few minutes. Read more in the article on prompt caching.

What to do about a 429 error

A 429 error means a rate limit has been reached. The response includes a retry-after header that tells you how many seconds to wait before trying again. Claude Code and the SDKs retry such requests on their own.

FAQ

Do plan windows apply when I work through a key?

No. When Claude Code works through ANTHROPIC_BASE_URL with a key, the 5-hour window and the weekly plan limit do not apply. What remains are the rate limits set by whoever issued the key.

Does /compact help save tokens?

Yes, in a long session. After compaction every next request is shorter. The command itself also uses tokens and resets the cache, though, so there is no point in running it on a short conversation.

Why did my limit run out faster than yesterday?

The usual suspects are a long history, newly added MCP servers or a grown CLAUDE.md. Open /context and see what takes up the most space.

Where to go next

If plan limits get in the way, you can connect Claude Code through a key instead. At Hummbit the key and address appear in your dashboard right after you sign up, and the step-by-step Claude Code guide and setup guides for other apps get you connected in a couple of minutes. We explained how the key itself works in the article on the Claude API key. Fresh tips on saving tokens come out on our Telegram channel @hummbit.

Try it with your own tools

Create an account, get a key and connect Claude Code or any other app in a few minutes.

More posts

All posts