🇯🇵 日本語版はこちら
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,attach,logs,stop,kill,rm,respawn,auto-mode,auth,mcp,plugin,plugins,setup-token,doctor,gateway,import,update,upgrade,install,ultrareview) - 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,manual,dontAsk,plan,auto - Models:
sonnet,opus,haiku, etc. - Setting sources:
user,project,local - Effort levels:
low,medium,high,xhigh,max - Tool names:
Bash,Read,Edit,Agent,Skill, etc. plusdefault(for--tools,--allowedTools,--disallowedTools)
- 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 attach logs stop kill rm respawn auto-mode auth mcp plugin plugins purge setup-token doctor gateway import update upgrade install ultrareview
# 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 manual dontAsk plan auto
claude --model <TAB>
# Shows: sonnet opus haiku fable best sonnet[1m] opus[1m] fable[1m] opusplan
claude --effort <TAB>
# Shows: low medium high xhigh max
claude --autocompact <TAB>
# Shows: auto 100k 200k 500k 1m
claude --system-prompt-snapshot <TAB>
# Shows: on off
claude --permission-prompts <TAB>
# Shows: host none
# Complete install targets
claude install <TAB>
# Shows: stable latest --force --help
# Complete import sources
claude import <TAB>
# Shows: codex gemini cursor --dry-run --yes --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 login logout
# Complete mcp add options
claude mcp add --transport <TAB>
# Shows: stdio sse http
# Complete plugin subcommands
claude plugin <TAB>
# Shows: configure details disable enable eval init new install i list marketplace prune autoremove tag test uninstall remove update validate
# File path completion
claude --settings <TAB>
# Shows files and directoriesagents- Manage background agents (with--add-dir,--agent,--all,--allow-dangerously-skip-permissions,--cwd,--dangerously-skip-permissions,--effort,--json,--mcp-config,--model,--permission-mode,--plugin-dir,--restricted,--setting-sources,--settings,--strict-mcp-configoptions)attach- Open a background session in this terminallogs- Print a background session's recent terminal outputstop(kill) - Stop a background session, keeping its conversationrm- Delete a background session, and its worktree when that is safe (with--discard-unpushed,--force-remove-worktreeoptions)respawn- Restart a background session so it runs the current Claude Code version (with--alloption)auto-mode- Inspect or reset auto mode classifier configurationconfig- Print the effective auto mode config as JSONcritique- Get AI feedback on your custom auto mode rules (with--modeloption)defaults- Print the default auto mode environment, allow, soft_deny, and hard_deny rules as JSON (with--labeloption)reset- Reset auto mode configuration to the shipped defaults (with--yesoption)
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 string (with--scope,--client-secretoptions)get- 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 serverlogin- Authenticate with an MCP server (with--no-browseroption)logout- Clear stored OAuth credentials for an MCP server
plugin- Manage Claude Code pluginsconfigure- Show a plugin's options and which are unset, or save values from stdin with--values-stdin(with--json,--values-stdinoptions)details- Show a plugin's component inventory and projected token costdisable- Disable an enabled plugin (with--all,--json,--scopeoptions)enable- Enable a disabled plugin (with--json,--scopeoptions)eval- Run eval cases against a plugin and report scored results (with--ablation,--allow-real-servers,--allow-tools,--case,--concurrency,--disallow-tools,--eval-dir,--json,--judge-model,--keep-temp,--max-cost-usd,--mocks,--model,--no-publish,--no-scaffold,--output-dir,--publish-report,--report,--runs,--scaffold,--tag,--threshold,--trust-plugin,--verboseoptions;--jsonoptionally takes a.jsonoutput path)init- Author an eval suite under the eval dir (evals/by default) via an interview (with--bare,--eval-dir,--interactiveoptions)
init(new) - Scaffold a new plugin (with--author,--author-email,--description,--force,--withoptions)install(i) - Install a plugin from available marketplaces (with--accept-command,--config,--json,--marketplace,--registry,--scope,--yesoptions)list- List installed plugins (with--available,--data-size,--jsonoptions;--data-sizeoptionally takes a plugin name)marketplace- Manage Claude Code marketplaces (add,list,remove(rm),update);addsupports--claudeai,--json,--scope,--sparse;listandupdatesupport--json;remove/rmsupport--json,--scopeprune(autoremove) - Remove auto-installed dependencies that are no longer needed (with--dry-run,--scope,--yesoptions)tag- Create a{name}--v{version}git tag for a plugin release (with--dry-run,--force,--message,--push,--remoteoptions)test- Run a mod's testsuninstall(remove) - Uninstall an installed plugin (with--json,--keep-data,--prune,--scope,--yesoptions)update- Update a plugin to the latest version (with--accept-command,--json,--scope,--yesoptions)validate- Validate a plugin or marketplace manifest (with--json,--strictoptions)
purge- Delete all Claude Code state for a project (transcripts, tasks, file history, config entry) (with--all,--dry-run,--interactive,--yesoptions)setup-token- Set up a long-lived authentication tokendoctor- Check the health of your Claude Code installationgateway- Run the enterprise auth/telemetry gateway (with--configoption)import- Import config from another AI coding agent (codex,gemini,cursor) into Claude Code (with--dry-run,--yesoptions)update- Check for updates and install if availableplugins- Alias forpluginupgrade- Alias forupdateinstall- Install Claude Code native build (with--forceoption)ultrareview- Run a cloud-hosted multi-agent code review of the current branch (or a PR number / base branch) (with--json,--post,--no-post,--timeoutoptions)
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 - System prompt:
--system-prompt,--append-system-prompt,--system-prompt-snapshot - Permissions:
--permission-mode,--permission-prompts,--dangerously-skip-permissions,--restricted - Tools:
--tools,--allowed-tools,--disallowed-tools - MCP:
--mcp-config,--strict-mcp-config - File resources:
--file - Worktree:
--worktree,--tmux - Cloud sessions:
--cloud,--environment,--teleport - Background sessions:
--bg,--background(and theattach,logs,stop,rm,respawncommands that take the id it prints) - Context management:
--autocompact - 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