Cindy Zhu.
Free guides
Power-user Claude

5 Claude Code codes that rescue a messy session

Hey, it's Cindy 🌱 You commented rewind, so here are all 5 codes from the reel with exactly when to reach for each one.
btw the waitlist for AI System Club is now open! If you're keen on using AI to automate your content, video editing, job search, business or build AI agents, feel free to sign up (only if you want to hehe). Ps. the waitlist gets first dibs:)
What this gives you. You bring a Claude Code session that has drifted, filled up, or gone somewhere you did not want. These five codes recover it without closing the terminal and re-explaining your whole project from scratch. By the end you will know which one to press at which moment, and what each one cannot do.
at a glance

The rescue ladder

Each one recovers a bit more of the session than the last. Start at the top and only go further down if you need to.

1. /btw Ask a side question. The question and the answer never enter your conversation.
2. Ctrl+S Stash the half-written prompt you are about to lose. Press it again to bring it back.
3. /recap One line telling you what this session has actually been doing. For when you walk back in cold.
4. Esc Esc The rewind menu. Roll code, conversation, or both back to any earlier message.
5. /branch Try a different direction in a copy, with the original conversation still waiting for you.
When none of it is enough Git. Checkpoints are session-level recovery, not version control, and the docs say so out loud.

code 1

Ask a side question without polluting the chat

You are twenty turns into something and you need to check one small thing. Normally you type it into the chat, Claude answers, and now that detour is permanently part of the conversation Claude carries forward. /btw fixes exactly that.

  1. đŸ’Ŧ Type it with your question. /btw what was that config file called again? The answer appears in a dismissible overlay above the terminal, and the question and answer never enter the conversation history.
  2. âąī¸ Use it mid-response too. You can run /btw while Claude is still writing. The side question runs independently and does not interrupt the main turn.
  3. đŸ§ĩ Keep the thread going. A later side question sees your earlier ones. Claude Code replays the newest 20 exchanges each time you ask, and your five most recent sit dimmed above the current answer.
  4. âŒ¨ī¸ Learn the four keys. In the overlay, c copies the answer as raw Markdown, x clears the earlier exchanges, f forks the question into a background subagent with full tool access, and Esc dismisses it.
The one limit. Side questions answer only from what is already in context. Claude cannot read files, run commands or search while answering one. So /btw is for "what did we decide earlier", not "go look this up". If you need tools, press f in the overlay and it continues as a background subagent.

code 2

Stash a prompt you are about to lose

You are four lines into a careful prompt and you realise you need to check something before you send it. Deleting it hurts. Ctrl+S puts it down and picks it back up.

  1. âœ‚ī¸ Press Ctrl+S with text in the input. It stashes what you have typed and clears the prompt, so you have a clean box to work in.
  2. 🔎 Go and do the other thing. Ask your quick question, run a command, check a file. The stash survives it.
  3. â†Šī¸ Press Ctrl+S again on an empty prompt. It restores the stashed text, your cursor position, and any pasted content, exactly as you left it.
Pair it with /btw and the two become one move: stash the draft, ask the side question in the overlay, dismiss it, restore the draft. Your conversation ends up with no evidence that the detour ever happened.

code 3

Find out where you actually got to

You stepped away for an hour. You come back to a wall of terminal output and no idea which of the four things you asked for is finished. Scrolling up is the slow way. /recap is the fast one.

  1. 🧠 Type /recap. Claude Code generates a one-line summary of the session so far, on demand. Both the automatic recap and /recap are capped at 400 characters, so it stays genuinely short.
  2. 👀 Know that it also happens on its own. When you return to the terminal after stepping away, Claude Code shows a recap without being asked. It generates in the background once three minutes have passed since the last completed turn and the terminal is unfocused, so it is ready when you switch back.
  3. âš™ī¸ Turn the automatic one off if you do not want it. Open /config and turn off Session recap. The /recap command still works.
Recaps only appear once a session has at least three turns, and never twice in a row, so do not expect one on a brand new session. Session recap is on by default on every plan.

code 4

Roll the whole thing back

This is the one most people do not know exists, and it is the reason a bad turn stops being a lost afternoon. Claude Code captures the state of your code before each prompt you send that starts a turn, and keeps file snapshots for the 100 most recent checkpoints in a session.

  1. âĒ Press Esc twice on an empty prompt. The rewind menu opens and lists every prompt you sent this session. Typing /rewind does the same thing, and so do its aliases /checkpoint and /undo.
  2. âŒ¨ī¸ Make sure the input is empty first. If there is text in the prompt, a double Esc clears the text instead of opening the menu. The cleared text goes into your input history, so press Up to get it back.
  3. đŸŽ¯ Pick the message you want to go back to. Then choose your action: Restore code and conversation, Restore conversation (rewind the chat, keep your current code), Restore code (revert the files, keep the chat), Summarize from here, Summarize up to here, or Never mind.
  4. 📝 Re-send the prompt. After restoring the conversation, the original prompt from that message is put back into your input field, so you can edit it and try again with better wording.
The two summarize options are underrated. Summarize from here compresses everything after the message you picked, which is perfect for a verbose debugging detour where you want to keep your original instructions intact. Summarize up to here compresses everything before it. Both free up context without changing a single file on disk, and the original messages stay in the session transcript.

code 5

Try a different direction without losing this one

Sometimes the session is not broken, you just want to try something else and you are not confident enough to throw away what you have. That is what branching is for.

  1. đŸŒŋ Run /branch with a name. /branch new-design creates a branch of the conversation at this exact point and switches you into it.
  2. 🔖 Your original is preserved. Get back to it any time with /resume and pick it from the list.
  3. đŸĒŸ Know the two neighbours. /fork copies the conversation into a new background session and leaves you where you are. /subtask hands a side task to a forked subagent that keeps the full conversation and reports its result back into this chat.
Branching is the right tool when you want two conversations. Rewinding is the right tool when you want one clean conversation. If you find yourself rewinding and then wishing you still had the messy version, you wanted a branch.

copy this

The prompt that gets Claude back on track after a rewind

Rewinding restores your files and your conversation, but Claude can still be carrying a stale picture of what is on disk. Paste this as your first message after a restore and it re-grounds itself before touching anything.

âĒ after a rewind
We just rewound this session back to an earlier point, so ignore anything you attempted after that message, including any approach you were defending.

Before you edit anything, re-read the files you are about to change, because your memory of them is probably out of date now. Then tell me three things in three short bullets: what you believe the task is, what is genuinely already finished, and the single next change you plan to make. Wait for me to confirm before you edit a file.
copy this too

The handover prompt before you branch

A branch inherits the conversation, but you are the one who has to remember why you branched. Ask for the note first and your future self lands in the branch already oriented.

đŸŒŋ before you branch
I am about to branch this conversation to try a different approach to [describe the problem in one line].

Before I do, write me a short handover note I can read once I am in the branch. Cover the goal in one sentence, the approach we have been taking and the specific reason it is not working, the files that matter and what each one is responsible for, and the two most promising alternatives worth trying instead. Keep it under 150 words, be blunt about what failed, and do not change any files while you write it.

good to know

3 honest catches

Rewind does not undo terminal commands. Checkpointing tracks files that Claude changed with its file editing tools. Files changed by Bash commands, things like rm, mv and cp, cannot be undone through rewind. This is the single most important thing on this page: keep committing your work.
Most subagent edits are not restored either. If a background subagent made the edits, rewinding usually will not bring them back and you need git. The exception is a foreground forked skill, whose edits happen during your own turn and do rewind normally.
Snapshots do not live forever. Claude Code keeps the 100 most recent checkpoints per session and clears a session's file snapshots in its retention sweep, by default about 30 days after the session last saved one. Symlinked and hard-linked files are skipped on restore, with a "Restored the code, but skipped N files" warning.

Proof

The full Claude Code command reference
Side questions with /btw
Keyboard shortcuts, including Ctrl+S stash and restore
Session recap, automatic and on demand
Checkpointing, the rewind menu and its limitations
Branching a session

the waitlist is now open

AI System Club is launching soon

Build AI systems with me through recorded lessons you can follow at your own pace. Join the waitlist for first access and the founding price.

btw this list gets first dibs
the moment doors open :)