zoxide: a smarter cd that jumps to directories in a few keystrokes
TL;DR
zoxide remembers the directories you visit often and recently. Type z plus a fragment to jump, zi to pick with fzf. Put the init line at the end of .zshrc and add --cmd cd to replace cd entirely.
Developers type cd so often they stop noticing: cd ~/work/company/projects/backend/services/payment, then cd ../../frontend. zoxide is a cd that remembers: it records the directories you visit often and recently, then lets you jump to them with just a fragment of the name. Type z payment and you're in the payment directory, wherever you are.

Installation
brew install zoxide # macOS
cargo install zoxide --locked # with Rust
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
# Add to the END of ~/.zshrc
eval "$(zoxide init zsh)"
# bash: eval "$(zoxide init bash)" fish: zoxide init fish | source
Right after installation zoxide knows nothing. Keep using cd or z for a few days and it learns.
Usage
z payment # jump to the highest-ranked directory matching "payment"
z back pay # multiple terms: path containing "back" then "pay"
z .. # still works like a normal cd
z - # back to the previous directory
zi pay # pick interactively with fzf when there are several matches
z foo<SPACE><TAB> # show matches while typing (zsh/fish)
How does zoxide choose?
Each directory has a "frecency" score combining how often (frequency) and how recently (recency) you visited it. Frequently and recently visited directories rank highest. The last keyword must match the last component of the path, so z pay prefers .../payment over .../payment/docs.
| Command | Effect |
|---|---|
zoxide query pay | Print the directory that would be chosen, without jumping |
zoxide query -ls | List all directories with scores |
zoxide add <path> | Add a directory manually |
zoxide remove <path> | Remove a directory from the database |
zoxide edit | Open an editor UI to adjust scores and remove old entries |
Customisation
- Replace cd entirely:
eval "$(zoxide init zsh --cmd cd)"socdandcdiuse zoxide. - Exclude directories: set
_ZO_EXCLUDE_DIRSto avoid remembering temporary or sensitive directories. - Migrating from other tools:
zoxide importcan import data from autojump, z and similar tools (see the README).
Caveats
- The
evalline must go at the end of your shell config, after other plugins, so it isn't overridden. zirequires fzf.- Deleted or renamed directories are cleaned up over time; use
zoxide removeto clean immediately.
How to apply it
- Dev: Install it and use it alongside cd for a week. Once comfortable, enable
--cmd cdso your typing habits don't change. - Tech Lead: In a monorepo with many services, zoxide makes switching between them fast; add it to the environment setup guide.
- PM: A small gain each time, repeated hundreds of times a day: "install once, benefit forever".
Sources & references
- ajeetdsouza/zoxide — ajeetdsouza (GitHub)