feat(cli): /search greps the current session for a substring#212
Merged
emal-avala merged 1 commit intomainfrom Apr 23, 2026
Merged
feat(cli): /search greps the current session for a substring#212emal-avala merged 1 commit intomainfrom
emal-avala merged 1 commit intomainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Case-insensitive substring match across every message in the current session — text blocks, tool-result bodies, tool_use names + JSON args, and thinking blocks. Returns numbered rows with a role tag (user/asst/tool/sys) and a ~80-char context snippet around the first hit per message. /search error /search "fn main" /search Bash ls Caps at 20 hits to avoid flooding the scrollback. Character- boundary-aware snippet slicing so multi-byte content (emoji, CJK) doesn't panic on mid-glyph cuts.
b11f6f7 to
69d1174
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds `/search ` (alias `/find`) — case-insensitive substring match across every message in the session, with a context snippet and role tag on each hit.
```
5 [user] …what does `fn main` do in Rust?…
7 [asst] …a `fn main` is the entry point of the binary…
12 [tool] …Searched src/ for fn main and found…
3 match(es) for "fn main".
```
Searches all text-bearing content: text blocks, tool-result bodies, tool_use names + JSON args, and thinking blocks. Caps at 20 hits so a stray common word (`the`, `error`) doesn't flood the scrollback.
Why
`/scroll` has search but only while inside the viewer. `/history` only shows your prompts. Neither helps you find "where did the agent mention the error string" or "which tool call read that config file". `/search` covers that gap from the main REPL.
Test plan