Guide 9 min read

The Best Zsh History Replacement in 2026 (and How to Upgrade)

Zsh history is a flat text file with no real search, metadata, or ranking. Here's what's wrong with it, your options, and the best zsh history replacement in 2026.

Madhubalan Appachi Madhubalan Appachi ·

Zsh history works, right up until you actually rely on it. You reach for a command you ran last week, mash Ctrl-R, and either get a useless substring match or scroll forever. Then you open a second terminal and the two sessions fight over the same file. If you've hit those walls, you're not doing it wrong — you've outgrown what a flat history file can do. This guide covers what's actually wrong with Zsh history, your options, and the best Zsh history replacement for 2026.

What's wrong with built-in Zsh history

Zsh stores history as a plain text file (~/.zsh_history), one command per line. Even with the usual tuning — HISTSIZE, SAVEHIST, setopt SHARE_HISTORY, HIST_IGNORE_DUPS — you're still limited by the format itself:

  • No real search. Ctrl-R is a linear substring match. There's no fuzzy matching, no ranking by how often you actually use a command, and no way to filter.
  • No metadata. The file barely knows more than the command string. It doesn't reliably record which directory you were in, whether the command succeeded, or which session ran it.
  • Concurrent sessions clobber each other. Multiple terminals writing the same file leads to interleaving, lost commands, and the classic "where did that command go?" moment.
  • It silently forgets. Once you hit SAVEHIST, old commands roll off. The history you most want six months later is the first to go.
  • It has no idea about AI agents. Commands run by Claude Code or Cursor usually never touch your history file at all.

What a "replacement" should actually give you

The fix isn't more setopt lines — it's moving history into a real datastore. A good Zsh history replacement should give you:

  • Fast, fuzzy, filterable search (by directory, time, exit code, session).
  • Structured metadata on every command, so search and stats are even possible.
  • Frecency-ranked recall, so the commands you use most surface first.
  • Durable storage that doesn't silently truncate or get clobbered by parallel shells.
  • Negligible overhead at the prompt — you should never feel it.

Your options in 2026

Three categories of tools fix different parts of the problem:

Tool What it is Best for
fzfA fuzzy finder bound to Ctrl-RA quick, zero-lock-in search upgrade
McFlyNeural-ranked Ctrl-R replacementSmarter search, nothing else
AtuinSQLite history with cloud syncCross-machine sync, Fish/Nu users
SuvaduLocal-first history + AI agent trackingA full history workspace, AI-agent visibility

If all you want is a better Ctrl-R, fzf or McFly are the smallest step. If you want cross-machine cloud sync and you're on Fish or Nushell, Atuin is the natural pick. For a full local-first replacement that also understands AI coding agents, read on.

The recommendation: Suvadu

Suvadu replaces ~/.zsh_history with a local SQLite database and rebuilds the experience around it. Every command is recorded with its directory, exit code, timestamp, session, and executor — in under 2 milliseconds, using WAL mode so parallel shells don't clobber each other.

On top of that database you get a full-screen search TUI with a filter panel, stats and a heatmap, frecency-ranked arrow-key history, bookmarks and notes, and risk assessment for dangerous commands. It also tracks what your AI agents run and exposes your history to them via a built-in MCP server — neither of which a text file could ever do. Everything stays 100% local.

Upgrade in one line

curl -fsSL https://downloads.appachi.tech/suvadu/install.sh | sh

It hooks into Zsh and starts recording immediately. To keep your existing history, import it:

suv import --from zsh-history ~/.zsh_history

Nothing is destroyed — your old ~/.zsh_history stays exactly where it is, and Suvadu reads from its own database going forward. See installation and import / export for details.

The bottom line

Built-in Zsh history is fine for the last ten commands and frustrating for everything beyond that. If you live in the terminal — and especially if AI agents are now running commands in it too — moving to a database-backed history is the upgrade that pays off every single day.

Install Suvadu →  ·  Compare the top shell history tools →

Madhubalan Appachi
Madhubalan Appachi

Builder of Suvadu. Writes Rust, thinks about shell history more than most people, and believes developer tools should be local-first.