Skip to content
Go back

How to edit your previous prompt in Claude Code

Updated:  at  09:00 AM

Updated February 2026. The original post only covered the double-Escape shortcut. Turns out there’s a full rewind system under the hood, plus a few other navigation shortcuts I missed the first time around. Rewritten to cover all of it.

You know that feeling when you send a prompt and immediately realize you forgot something? Or Claude goes off in a direction you didn’t want, and now you’re three messages deep trying to course correct?

Every correction message you send eats context. Three “actually, what I meant was…” messages later, you’ve burned through tokens and your conversation is a mess of half-instructions. I did this for months before discovering there’s a better way.

Table of contents

Open Table of contents

The double-Escape rewind menu

Double-tap Escape (or type /rewind) and Claude Code opens a rewind menu.1 You pick any previous point in your conversation and choose what to restore:

That last option is one I slept on for a while. If you’re deep in a session and running low on context but don’t want to lose your progress, summarizing from a midpoint is way better than /compact (which summarizes everything) or /clear (which nukes everything).

When to use each option

Restore conversation only is what you want when Claude’s code changes were actually fine but it went down a rabbit hole explaining something you didn’t ask about. Keep the work, ditch the noise.

Restore code only is for when the conversation was productive (good reasoning, useful discoveries) but the actual edits were wrong. You want Claude to try again with everything it learned, not start from scratch.

Restore both is the nuclear option. Claude misunderstood your intent entirely, wrote the wrong code, and the whole thread is contaminated. Back to square one, rewrite your prompt, try again.

Summarize from here is the context-saving play. Your conversation is 40 messages deep and starting to get sluggish. Pick a point about halfway through, summarize everything before it, and you get a fresh context window without losing the thread. I use this more than any of the restore options, honestly.

Single Escape: the interrupt button

Single-tap Escape stops Claude mid-response while preserving your full context.2 This is the one you want when you see Claude heading the wrong direction in real time. Why let it finish writing 200 lines of code you’re going to throw away?

I use this constantly. Claude starts generating a React component when I wanted vanilla JS? Escape. It’s rewriting a function I told it not to touch? Escape. Then I just add more context and send again.

The key difference: single Escape stops the current response. Double Escape rewinds to a previous point. One is a brake, the other is reverse.

Other ways to go back

A few more navigation shortcuts that are easy to miss:

Up arrow cycles through your previous prompts. Same as bash history. If you sent a prompt three messages ago and want to send something similar, just hit Up until you find it, edit, and send. I rediscover this one every few weeks and wonder why I keep forgetting it exists.

Ctrl+\ (backslash) is the undo action. Quick undo of the last thing without opening the full rewind menu.3

Ctrl+R does reverse search through your input history, just like in your terminal. Type a few characters and it finds matching prompts you’ve sent before. More useful than you’d expect when you’re trying to remember how you phrased something last time.

Stop sending correction messages

Here’s the actual workflow shift. Before I knew any of this, a typical session looked like:

Me: "Refactor the auth module"
Claude: *refactors everything including stuff I didn't want touched*
Me: "No, only refactor the login function"
Claude: *refactors login but uses a different pattern than I wanted*
Me: "Use the existing pattern from the signup function"
Claude: *finally gets it right*

Three messages to get one thing done. That’s three rounds of context burned on corrections.

Now it looks like:

Me: "Refactor the auth module"
Claude: *refactors everything*
Me: *Esc+Esc, restore both, back to before the refactor*
Me: "Refactor only the login function using the same pattern as signup"
Claude: *gets it right the first time*

One rewind, one clean prompt. The context is tight and Claude has the full picture from the start instead of trying to parse three conflicting instructions.

It sounds like a small thing. But across a full day of coding, the difference in context quality (and my sanity) is significant. Your conversation stays clean, Claude stays focused, and you spend less time managing the AI and more time shipping code.


Want more Claude Code shortcuts? I wrote about the thinking trigger words that control how hard Claude reasons through problems, and there’s a full breakdown of background tasks, MCPs, and my updated workflow.

Footnotes

  1. Interactive Mode - Claude Code Docs

  2. Claude Code Best Practices - Anthropic

  3. Keyboard Shortcuts - Claude Code Docs

New posts, shipping stories, and nerdy links straight to your inbox.

Real insights. Zero filler.



Previous Post
Line breaks in markdown (because sometimes you need just one)
Next Post
Claude Code's hidden conversation history (and how to actually use it)