Lesson 12 of 32
Course-Correcting
Esc, mid-run corrections, the rewind menu and /clear — plus the judgement call that matters most, which is when to stop correcting and start a clean session instead.
Claude will go the wrong way sometimes. That is not a defect to be engineered around; it is a normal property of working with something that acts on partial information. What separates a productive session from a frustrating one is how quickly you notice and how cleanly you respond.
The general principle is simple: correct early. Tight feedback loops beat long ones. The rest of this lesson is the specific tools, and then the judgement call that matters more than any of them.
Two ways to intervene right now
Press Esc to stop Claude immediately. The running tool call is cancelled
and Claude waits for your next instruction. Nothing is reverted, nothing is
forgotten, and the work done so far stays. It is a cheap key to press, which is
the point — press it the moment you see the wrong file being opened rather than
waiting politely for the turn to finish.
Or type the correction and press Enter without stopping anything. The running action is allowed to complete, and Claude reads your message as soon as it does, before deciding what to do next.
The choice between them is about the action currently in flight. If it is
harmless — reading a file, running a test — let it finish and steer with a
message. If it is the thing you want stopped, press Esc.
You typed: The invoice PDF is missing the tax line. Fix it.
Claude ran: Search: invoice pdf
Claude ran: Read src/pdf/invoice-template.tsx
Claude ran: Read src/pdf/renderer.ts
Claude replied: The template does not render a tax row. I'll add one and compute the tax from the line items.
You typed: Do not compute it there — tax is already on the order record as order.taxTotal. Read src/orders/types.ts.
WhyThis was typed while Claude was already editing. The edit finished, then the correction landed before the next decision. Nothing needed to be stopped, because the direction was only half wrong.
Claude ran: Read src/orders/types.ts
Claude replied: You are right, taxTotal is already on the order. I have removed the calculation and the template now reads order.taxTotal directly.
Claude ran: Run: npm test invoice
Output: PASS invoice.test.ts (8 tests)WhyOne correction, no revert, no restart. This is what course-correcting looks like when you catch it in the first thirty seconds rather than at the end of the turn.
Going back
Sometimes stopping is not enough because the damage is already on disk.
Every prompt you send creates a checkpoint: Claude Code snapshots the files
before its editing tools touch them. Press Esc twice on an empty prompt, or
run /rewind, to open the rewind menu. It lists the prompts you sent during the
session, and once you pick one you choose what to do with it:
- Restore code and conversation — go back to that point entirely.
- Restore conversation — rewind the discussion, keep the current files.
- Restore code — revert the file changes, keep the conversation.
- Summarize from here — compress everything after that point into a summary, freeing context while keeping the earlier detail.
- Summarize up to here — the reverse: compress the earlier part, keep the recent messages in full.
Those last two are unexpectedly useful. A verbose debugging stretch in the middle of an otherwise good session can be summarised away without losing the instructions you gave at the start.
Two practical notes. If double Esc clears your prompt instead of opening the
menu, that is because the input had text in it — the draft is saved, so Up
brings it back, and /rewind opens the menu either way. And checkpoints only
cover files changed by Claude's editing tools. A file moved or deleted by a
shell command was never snapshotted, so rewind will not bring it back. Keep
using git.
Checkpoints are saved with the conversation, so you can close the terminal, resume the session tomorrow and still rewind.
Just asking
The lowest-ceremony option is to say "undo that". Claude reverts its changes. For a single unwanted edit this is faster than opening a menu, and it keeps you in the conversation.
For anything larger — several turns of accumulated wrongness — use the rewind menu instead, because asking Claude to unpick a tangle it created is a task with its own failure modes.
The judgement call
Everything above is mechanics. This next part is the actual skill.
This feels wrong the first few times, because starting over looks like losing progress. It is not. What you are discarding is a record of three attempts that did not work, which is actively harmful to the fourth. What you are keeping is the thing that has value: you now know which file it actually lives in, which approach fails and why, and what the constraint is that you never wrote down.
Put all of that in the new prompt. It will be far better than your first one was, and it will be read by a model with a clean window. A fresh session with a sharp prompt almost always beats a long session carrying its own history of getting it wrong.
If you clear and then realise you needed something from the old conversation,
the rewind menu offers an entry to resume the session that was active before
/clear, so it is not a one-way door within the same run of Claude Code.
Three ways sessions go bad
The failure patterns worth being able to name, because naming one is most of recovering from it.
The kitchen sink session. You start with one task, ask something unrelated
in the middle, then return to the first task. The window is now full of material
relevant to neither. The fix is /clear between unrelated tasks — a habit worth
building before you feel the need for it.
Correcting over and over. The pattern above. Claude gets it wrong, you correct, it is still wrong, you correct again. Each correction adds a failed approach to the context. Two is the number to remember.
Infinite exploration. You ask Claude to "investigate" something without bounding it, and it reads a hundred files. The context is gone and you have a summary you could have got from ten. Scope investigations narrowly, or hand them to a subagent so the reading happens somewhere else.
All three are context problems wearing different clothes, which is why the context lesson came first.
What to take away
Correct as soon as you see it going wrong. Esc stops the current action while
keeping the work and the conversation; typing a correction without stopping lets
the current action finish and steers the next one. When changes are already on
disk, the rewind menu — double Esc on an empty prompt, or /rewind — restores
code, conversation or both, and can also summarise a chosen stretch away. For a
single bad edit, "undo that" is quicker. Above all, keep count: after two failed
corrections on the same issue, the context is the problem, and /clear plus a
prompt containing what you have learned beats a third attempt in a polluted
session.
Next: using Claude to understand a codebase you have never seen, which is one of the things it is best at and produces no diff at all.
Check yourself
5 questions · pass 4/5 to unlock Questions About an Unfamiliar Codebase
1.Claude is halfway through a command and you can already see the approach is wrong. What does pressing
Escdo?2.What is the difference between pressing
Escand typing a correction while Claude is still working?3.You press
Esctwice and your prompt draft disappears instead of the rewind menu opening. Why?4.What do checkpoints NOT cover?
5.You have corrected Claude twice on the same issue and it is still wrong. What is usually the best move?
5 left to answer