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:

  1. Up arrow doesn't filter by prefix — In bash, typing git com then pressing Up shows only history entries starting with git com (readline's history-search-backward). In Claude Code, Up always cycles through the entire history sequentially regardless of text on the current line.
  1. 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.
  1. 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗