[BUG] Ctrl+R history search (scope: everywhere) only searches the 100 most recent prompts
Environment
- Claude Code version: 2.1.220 (latest as of filing;
claude updatereports up to date) - Platform: Linux 5.15.0-131-generic
- Terminal: tmux, fullscreen TUI mode (
"tui": "fullscreen")
Bug
The Ctrl+R prompt history search, even with scope cycled to everywhere, only searches the 100 most recent entries of ~/.claude/history.jsonl. Older prompts return "No matching prompts" even when they contain the search term verbatim.
My history.jsonl has 2,746 entries going back ~5 months; 2,646 of them are unreachable from the search UI. At heavy usage, 100 entries is only about two days of history, which makes the "everywhere" scope label misleading.
Reproduction / bisection
I verified the cap by scripting the TUI in tmux: picked prompts at known depths (distance from the end of history.jsonl), each containing a unique phrase, and searched for that phrase in the Ctrl+R dialog with scope = everywhere:
| Depth from end | Search term (verbatim in that entry) | Result |
|---|---|---|
| 99 | Was this pre-existing | found |
| 100 | need part two | found |
| 101 | Does this solve our bug | No matching prompts |
| 102 | without making changes to Bootstrap | No matching prompts |
| 103 | fix part one without commiting | No matching prompts |
| ~200 | media_url | No matching prompts |
| ~500+ | (several older unique terms) | No matching prompts |
The boundary is exactly between depth 100 and 101, so this looks like a hardcoded slice(-100)-style limit on the history entries loaded into the search, not a time-based retention effect (the entries are all still present in history.jsonl).
Related annoyance
Because matching is fuzzy, a query whose true match is outside the 100-entry window often returns unrelated recent prompts that happen to fuzzy-match (e.g. searching solve our bug returned two unrelated prompts from 22h ago while the real "Does this solve our bug?" at depth 101 was silently excluded). So the user gets confidently wrong results instead of an indication that older history wasn't searched.
Expected behavior
- "everywhere" scope should search the full prompt history (or at least a much larger window), or
- the UI should indicate that only recent history is being searched / that results were truncated.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗