9 min · +140 XP
Context, limits and money
What fills Claude's context window and how to make your plan last.
By the end of this lesson
You will be able to check what fills the context, clean it up with the right command and see how much of your plan is left.
Claude works with what is in its context window: everything it can see in the current session. The window has a limited size, and your plan has limits on how much you can use. A few habits keep both under control without making the results worse.
›What a token is
AI models read text in small pieces called tokens; a token is roughly a short word or part of a word. The size of the context and the use of your plan are both counted in tokens. You do not need to count them yourself: Claude Code shows the numbers when you ask.
What fills the context
From the first second to the end of a session
- 1Before you type anything: Claude Code's own instructions, your CLAUDE.md, auto memory, and the names of connected tools and skills.
- 2Every message you send and every answer Claude gives.
- 3Every file Claude reads and the full output of every command it runs. This is usually the largest part.
- 4Pictures and screenshots you paste.
- 5When the window is nearly full, Claude Code summarises older parts of the conversation by itself. This is called compaction.
/context
Draws a coloured grid of the context window and lists what takes the space: Claude Code's instructions, tools, Memory files (your CLAUDE.md and auto memory), messages and free space. It also suggests what to clean up.
Keeping it tidy
/clear
Starts a new conversation with an empty context. Your files stay as they are, and so does CLAUDE.md. Use it when you move to a different task; the old conversation would otherwise be sent along with every new message. The previous conversation can be reopened with /resume.
/compact focus on the delete button bug
Replaces the conversation so far with a summary and keeps working. The words after /compact tell Claude what the summary must keep. Plain /compact also works.
/btw what was the name of the settings file?
Claude answers from what is already in the session, in a small window that you close with Esc. The question and the answer are not added to the conversation. It works even while Claude is busy with the main task.
A safe practice terminal. Imagine you have spent an hour on your budget tool and want to move on. Type each command and press Enter.
1Check how full the context is: type /context
Limits and money
On a Pro or Max plan your use of Claude Code is included in the monthly price, up to limits: a session limit and a weekly limit. When you reach one, Claude Code tells you when it resets. In recent versions an open session can wait and continue the interrupted task by itself after the reset.
/usage
Shows bars for your plan limits with the time each one resets, and a breakdown of what used them, such as skills, subagents and connected tools, with suggestions. The dollar figure at the top is meant for people who pay per use through the API; on a subscription it is not a bill. /cost opens the same screen.
“In budget.html the delete button removes the wrong row. Fix it, check it with three test entries, and tell me in two sentences what was wrong.”
The file, the problem, the check and the report in one message: Claude opens only what it needs and you do not have to ask again.
Habits that make the plan last
- 1Write one complete request instead of twenty small ones. Each message sends the whole conversation again, so many small messages cost more than one clear one.
- 2Name the file and the problem: "fix the delete button in budget.html" rather than "something is broken". A vague request makes Claude open files it did not need.
- 3Type /clear when you change topic. A fresh start costs nothing.
- 4For a large change, ask for a plan first (Shift+Tab to plan mode). Redoing work in the wrong direction is the most expensive mistake.
- 5If Claude goes the wrong way, press Esc at once and correct it, instead of waiting for the end.
/model chooses which Claude model works for you, and /effort sets how long it thinks before acting. A bigger model or a higher effort level is slower and uses your limits faster; it pays off for hard problems, while a simple edit does not need it. Choose at the start of a session: switching in the middle makes the next answer slower and more expensive.
Send verbose work (test runs, log digging, documentation lookups) to a subagent: it reads in its own context window and returns only a summary, though its requests still count toward your usage. CLAUDE.md loads every session, while skills load only when used, so move long procedures into skills. Each MCP server adds its tool names and instructions to the context; CLI tools like gh add nothing until used. Claude Code caches the unchanged start of each request automatically; switching model, changing effort (on most models), connecting an MCP server and /compact rebuild the cache. On a subscription the main conversation gets a one-hour cache lifetime, so the first message after a longer break re-reads the whole context. The Prompt cache (main) line in /usage shows your hit rate.
You spent the morning fixing your budget tool. Now you want help planning a holiday. What should you do first?
Why can a one-line question late in a session that has been open all day use a noticeable part of your limit?
Facts checked against the official Claude Code docs October 24, 2026 · source

Author
Evgenii Arsentev
PhD · Chief Executive Officer, digital health