Press Up Arrow to Cycle Through Previous Prompts and Reuse Them
When you need to tweak a prompt and try again — maybe adjusting constraints, adding detail, or changing the scope — you don't need to retype the whole thing. Press the Up arrow to pull back your previous prompt, edit it, and send.
↑ = previous prompt
↓ = next prompt (if you've gone back)
This is the same pattern you use in your shell, and it's just as useful in Claude Code. A common workflow:
- Send a prompt that's almost right
- Press Up to get it back
- Edit one part — add a constraint, change a file path, narrow the scope
- Send again
This turns prompt writing into an iterative loop instead of a one-shot attempt. You refine the instruction until Claude does exactly what you want.
Where this really shines:
- Iterating on code generation — "write a function that..." wasn't quite right, so press Up, add "...and handle the edge case where X", and resend.
- Running the same analysis on different files — press Up, swap the file path, send. Repeat for each file.
- Adjusting constraints — your first prompt was too broad, so press Up and add "only modify src/api/, don't touch anything else."
- Retrying after an interruption — if you pressed Escape because Claude went in the wrong direction, press Up to get your original prompt back and add a redirect.
Combined with Shift+Enter for multi-line prompts, you can build up complex instructions incrementally — each iteration starting from where the last one left off.
Good prompts are rarely written perfectly the first time — use the Up arrow to iterate fast instead of starting from scratch.
via Claude Code
Log in to leave a comment.
When typing feels slow — describing a complex bug, explaining architecture, or thinking through a problem out loud — press Option+V to switch to voice input. Speak naturally and Claude Code transcribes your words into a prompt, so you can describe what you need at the speed of thought.
When Claude is heading down the wrong path — editing the wrong file, writing code you don't want, or giving a long explanation you don't need — press Escape to stop it immediately. You keep everything it did up to that point and can redirect with a new prompt.
Closed a session and realized you weren't done? Pass --continue (or -c) when launching Claude Code to pick up exactly where you left off — same context, same files, same conversation history — without re-explaining what you were working on.