Home / Fundamentals and the agent loop
Interrupting and redirecting mid-task
Esc interrupts the current turn, reflection or tool call, without losing the accumulated context, whereas Ctrl+C answers a different question and, pressed a second time when nothing is running, ends the Claude Code session itself.
Two gestures interrupt Claude Code, and they do not do the same thing. Checked against the official documentation on 2 September 2026, the Esc key stops the current turn, reflection or tool call, and keeps everything already produced. Ctrl+C follows a different logic, and a second press of that same combination, when nothing is running, ends the whole session.
Esc, a pause that keeps the memory
Pressing Esc while a tool is running cuts that specific call, without erasing the context accumulated since the start of the conversation. The work already done stays available, and it is enough to type the correction right after so that the task carries on from that base rather than starting from scratch, which matters even more on a long task where several steps would already have chained together before an error was spotted. Esc also closes any dialogue open on screen: on a permission confirmation prompt, pressing Esc is equivalent to answering no, with no comment attached. A double press of Esc while the input field is empty opens a different menu, the one that reverts to an earlier checkpoint, code and conversation included.
# while a task is running
# press once: Esc
# the current turn stops, the context stays intact
# type the redirection, then Enter
Ctrl+C, two presses, two effects
Ctrl+C answers a different question: is something running right now, in the terminal itself. If an operation is under way, the first press interrupts it. If nothing is running, that first press simply clears the contents of the input field, without touching anything else. It is the second press, while nothing is running and the field is already empty, that closes the Claude Code session. Confusing the two keys therefore costs more than a moment's hesitation: Esc redirects a task that is heading the wrong way, Ctrl+C pressed twice quits the program and takes the context of that window with it.
This distinction directly extends the choice of permission mode: a mode that acts broadly makes interrupting at the right moment even more useful, since more actions will already have chained together before a correction is typed.
Esc versus Ctrl+C, three consequences compared
| Interrupting during a Claude Code session | What stops | What stays available afterwards | Gesture to continue |
|---|---|---|---|
| Esc | The current turn, reflection or tool call | The context of the whole conversation | Type the redirection directly |
| Ctrl+C, first press | The operation under way, if one is running | The context stays, only the input field clears | Retype the request |
| Ctrl+C, second press with nothing running | The Claude Code session itself | Nothing, the window closes | Relaunch Claude Code |
A developer watches Claude Code run a series of build commands on a large project. She presses the Esc key once, in the middle of a tool call. She then types a new instruction and presses Enter.
Write in one sentence what this situation establishes, and in one sentence what it does not establish.
What this establishes: This case establishes that pressing Esc interrupted the tool call under way without closing the session, since the developer was then able to type a new instruction in the same thread.
What this does not establish: It does not establish that the work Claude had already done before the interruption was lost, since the Esc mechanism is designed precisely to keep that work.
The three most common miscalibrations
- Too broad Pressing Esc systematically wipes out all the work Claude has done since the start of the session.
- Too narrow This case allows nothing to be said about the Esc key, since a single interruption is never enough to characterise a gesture.
- Off target This case shows that the series of build commands on this project took longer than the average of the projects followed in this course.
- Esc interrupts only the current turn, reflection or tool call, and keeps the context of the whole conversation.
- Ctrl+C follows a different logic: the first press interrupts an operation under way, or clears the input field if nothing is running.
- A second press of Ctrl+C, while nothing is running and the field is already empty, ends the Claude Code session.
- On an open permission prompt, Esc is equivalent to answering no with no comment attached.
- A double press of Esc with an empty input field opens the menu that reverts to an earlier checkpoint.
Launch a task in Claude Code, let it start a tool call, press Esc once, then immediately type a clarification on the same task and check that the previous context stays visible.
Every datable claim in this lesson links here to the public text behind it. A source that does not open proves nothing.