# zoxide — A Smarter cd Command That Learns Your Habits > zoxide is a smarter cd command written in Rust. It tracks directories you visit and lets you jump to any of them with just a few keystrokes. Inspired by z and autojump. Works with bash, zsh, fish, PowerShell, nushell, and more. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use ```bash # Install brew install zoxide # macOS curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh cargo install zoxide --locked # Hook into shell echo "eval \"\$(zoxide init zsh)\"" >> ~/.zshrc echo "eval \"\$(zoxide init bash)\"" >> ~/.bashrc ``` Usage: ```bash z tokrepo # Jump to nearest dir matching tokrepo z web # Jump to your frequent web dir zi # Interactive fzf picker z foo bar # Match dirs containing both foo and bar z - # Go to previous dir ``` ## Intro zoxide is a smarter `cd` command written in Rust. It learns which directories you use most frequently and lets you jump to any of them with a few keystrokes. Inspired by the classic `z` script and autojump, but faster and supporting every major shell. - **Repo**: https://github.com/ajeetdsouza/zoxide - **Stars**: 35K+ - **Language**: Rust - **License**: MIT ## What zoxide Does - **Frecency ranking** — frequency + recency scoring for visited dirs - **z command** — jump to any tracked dir by partial name - **zi** — interactive fuzzy picker (uses fzf) - **Multi-keyword match** — `z proj api` finds `~/code/myproject/api` - **Last dir** — `z -` toggles previous directory - **Shell integrations** — bash, zsh, fish, PowerShell, nushell, elvish, xonsh, cmd - **Directly callable** — `zoxide query foo` for scripting ## Architecture Rust binary that maintains a SQLite-like flat-file database at `~/.local/share/zoxide/db.zo`. Each time you cd, the shell hook calls `zoxide add $PWD`. The `z` command queries the DB and returns the best match. Interactive mode pipes candidates to fzf. ## Self-Hosting Local CLI tool. ## Key Features - Cross-shell support - Frecency algorithm - Fast matching (Rust) - Fuzzy interactive mode (zi) - Import from z, autojump, fasd - Scripting friendly - Dead entries auto-cleaned - No database maintenance needed ## Comparison | Tool | Algorithm | Shells | Database | |---|---|---|---| | zoxide | Frecency | All | Rust flat file | | z (shell script) | Frecency | Bash/Zsh | Text file | | autojump | Frequency | Bash/Zsh/Fish | Python | | fasd | Frecency | Bash/Zsh | Shell script | ## FAQ **Q: Does it pair with fzf?** A: `zi` uses fzf automatically. Set the `_ZO_FZF_OPTS` environment variable to customize the appearance. **Q: How do I migrate data from z?** A: `zoxide import --from z ~/.z`. Also supports autojump, fasd, and z-lua formats. **Q: Does it work on Windows?** A: Yes. Both PowerShell and cmd have init hooks. ## Sources & Credits - GitHub: https://github.com/ajeetdsouza/zoxide - License: MIT --- Source: https://tokrepo.com/en/workflows/zoxide-smarter-cd-command-learns-your-habits-d3b64571 Author: AI Open Source