In the last lesson you learned to see how full the is. Now — what to do about it. There are two tools, and mixing them up is a mistake.
/compact — squeeze and carry on
/compact
Claude Code replaces the whole conversation with a short summary: what the task is, what you have found out, what has been done. The window frees up, and the work continues from the same spot.
The key move is to say what matters:
/compact keep what we found out about the link checker
Without a hint, Claude decides for itself what goes into the summary, and may throw out a detail you will need ten minutes later. With a hint, you control the notes.
After compacting, type /context: the “messages” share drops noticeably and there is more free room. Right after a couple of questions the difference is small — compacting pays off when the conversation really is long.
/clear — a clean slate
/clear
The conversation starts over with an empty context. The previous one does not disappear: you can return to it with /resume — more on that in lesson 0.4.
How to choose
Ask yourself one question: is this still the same task?
| Situation | What to do |
|---|---|
| Same feature, window nearly full | /compact with a hint about what to keep |
| Finished one task, starting another | /clear |
| The conversation drifted and got tangled | /clear and a short, clear request from scratch |
| You need to get back to yesterday’s work | neither — /resume |
A common beginner mistake is dragging one endless session through the whole day. The pro habit is the opposite: one task, one session, and /clear between tasks.
Quick check
You fixed a bug in the payment flow and now want to work on the layout of the About page. What do you do?
Careful
Compacting is retelling, and retelling loses detail. If the conversation contained a precise agreement — a function name, an API response format, “do not touch this file” — either name it in the /compact hint or write it into CLAUDE.md, where it survives any cleanup.