Skip to content
Mastering Claude

Home / Fundamentals and the agent loop

Fundamentals and the agent loop7 minFondation

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.

Figure 1

Esc versus Ctrl+C, three consequences compared

Interrupting during a Claude Code sessionWhat stopsWhat stays available afterwardsGesture to continue
EscThe current turn, reflection or tool callThe context of the whole conversationType the redirection directly
Ctrl+C, first pressThe operation under way, if one is runningThe context stays, only the input field clearsRetype the request
Ctrl+C, second press with nothing runningThe Claude Code session itselfNothing, the window closesRelaunch Claude Code
The figure isolates what stops and what stays available for each gesture, without repeating the text that describes them.
Calibrate it yourself

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 to remember
  • 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.
Do this now

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.

Check the source

Every datable claim in this lesson links here to the public text behind it. A source that does not open proves nothing.