opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

zoxide: a smarter cd that remembers your most-used directories
GitHub RepoImpressions2

Project Description

View on GitHub

Stop Typing cd Like It's 1995: Meet zoxide, the Directory Jumper That Actually Learns

You know the drill: you're deep in a project, you need to bounce back to that one directory you visited three hours ago, and you're typing out the full path again—or worse, mashing the up-arrow key hoping to find that one command. It's tedious, it's slow, and honestly, it's a little embarrassing. What if your shell could just remember where you've been and take you there in a few keystrokes? That's exactly what zoxide does. It's a smarter cd command, inspired by tools like z and autojump, that ranks your most-used directories and lets you jump to them almost instantly.

What It Does

zoxide is a drop-in replacement for cd that learns your habits. Under the hood, it's a Rust binary that tracks how frequently and recently you visit directories. When you type z foo, it doesn't just search for a path containing "foo"—it ranks all matching directories by your usage history and takes you to the one you actually use most. It's not a shell script; it's a compiled program, which means it's fast and works across all major shells (bash, zsh, fish, and more).

The core interaction is simple. You use z just like you'd use cd, but with fuzzy matching. Want to jump into a subdirectory starting with "foo"? z foo / handles that. Need to go up a level? z .. works like normal. Want to go back to your previous directory? z - does that too. It even supports multiple arguments—z foo bar finds the highest-ranked directory matching both terms. There's also an interactive mode (zi) that uses fzf to let you pick from a list, and if you're on bash 4.4+, fish, or zsh, you can hit <TAB> after typing z foo to see live completions.

Why It's Cool

The beauty of zoxide isn't just that it saves you keystrokes—it's that it learns you. Here's what makes it stand out:

  • It's a smarter cd, not a new paradigm. You don't have to learn a completely new workflow. You're still navigating directories; zoxide just removes the guesswork. The syntax is intuitive, and the fallback behavior is identical to cd for absolute paths and relative paths.

  • Ranking beats searching. Traditional cd is binary: a path either exists or it doesn't. zoxide adds a third dimension—frequency. It's not just finding a match; it's finding the right match based on your actual behavior. That's a subtle but powerful shift.

  • It's fast because it's Rust. This isn't a slow shell function. It's a compiled binary, so the overhead is minimal. You'll barely notice it's there, which is exactly what you want from a tool you use dozens of times a day.

  • The interactive touches are thoughtful. The zi command with fzf is great for those "I know it's somewhere in here" moments, and the tab completions mean you can often just type z foo<SPACE><TAB> and let your shell fill in the rest.

  • Installation is genuinely easy. The README lays out a four-step process, and the primary recommended path is a single curl script. There are also packages for cargo, conda-forge, and others, so you can probably get it through your existing package manager without breaking a sweat.

How to Try It

Getting started is quick. The recommended way on Linux or WSL is a one-liner:

curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh

If you prefer a package manager, you can use cargo:

cargo install zoxide --locked

Or check if your distro's repos have it—there are packages for conda-forge, guix, and more. Once the binary is installed, you'll need to add a hook to your shell's config file (the README covers the specifics for each shell). After that, you can start using it immediately:

z foo              # cd into highest ranked directory matching foo
z foo bar          # cd into highest ranked directory matching foo and bar
z foo /            # cd into a subdirectory starting with foo
z ~/foo            # works like a regular cd command
z -                # cd into previous directory
zi foo             # interactive selection with fzf

The full installation and configuration details are in the README on GitHub, so head there if you hit any snags.

Final Thoughts

zoxide isn't going to rewrite your terminal workflow, but it will make it noticeably less annoying. It's a small, focused tool that solves a real friction point, and it does so with a clean design and solid performance. If you spend any significant time navigating deep directory trees—which, if you're a developer, you absolutely do—it's worth the five minutes to install. You'll likely find yourself wondering how you managed without it. Give it a shot; your up-arrow key will thank you.


Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Project ID: c6b7af1a-5e75-4259-91c4-3cd2d0040c48Last updated: August 25, 2026 at 02:44 AM