Guide 9 min read

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

Zsh history is a text-file system with limited interactive search and structured context. Here are the options for improving it in 2026.

Madhubalan Appachi Madhubalan Appachi · Published · Updated

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 in a text file such as ~/.zsh_history. Options including EXTENDED_HISTORY, SHARE_HISTORY, and HIST_IGNORE_DUPS add timestamps, duration, multi-session sharing, and duplicate handling, but the format still lacks much of the structured context a dedicated history database can record:

  • No real search. Ctrl-R is a linear, one-match-at-a-time reverse scan. There's no ranking by how often you actually use a command, no word-order awareness, 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.
  • Multi-session behavior takes configuration. Zsh can share or append history between terminals, but the result depends on options such as SHARE_HISTORY and INC_APPEND_HISTORY.
  • 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, filterable search (by directory, time, exit code, session) with match-quality ranking.
  • Structured metadata on every command, so search and stats are even possible.
  • Recency-first arrow-key recall with prefix and current-directory context.
  • 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 records new commands into a local SQLite database without deleting ~/.zsh_history. Each captured command includes its directory, exit code, timestamp, session, and executor, using WAL mode for concurrent shell access.

On top of that database you get a full-screen search TUI with literal word/substring matching and a filter panel, stats and a heatmap, recency-first arrow-key history, bookmarks and notes, and rule-based risk assessment. Suvadu stores the database locally. If you enable its MCP server, a connected AI client receives the history it requests and may send that data to its provider under the client's settings.

Install, enable the hook, and verify it

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

The installer places the binary and prints setup instructions; it does not edit or reload your shell configuration. Enable the Zsh hook, reload the shell, then record and search for a harmless command:

echo 'eval "$(suv init zsh)"' >> ~/.zshrc
source ~/.zshrc
pwd
suv search --query pwd

To keep your existing Zsh 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.