[BUG] Arrow Down Doesn't Restore Original Prompt After Arrow Up

Status Closed — not planned
Maintainer reply None cached
Activity 8 comments · opened Oct 12, 2025 · closed Jan 11, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using command history navigation in Claude Code CLI, pressing Arrow Up replaces the current prompt with a previous command, but pressing Arrow Down does not return to the original unsent prompt. This results in loss of the user's typed text.

  • Users cannot safely explore command history without losing their current work
  • Violates standard terminal UX conventions (bash, zsh, fish all preserve current prompt)
  • Forces users to avoid Arrow Up entirely or copy text before navigating history

What Should Happen?

Expected Behavior -> Standard CLI command history behavior:

  1. User types: "my original prompt"
  2. Press Arrow Up -> Shows previous command from history
  3. Press Arrow Down -> Should restore "my original prompt"
  4. Press Arrow Down again (at newest position) → Empty prompt or stay at current

Error Messages/Logs

n/a

Steps to Reproduce

  1. Open Claude Code CLI
  2. Type any text (don't press Enter)
  3. Press Arrow Up key
  4. Press Arrow Down key
  5. Observe that original text is not restored

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

n/a

Claude Code Version

2.0.14

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

Preserve the "current unsent prompt" as the newest entry in the history stack, allowing Arrow Down to return to it before it's submitted.

View original on GitHub ↗

8 Comments

github-actions[bot] · 1 year ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/2208
  2. https://github.com/anthropics/claude-code/issues/4460
  3. https://github.com/anthropics/claude-code/issues/2807

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

elonpart2 · 1 year ago

what if i can handle this

Mando-369 · 1 year ago

The other reports seem to be on a different platform.

github-actions[bot] · 10 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

alexkli · 10 months ago

Just ran into the same. Spent like 20 minutes refining a very long initial prompt with tons of details just to loose it because I was navigating to the beginning or end of the prompt with "arrow up/down" (forgot which exactly) and pressed it once too often... Very frustrating. Feels like back in the day when IDEs/text editors did not auto-save.

alexkli · 10 months ago

Solution: hit ctrl + _ (possibly a few times) to undo changes in the prompt field.

Thanks to https://github.com/anthropics/claude-code/issues/2208#issuecomment-3295891040 !

github-actions[bot] · 9 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] · 8 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.