Skip to content

1160054/claude-code-zsh-completion

Test Completion GitHub release License: MIT Languages

claude-code-zsh-completion

πŸš€ Zsh completion script for Claude Code CLI - intelligent auto-completion for all claude commands, options, and arguments

Demo

Features

  • ✨ Complete command completion for all claude commands
  • πŸ”§ Intelligent option and flag suggestions
  • πŸ“¦ MCP server management completions
  • πŸ”Œ Plugin marketplace operation completions
  • 🎯 Context-aware argument completion
  • πŸ“ Helpful descriptions for all commands and options
  • 🌍 Multi-language support (120+ languages)
  • ⚑ Dynamic completion for MCP servers, plugins, and sessions

Requirements

  • Zsh 5.0 or later
  • Claude Code CLI installed

Installation

Quick Install

# Download and install (English example)
mkdir -p ~/.zsh/completions && curl -o ~/.zsh/completions/_claude \
  https://github.com/___raw___/1160054/claude-code-zsh-completion/main/completions/_claude

For other languages, replace _claude with your preferred language file. See Available Languages below.

Add the following to your ~/.zshrc (if not already present):

# Add completions directory to fpath
fpath=(~/.zsh/completions $fpath)

# Initialize completion system
autoload -Uz compinit
compinit

Reload your shell:

source ~/.zshrc

Plugin Managers

zinit light 1160054/claude-code-zsh-completion
antigen bundle 1160054/claude-code-zsh-completion

Add to ~/.config/sheldon/plugins.toml:

[plugins.claude-code-zsh-completion]
github = "1160054/claude-code-zsh-completion"
git clone https://github.com/1160054/claude-code-zsh-completion ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/claude-code

Add claude-code to your plugins in ~/.zshrc:

plugins=(... claude-code)

Available Languages

120+ languages supported! All completion files are located in the completions/ directory.

Popular Languages

  • English (_claude), Japanese (_claude.ja), Chinese Simplified (_claude.zh-CN), Spanish (_claude.es), French (_claude.fr), German (_claude.de), Korean (_claude.ko), Russian (_claude.ru), Portuguese (_claude.pt), Italian (_claude.it), Arabic (_claude.ar), Hindi (_claude.hi), Turkish (_claude.tr), Polish (_claude.pl), Dutch (_claude.nl), Vietnamese (_claude.vi), Thai (_claude.th), Indonesian (_claude.id)
πŸ“‹ See all 120+ supported languages

Browse all language files in the completions/ directory.

Included:

  • European: Slavic (Bulgarian, Czech, Slovak, Croatian, Serbian, Ukrainian, Belarusian, etc.), Germanic (Swedish, Danish, Norwegian, Icelandic, Afrikaans), Romance (Portuguese, Romanian, Catalan, Galician), Baltic (Lithuanian, Latvian, Estonian), Celtic (Welsh, Scottish Gaelic), and more
  • Asian: Chinese (Traditional, Cantonese, Hong Kong), Mongolian, Khmer, Lao, Bengali, Punjabi, Marathi, Tamil, Telugu, Kannada, Malayalam, Odia, Urdu, Nepali, Malay, Tagalog
  • Middle Eastern: Persian, Hebrew, Azerbaijani, Kazakh, Uzbek, Uyghur, Tatar, Georgian
  • African: Swahili, Wolof, Southern Sotho
  • Regional variants: English (10 variants), Spanish (13 variants), German (4 variants), French (4 variants), Swedish (3 variants)
  • Others: Esperanto, Basque, and many more

For any language, replace _claude with your preferred language file (e.g., _claude.ja for Japanese).

Usage

Once installed, simply type claude and press TAB to see available completions:

claude <TAB>              # Shows all available commands
claude mcp <TAB>          # Shows MCP subcommands
claude --<TAB>            # Shows all available options
claude plugin <TAB>       # Shows plugin subcommands

Basic Examples

# Autocomplete main commands
claude m<TAB>  β†’  claude mcp

# Autocomplete MCP subcommands
claude mcp a<TAB>  β†’  claude mcp add

# Autocomplete options
claude --mod<TAB>  β†’  claude --model

# Autocomplete with descriptions
claude mcp <TAB>
serve                    -- Start Claude Code MCP server
add                      -- Add an MCP server to Claude Code
remove                   -- Remove an MCP server
list                     -- List configured MCP servers
...

Dynamic Completion Examples

# MCP server completion (shows your configured servers)
claude mcp remove <TAB>   # Shows: server1, server2, myserver, etc.
claude mcp get <TAB>      # Shows: server1, server2, myserver, etc.

# Plugin completion (shows your installed plugins)
claude plugin uninstall <TAB>   # Shows your installed plugins
claude plugin enable <TAB>      # Shows your installed plugins

# Session ID completion (shows your available sessions)
claude --resume <TAB>     # Shows: 12345678-abcd-..., 87654321-dcba-..., etc.

Supported Commands

  • Main commands: mcp, plugin, migrate-installer, setup-token, doctor, update, install
  • MCP commands: serve, add, remove, list, get, add-json, add-from-claude-desktop, reset-project-choices
  • Plugin commands: validate, marketplace, install, uninstall, enable, disable
  • Plugin marketplace: add, list, remove, update

Troubleshooting

Completions not working

  1. Make sure the completion file is in your fpath:
echo $fpath
  1. Verify the completion system is initialized in your ~/.zshrc:
autoload -Uz compinit
compinit
  1. Clear and rebuild completion cache:
rm -f ~/.zcompdump
compinit
  1. Check if the completion file is loaded:
which _claude

Permission issues

Make sure the completion file has the correct permissions:

chmod 644 ~/.zsh/completions/_claude

Still not working?

  • Ensure Claude Code CLI is installed and accessible in your PATH
  • Try restarting your terminal completely
  • Check for conflicts with other completion scripts

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

See CONTRIBUTING.md for detailed guidelines.

License

This project is licensed under the MIT Licenseβ€”see the LICENSE file for details.

Acknowledgments

  • Based on the official Claude Code CLI documentation
  • Inspired by the Zsh completion system
  • Community translations from contributors worldwide

Links


Made with ❀️ for the Claude Code community