🇯🇵 日本語版はこちら
Shell completion scripts for Claude Code, providing tab completion for commands, subcommands, and options in bash, zsh, and Nushell.
- Command completion: Tab complete
claudesubcommands (agents,auto-mode,auth,mcp,plugin,plugins,setup-token,doctor,update,upgrade,install) - Option completion: All CLI options and flags are completable
- Contextual suggestions: Option values are suggested where applicable
- Output formats:
text,json,stream-json - Permission modes:
acceptEdits,bypassPermissions,default,dontAsk,plan,auto - Models:
sonnet,opus,haiku, etc. - Setting sources:
user,project,local - Effort levels:
low,medium,high,max
- Output formats:
- File path completion: For options that expect file paths (e.g.,
--settings,--mcp-config,--add-dir,--file,--debug-file) - Subcommand completion: Full subcommand trees for
mcpandplugincommands
git clone https://github.com/hmmf022/cc-completion.git
cd cc-completionmkdir -p ~/.local/share/bash-completion/completions
ln -sf "$(pwd)/claude-completion.bash" ~/.local/share/bash-completion/completions/claude
source ~/.local/share/bash-completion/completions/claudesudo ln -sf "$(pwd)/_claude" /usr/local/share/zsh/site-functions/_claude
autoload -Uz compinit && compinitAdd to your Nushell config file ($nu.config-path):
use /path/to/cc-completion/claude-completions.nu *For other installation methods (oh-my-zsh, system-wide bash, etc.), see Installation Details below.
Option A: Copy (simple)
sudo cp claude-completion.bash /etc/bash_completion.d/claudeNote: After updating the repository (e.g.,
git pull), you need to copy the file again.
Option B: Symbolic link (recommended)
sudo ln -sf "$(pwd)/claude-completion.bash" /etc/bash_completion.d/claudeNote: Updates are reflected automatically via
git pull. Do not delete or move the cloned repository.
Then reload your shell or run:
source /etc/bash_completion.d/claudemkdir -p ~/.local/share/bash-completion/completionsOption A: Copy (simple)
cp claude-completion.bash ~/.local/share/bash-completion/completions/claudeNote: After updating the repository (e.g.,
git pull), you need to copy the file again.
Option B: Symbolic link (recommended)
ln -sf "$(pwd)/claude-completion.bash" ~/.local/share/bash-completion/completions/claudeNote: Updates are reflected automatically via
git pull. Do not delete or move the cloned repository.
Add to your ~/.bashrc:
source ~/.local/share/bash-completion/completions/claudeAdd to your ~/.bashrc:
source /path/to/claude-completion.bashOption A: Copy (simple)
sudo cp _claude /usr/local/share/zsh/site-functions/_claudeNote: After updating the repository (e.g.,
git pull), you need to copy the file again.
Option B: Symbolic link (recommended)
sudo ln -sf "$(pwd)/_claude" /usr/local/share/zsh/site-functions/_claudeNote: Updates are reflected automatically via
git pull. Do not delete or move the cloned repository.
Then reload completion:
rm -f ~/.zcompdump; compinitmkdir -p ~/.oh-my-zsh/custom/plugins/claudeOption A: Copy (simple)
cp _claude ~/.oh-my-zsh/custom/plugins/claude/_claudeNote: After updating the repository (e.g.,
git pull), you need to copy the file again.
Option B: Symbolic link (recommended)
ln -sf "$(pwd)/_claude" ~/.oh-my-zsh/custom/plugins/claude/_claudeNote: Updates are reflected automatically via
git pull. Do not delete or move the cloned repository.
Add to your ~/.zshrc:
plugins=(... claude)Add to your ~/.zshrc before compinit:
fpath=(/path/to/cc-completion $fpath)
autoload -Uz compinit && compinitAdd to your Nushell config file ($nu.config-path):
use /path/to/cc-completion/claude-completions.nu *Note: Replace
/path/to/cc-completionwith the actual path to this cloned repository.
After installation, you can use tab completion with the claude command:
# Complete subcommands
claude <TAB>
# Shows: agents auto-mode auth mcp plugin plugins setup-token doctor update upgrade install
# Complete options
claude --<TAB>
# Shows: --debug --verbose --print --model --help ...
# Complete option values
claude --output-format <TAB>
# Shows: text json stream-json
claude --permission-mode <TAB>
# Shows: acceptEdits bypassPermissions default dontAsk plan auto
claude --model <TAB>
# Shows: sonnet opus haiku best sonnet1m
claude --effort <TAB>
# Shows: low medium high max
# Complete install targets
claude install <TAB>
# Shows: stable latest --force --help
# Complete auth subcommands
claude auth <TAB>
# Shows: login logout status
# Complete auth login options
claude auth login --<TAB>
# Shows: --claudeai --console --email --sso --help
# Complete auth status options
claude auth status --<TAB>
# Shows: --json --text --help
# Complete mcp subcommands
claude mcp <TAB>
# Shows: add add-from-claude-desktop add-json get list remove reset-project-choices serve
# Complete mcp add options
claude mcp add --transport <TAB>
# Shows: stdio sse http
# Complete plugin subcommands
claude plugin <TAB>
# Shows: disable enable install list marketplace uninstall update validate
# File path completion
claude --settings <TAB>
# Shows files and directoriesagents- List configured agents (with--setting-sourcesoption)auto-mode- Inspect auto mode classifier configurationconfig- Show auto mode classifier configurationcritique- Run auto mode critique on a conversation (with--modeloption)defaults- Show default auto mode classifier configuration
auth- Manage authenticationlogin- Sign in to your Anthropic account (with--claudeai,--console,--email,--ssooptions)logout- Log out of your Anthropic accountstatus- Show current authentication status (with--json,--textoptions)
mcp- Configure and manage MCP serversadd- Add an MCP server (with--scope,--transport,--env,--header,--callback-port,--client-id,--client-secretoptions)add-from-claude-desktop- Import MCP servers from Claude Desktop (with--scopeoption)add-json- Add an MCP server with a JSON stringget- Get details about an MCP serverlist- List configured MCP serversremove- Remove an MCP server (with--scopeoption)reset-project-choices- Reset all approved and rejected project-scoped serversserve- Start the Claude Code MCP server
plugin- Manage Claude Code pluginsdisable- Disable an enabled pluginenable- Enable a disabled plugininstall(i) - Install a plugin from available marketplaceslist- List installed pluginsmarketplace- Manage Claude Code marketplaces (add,list,remove(rm),update)uninstall(remove) - Uninstall an installed pluginupdate- Update a plugin to the latest versionvalidate- Validate a plugin or marketplace manifest
setup-token- Set up a long-lived authentication tokendoctor- Check the health of your Claude Code auto-updaterupdate- Check for updates and install if availableplugins- Alias forpluginupgrade- Alias forupdateinstall- Install Claude Code native build (with--forceoption)
All Claude Code CLI options are supported, including:
- Session management:
--continue,--resume,--fork-session,--from-pr - Model selection:
--model,--fallback-model - Output control:
--print,--output-format,--input-format - Permissions:
--permission-mode,--dangerously-skip-permissions - Tools:
--tools,--allowed-tools,--disallowed-tools - MCP:
--mcp-config,--strict-mcp-config - File resources:
--file - Worktree:
--worktree,--tmux - Debugging:
--debug,--debug-file - And many more...
To verify the installation:
# For bash
type _claude_completion
# For zsh
which _claudeFor Nushell, verify the completions are loaded:
# Check if the external command is registered
help commands | where name =~ "claude"Try tab completion:
claude --mod<TAB>
# Should complete to: claude --model-
Ensure
bash-completionpackage is installed:# Ubuntu/Debian sudo apt-get install bash-completion # macOS (Homebrew) brew install bash-completion@2
-
Verify bash-completion is loaded in your shell:
type _init_completion
-
Ensure
compinitis called in your~/.zshrc:autoload -Uz compinit && compinit -
Rebuild completion cache:
rm -f ~/.zcompdump*; compinit
-
Verify the completion function is loaded:
which _claude
-
Ensure you are using Nushell 0.80 or later (required for
externcompletions):version -
Check that the completions are registered:
help commands | where name =~ "claude"
If you find missing commands or options, please update the completion scripts:
- For bash: Edit
claude-completion.bash - For zsh: Edit
_claude - For Nushell: Edit
claude-completions.nu