Bash-style history search: prefix filtering with Up arrow and Ctrl+R cycling
Resolved 💬 2 comments Opened Feb 19, 2026 by Artemarius Closed Feb 19, 2026
Feature Request
Problem
Claude Code's terminal history search is limited compared to standard bash/readline behavior:
- Up arrow doesn't filter by prefix — In bash, typing
git comthen pressing Up shows only history entries starting withgit com(readline'shistory-search-backward). In Claude Code, Up always cycles through the entire history sequentially regardless of text on the current line.
- Ctrl+R doesn't pre-populate — When text is already typed on the line and you press Ctrl+R, the search box opens blank instead of using the current line text as the initial search query.
- Ctrl+R doesn't cycle through matches — In bash, pressing Ctrl+R repeatedly cycles through older matches. In Claude Code, this doesn't work — you get a single search result without the ability to cycle.
Expected Behavior
Match standard readline/bash history search:
- Up arrow with text: Filter history to entries starting with the current line prefix
- Ctrl+R pre-population: Use current line text as initial search query when opening reverse search
- Ctrl+R cycling: Repeated Ctrl+R presses should cycle through progressively older matches
Why This Matters
History search is a core workflow for power users who reuse and modify previous prompts. The current implementation requires manually retyping or searching from scratch each time, which adds friction to iterative workflows.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗