Skip to content
OriginalGuideSoftware

Atuin turns your shell history into a database worth searching

Your shell already remembers every command you typed. Atuin stores that history in a searchable database, syncs it between machines, and now keeps track of your AI agent sessions too.

A low-poly voxel diorama of a small wooden desk with an old CRT monitor and keyboard, beside a tall stack of paper cards that towers over it
The record, kept: a terminal desk beside the tall stack of history Atuin turns into a searchable database.
On this page

In brief

  • Atuin replaces the shell's flat history file with a SQLite database recording exit code, directory, host, duration, and session for every command.
  • Search filters on that context: only commands that succeeded, only ones run after a time, only ones from a directory or machine.
  • Sync is end-to-end encrypted across machines, self-hosted or via the hosted service, or skipped entirely; the key lives on your devices.
  • Threads capture AI agent sessions and resume them across machines and harnesses; a built-in MCP server lets agents search terminal history.
  • A secrets filter on by default refuses commands containing recognized credentials, and manual filters cover the rest; recognition is best-effort.

The command is in there somewhere. Three weeks ago, in a directory you no longer remember, you typed the exact incantation that moved a stubborn folder without mangling its permissions. Ctrl+R will find it eventually, if you keep tapping: the shell's history is a flat text file, and searching it means walking backwards through everything you have done since.

Atuin starts from the observation that this is a database problem wearing a text file's clothes. It replaces your shell history with a SQLite database, a small database that lives in a single file on your machine, and records far more than the command itself: the directory it ran in, how long it took, whether it worked, which machine and session it came from. That extra context is what turns a list you scroll through into something you can actually query.

The project is five years old, written in Rust, and openly developed on GitHub, where it has gathered more than 32,000 stars. It is actively maintained: version 18.25.1 shipped on November 20, 2026, the day this article was written. It works with zsh, bash, fish, nushell, xonsh, and PowerShell, and setup imports the history you already have.

Searching with the facts attached

Press Ctrl+R and Atuin opens a search pane over the database. Enter runs the selected command, Tab drops it on the command line for editing. The filters are where the database earns its keep: only commands that succeeded, only ones run after a certain time, only ones run in a particular directory or on a particular machine. The project's own example is the shape of it:

text
atuin search --exit 0 --after "yesterday 3pm" make

That returns successful make commands from after 3pm yesterday. A plain history file cannot answer that question at all, because it never recorded whether the command worked or when it ran.

The same history on every machine

Atuin can sync that database across your machines, and the sync is end-to-end encrypted: the records are encrypted on your machine before they leave it, so the server only ever stores ciphertext. Use the project's hosted service, run the sync server yourself, or skip sync and keep everything local. The project's site says more than 600 million commands have been synced through the service.

The key lives on your devices, not on the server, which is the whole point of the design, and it also means there is no password reset for it: lose the key and the synced copy is gone for good.

Threads: your agent sessions, kept

The newest part of Atuin is Threads. Atuin now captures what your AI coding agents do, prompts, tool calls, sessions, and stores them the same way it stores your commands. Start a session in Claude Code on your laptop, then resume it on a remote machine inside Codex with atuin resume. It supports Claude Code, Codex, OpenCode, Copilot, Grok, and Hermes, with Mistral Vibe support arriving in the November 20 release. A built-in MCP server lets your agents search everything that has ever happened in your terminal.

Sessions are becoming real work product, and Atuin treats one as a record with an address. They stay hidden from interactive search by default, tagged with the agent that ran them, so the everyday Ctrl+R experience stays yours.

The part that matters most: secrets stay out

A database of everything you ever typed is also a database of every credential you ever pasted. Keeping secrets out is the most considered part of the project.

By default, Atuin refuses to record commands that look like they contain credentials: AWS keys, GitHub and npm tokens, Slack webhooks, Stripe keys, and more, under a setting called secrets_filter that ships turned on. The same recognition runs over captured output and agent threads, replacing values with asterisks, and the contents of credential files, .env files and SSH keys among them, stay out of captured output and out of what agents read and write.

For the secrets it cannot recognise, there are manual controls: history_filter keeps out commands matching a pattern you write, cwd_filter keeps out everything run from a matching directory, and redact_patterns lets you define your own secret formats. A leading space keeps a single command out, the old ignorespace convention. Filters only apply going forward. Anything recorded before you added a filter has to be removed with atuin history prune, which deletes matching entries and, with sync on, propagates the deletion to your other machines.

The limit, stated in the docs themselves, is that recognising credentials is best-effort. It only knows common formats. A plain password inside a connection string, or an internal token in a format nobody has written a pattern for, still gets recorded. The defaults are a safety net, not a guarantee, and the manual filters exist for everything the net misses.

How it stacks up

The obvious comparison is fzf, the fuzzy finder most terminal users have wired to Ctrl+R. fzf is fast and everywhere, but it searches the same flat file, so it inherits the same amnesia: no exit codes, no directories, no durations, nothing to filter by except the text.

McFly is closer. It also stores history in SQLite with exit status and directory, and it ranks suggestions with a small neural network that weighs where you ran a command and what you ran before it. Its pitch is ranking, not portability: it keeps your plain history file so you can stop using it any time, and it has no equivalent of Atuin's sync. Its README is also currently asking for co-maintainers, which is worth knowing before you build a workflow around it. Atuin is the one that treats history as a database first, with sync and agent sessions as the payoff, and the trade is scope: it wants to be the recording layer for your terminal, not just a smarter search box on top of the old file.

The costs, stated plainly

Atuin only records interactive shells where its hooks are installed, which means adding its init line to your shell config and restarting. Non-interactive shells, and tools that spawn shells without sourcing your config, will not be recorded. There is one known rough edge in the docs: with bash-preexec, a leading space keeps a command out of Atuin but may still leave it in bash's own history file. And the history only starts when you install it. The import covers what your shell already recorded, but the exit codes and durations are gone: the flat file never kept them.

Install it if you live in a terminal, work across more than one machine, or use AI coding agents and have ever wanted yesterday's session back. Skip it if your terminal use is occasional and one machine deep.

One line installs it:

text
curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh

The flat history file was designed for a time when a terminal was one machine, one user, one session at a time. Atuin is what that file looks like once you admit the terminal is now a fleet of machines, a pile of sessions, and, increasingly, agents doing the typing.

Related reporting

More from grep.tips

All articles