interactive history search

Resolved 💬 1 comment Opened Aug 23, 2025 by mkusaka Closed Apr 12, 2026

What feature would you like to see?

I would like to request an interactive history search feature for the Codex CLI, similar to the Ctrl+R functionality in bash/zsh shells. This would allow users to quickly search and reuse previous prompts.

Feature Description

Implement an interactive reverse search through prompt history:

  • Trigger: Press Ctrl+R to enter history search mode
  • Search: Type to search through previous prompts (fuzzy matching)
  • Navigate: Use Ctrl+R repeatedly to cycle through matches, Ctrl+S for forward search
  • Select: Press Enter to use the selected prompt, Escape to cancel
  • Edit: Arrow keys to exit search mode and edit the selected prompt before submitting

User Experience

  1. Entering search mode:

``
> [Ctrl+R pressed]
(reverse-i-search)
': _
```

  1. Searching:

``
(reverse-i-search)
refactor': refactor this function to use async/await
```

  1. Multiple matches: Press Ctrl+R again to cycle through older matches

Implementation Details

  • Store prompt history persistently (local file or database)
  • Implement fuzzy/substring matching algorithm
  • Display match with highlighting of matched substring
  • Support for:
  • Case-insensitive search
  • Multi-word search terms
  • Configurable history size limit
  • Optional: frecency-based sorting (frequency + recency)

Are you interested in implementing this feature?

No, but I'm happy to test and provide feedback.

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗