21-Day Challenge
Bonus02

Bonus 2 — The context window — why Claude goes weird after a long session and exactly how to fix it

Claude Code has a memory limit per session. When it fills up — Claude starts making strange decisions. Today you learn to spot the warning signs and fix it in seconds before it costs you hours.


Simple explanation

Have you ever had a long Claude Code session where — near the end — it started doing strange things? It forgot rules you set earlier. It contradicted something it built an hour ago. It started making decisions that made no sense. You thought Claude Code was broken. Or that you did something wrong. Neither. Claude Code was running out of memory. --- The glass of water. Imagine Claude Code's memory as a glass of water. Every message you send fills the glass a little. Every file it reads fills the glass a little more. Every result it gives back fills it further. When the glass is half full — Claude Code works perfectly. When the glass is three quarters full — it starts to get a bit slower and less precise. When the glass is nearly full — it starts forgetting earlier decisions and making mistakes. When the glass overflows — responses become unpredictable and unreliable. This glass is called the context window. --- The exact warning levels — in plain English: 0% to 50% full — green zone. Work freely. Everything is working perfectly. 50% to 70% full — yellow zone. Pay attention. Sessions are getting long. Consider wrapping up soon. 70% to 90% full — orange zone. Stop adding new things. Type /compact right now. 90% to 100% full — red zone. Stop everything. Type /clear and start a fresh session immediately. --- How to check how full your glass is. Claude Code shows a token counter at the bottom of the session screen. Tokens are just the unit of measurement for context. Think of them like millilitres in the glass. You do not need to understand what a token is — just watch the number go up. You can also ask Claude Code directly: "How full is your context window right now? Give me a percentage." It will tell you honestly. --- The two fixes — /compact and /clear. Fix 1 — /compact (use at 70%) This squeezes the conversation down to just the important parts. Like summarising a long meeting into three bullet points. Claude Code keeps the key decisions and forgets the small talk. Be specific when you use it: Wrong way: /compact Right way: /compact — keep the colour codes, the file names we changed, and the last error we fixed Telling it what to remember makes the summary 10x more useful. Fix 2 — /clear (use at 90%+) This empties the glass completely. Fresh start. Zero memory of the current session. This sounds scary. It is not — because your CLAUDE.md file still has all your project rules. Claude Code reads that fresh every new session. Your preferences and rules are never lost. This is why building a good CLAUDE.md on Days 8 and 9 was so important. Your CLAUDE.md is your permanent memory. The context window is just today's working memory. --- The simple daily rule: One task. One session. One /compact if the session runs long. Do not try to build your entire website in one 4-hour session. Break it into daily tasks. Short sessions. Fresh contexts. Better results every time.


What to do

Open a Claude Code session. Ask Claude Code what percentage full the context window currently is: "How full is your context window right now? Give me a percentage." Make 10 prompts — asking Claude to make small changes each time. Check the percentage again. Use /compact with specific instructions about what to remember: "/compact — keep the colour codes, the file names I changed, and the current goal." Check the percentage one more time after /compact. Notice how much it dropped.


Copy-paste prompt

How full is your context window right now? Give me a percentage and tell me which zone I am in — green, yellow, orange, or red. Tell me in plain English what I should do next.


Course note

Your CLAUDE.md file is your permanent memory. The context window is just today's working memory. Keeping sessions short and using /compact at 70% keeps Claude Code working at its best.

Key takeaway

You now understand why sessions go wrong — and you can fix it in seconds. Check the context level regularly. Use /compact at 70% with specific instructions. Use /clear at 90% and start fresh. Your CLAUDE.md always comes with you.

Start here

Start the free 5-day challenge

Next step

Join the AI course waitlist

Resource

Get the free prompt pack

Was this helpful?