# Checkpoints and Control Keys

> How to stop Claude, undo its edits and leave a session. What a checkpoint saves, and the keys that stop, rewind, exit and redraw.

**Course:** [Claude Code Basics](https://learn.benibix.com/learn/ai-claude-code)  
**Time:** 10 min

**After this lesson you can:**

- Stop Claude without losing its work
- Rewind code and chat to an earlier prompt
- Know which keys exit and which only clear

## How to stop, undo and leave

Esc stops Claude in the middle of its work, and it keeps what it has done so far. Each prompt you send makes a checkpoint, a copy of the files from before that step. Press Esc twice on an empty prompt, or run /rewind, to go back. Claude Code keeps the 100 most recent checkpoints in a session.

The rewind menu lists your past prompts. Pick one, and you can restore the code, the chat, or both. You can also sum up the chat from that point to free room. Checkpoints are saved with the session, so a session you resume tomorrow can still rewind.

A checkpoint only tracks files that Claude changed with its own edit tools. A file that only a shell command changed, such as a script that rewrote a config, is not tracked. Neither is a change you made by hand in another window. So a checkpoint is a quick undo, not a backup. Keep using git for that.

Ctrl+C also stops a running step. When nothing is running, the first press clears what you typed and a second press quits. Ctrl+D quits too, but only after a second press within 800 milliseconds. If you clear a draft by mistake, the up arrow brings it back.

Some work can keep going while you chat. Ctrl+B sends a running command or agent to the background. Inside tmux, press it twice, since tmux uses that key itself. Ctrl+X Ctrl+K stops every helper running in the background. You press it twice within 3 seconds to confirm.

A message you send while Claude works waits in a queue until Claude reaches a stopping point. Ctrl+Enter sends the queue right now, with your draft after it. In a terminal that does not pass that key through, Ctrl+X Ctrl+S does the same job.

Three keys change what you see, not what Claude does. Ctrl+O opens the transcript view, with every tool call in full. Ctrl+T shows or hides Claude's to-do checklist for the task. Ctrl+L redraws the screen when it looks broken, and keeps your chat and your draft as they were.

## The control keys at a glance

| Key | What it does | Careful |
| --- | --- | --- |
| Esc | Stops Claude mid-step, keeps the work so far | Closes a dialog instead, when one is open |
| Esc Esc | Opens the rewind menu on an empty prompt | Clears your draft first if there is text |
| Ctrl+C | Stops a running step, or clears the draft | A second press on an empty prompt quits |
| Ctrl+D | Quits after a second press within 800 ms | Deletes a letter instead when there is text |
| Ctrl+B | Sends a running command or agent to the background | Press it twice inside tmux |
| Ctrl+O | Opens the full transcript view | q, Esc or Ctrl+C goes back |

![Five prompts on a line, each with a save point. Pressing Esc twice, or typing /rewind, jumps back to an earlier one, and you pick code, chat or both. A note says changes made by shell commands are not saved.](https://learn.benibix.com/diagrams/cc-checkpoint.svg)

### Example: Lucy rewinds a bad refactor

Lucy asks Claude to split one big file into four. Ten minutes later the tests fail in 12 places, and she does not like the new layout anyway.

She presses Esc twice, picks the prompt from before the split and chooses to restore code and chat. The big file is back, and she asks for a smaller change.

**Words in this lesson:** [Esc Shortcut](https://learn.benibix.com/term/ai/esc-shortcut), [Esc Esc Shortcut](https://learn.benibix.com/term/ai/double-esc-shortcut), [Claude Code Checkpoint](https://learn.benibix.com/term/ai/claude-code-checkpoint), [Ctrl+C Shortcut](https://learn.benibix.com/term/ai/ctrl-c-shortcut), [Ctrl+D Shortcut](https://learn.benibix.com/term/ai/ctrl-d-shortcut), [Ctrl+B Shortcut](https://learn.benibix.com/term/ai/ctrl-b-shortcut), [Ctrl+X Ctrl+K Shortcut](https://learn.benibix.com/term/ai/ctrl-x-ctrl-k-shortcut), [Ctrl+Enter Shortcut](https://learn.benibix.com/term/ai/ctrl-enter-shortcut), [Ctrl+O Shortcut](https://learn.benibix.com/term/ai/ctrl-o-shortcut), [Ctrl+T Shortcut](https://learn.benibix.com/term/ai/ctrl-t-shortcut), [Ctrl+L Shortcut](https://learn.benibix.com/term/ai/ctrl-l-shortcut)

**Question:** A shell command, not Claude's edit tool, rewrote a file that Claude never touched. What does rewind do to that file?

**Answer:** Leaves it as it is, because it was not tracked. Checkpoints track files Claude changed with its own edit tools. A file only a shell command changed is not tracked, so rewind leaves it alone. Git is the way to undo that.

---

Source: https://learn.benibix.com/learn/ai-claude-code/checkpoints-and-control-keys
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
