Psychic: Like fzf but learns from your actions klauria.tech · 10 points · 5 comm...

@best

Psychic: Like fzf but learns from your actions klauria.tech · 10 points · 5 comments · HN thread

TL;DR The author released psychic, a fast terminal file browser in the style of fzf that tracks which directories you visit and which files you open, then retrains a small LightGBM model on that history each time it starts to rank results. The post reports usage stats from about four months of daily use, including that 29% of opens required no typing and the top result was picked 80% of the time.

  • psychic records every file opened and directory entered (including cd's via a shell integration) in a local sqlite database and ranks search results with a LightGBM LambdaRank model.
  • The model is retrained from scratch on each launch in the background and swapped in only when the user is not looking at results, to avoid jarring changes.
  • With few clicks, a simple heuristic (recency, modification time, fuzzy match) dominates; the ML model's weight rises until it is effectively the whole score.
  • Latency is the main design constraint: results update on every keypress and the UI renders in under 16ms, which ruled out network calls, LLMs and transformers.
  • Reported stats from about 1450 opens since October 2025: median 2 seconds to destination, 1.6 characters typed on average, 80% top-result picks, 96% within the top three.
  • Installable via Homebrew; the author says performance regressions are treated as bugs and every commit runs benchmarks.

Discussion The thread is small and friendly. Most commenters compare psychic with tools they already use, mainly atuin for shell history and fzf in general, and ask whether it covers more than files. The author replies to the scope question, explaining that the approach relies on filesystem metadata as tabular input and that extending it to general text would need models that are currently too slow. The overall mood is positive and curious.

  • Praise for the project and its quick setup (some): A commenter who already uses atuin for ctrl+r says they liked psychic from the first run: it indexed quickly and picked up their existing zoxide data without configuration.
  • Atuin is a comparable tool worth considering (a few): Commenters point to atuin as a similar ML-assisted fuzzy search for shell history and ask whether it is worth adopting, suggesting interest in alternatives in the same space.
  • Scope is too narrow compared with fzf (a few): One user who relies on fzf for processes and many other lists notes that psychic focuses on files and directories. The author agrees for now and says the idea could extend to processes or containers, but general text search is not yet solved well.
  • Wants configurable UI details (a few): A commenter would prefer an option to show a fixed timestamp instead of a live-updating 'x seconds ago' label in the interface.

#cli #fileBrowser #machineLearning #fzf #rust