Ctrl+R reverse search limited to recent ~18h window; older prompts unreachable despite 'everywhere' scope

Open 💬 1 comment Opened Jun 24, 2026 by lumina-errrrk

Summary

Ctrl+R reverse prompt-search ("Search prompts") only surfaces roughly the last ~18 hours (~150 prompts) of history, even with scope set to "everywhere". Prompts from days/weeks/months ago are unreachable, despite a complete on-disk history. This contradicts the documented behavior, and it's a change from how it used to work (older versions surfaced much older prompts).

Expected (per docs)

The interactive-mode docs state Ctrl+R searches "prompts from all previous sessions, not just the current one," with Ctrl+S cycling scope this session → this project → all projects. With scope on all-projects ("everywhere"), the full history should be searchable.

Actual

  • Scope reads "Search prompts · everywhere", yet the oldest reachable match for a common word (e.g. deploy) is only ~18h old.
  • Searching a phrase known to occur many times in older history (a frequently re-sent reminder block) returns no real match — the fuzzy matcher instead returns unrelated recent prompts (best-effort junk), indicating the target simply isn't in the searchable set.

Environment

  • Claude Code v2.1.187
  • macOS (Darwin arm64)
  • ~/.claude/history.jsonl: 26,301 entries spanning 266 days — complete and intact.
  • The legacy per-project history arrays in ~/.claude.json are now empty (history appears to have migrated to history.jsonl).

Evidence the data isn't lost

The target prompts are present in ~/.claude/history.jsonl (verified via grep/jq) with full text and timestamps; they are simply outside the reverse-search window. So this is a search-depth/window limitation, not data loss.

Repro

  1. Use Claude Code heavily for weeks (so history.jsonl accumulates thousands of entries).
  2. Ctrl+R, set scope to "everywhere" (Ctrl+S).
  3. Search for a word/phrase you know you used more than ~24h ago.
  4. Observe: only recent (~18h) prompts are searchable; older ones never appear, and the fuzzy matcher returns unrelated entries.

Question

Is the recent-window cap intended (e.g. a performance truncation to avoid scanning large history files)? If so, it contradicts the docs and should be documented and ideally made configurable (a setting to search the full history.jsonl). If not, it's a regression — Ctrl+R previously reached prompts from weeks/months ago.

Likely cause

A silent change to index/search only a recent slice of history rather than the full history.jsonl. No changelog entry across v2.1.175–v2.1.187 mentions a search-depth cap or recent-window behavior.

View original on GitHub ↗

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