Enable intelligent tab completion for the claude command in Zsh shells.
- Help-derived completions: Regenerates top-level
claudeoptions and commands from the currently installed Claude CLI - Current enum values: Picks up visible values such as
--permission-modeand--effortdirectly fromclaude --help - Stable option insertion: The generated
_claudeapplies conservative local matching so aggressive global Zsh matcher rules do not distort Claude option completion - Claude-only matcher style: Adds a conservative
:completion:*:*:claude:*matcher-list without changing your global completion rules - Idempotent install: Re-runs cleanly by replacing only the installer-managed block in
~/.zshrc
curl -fsSL https://raw.githubusercontent.com/moringchen/claude-code-tools/main/tools/zsh-completion/setup_claude_completion.sh | bash
source ~/.zshrc- Verifies that
claudeis available inPATH - Captures
claude --helpand generates~/.zsh/completions/_claude - Updates only its own marked block in
~/.zshrc - Generates a
_claudefunction that keeps cursor placement and option matching stable even when your global Zsh completion matchers are more aggressive
| Command | Description |
|---|---|
agents |
List configured agents |
auth |
Manage authentication |
auto-mode |
Inspect auto mode classifier configuration |
doctor |
Check the health of your Claude Code auto-updater |
install |
Install Claude Code native build |
mcp |
Configure and manage MCP servers |
plugin / plugins |
Manage Claude Code plugins |
setup-token |
Set up a long-lived authentication token |
update / upgrade |
Check for updates and install if available |
# Complete global options
claude --<Tab>
# Shows: --model, --permission-mode, --debug, --continue, etc.
# Complete model selection
claude --model <Tab>
# Shows: sonnet, opus, haiku, claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5
# Complete subcommands
claude <Tab>
# Shows: agents, auth, mcp, plugin, update, doctor, etc.
# Complete MCP subcommands
claude mcp <Tab>
# Shows: add, list, remove, serve, add-json, etc.
# Complete plugin subcommands
claude plugin <Tab>
# Shows: install, list, enable, disable, update, etc.- Zsh shell
- Claude Code installed
If completion doesn't work after installation:
# Remove completion cache and reload
rm -f ~/.zcompdump
compinit
source ~/.zshrcMIT License - same as the main project.