Skip to content

wbingli/zsh-claudecode-completion

Repository files navigation

zsh-claudecode-completion

Minimal and always up-to-date zsh completions for Claude Code CLI

  • Pure tab completion only — no aliases, no wrapper functions, no opinionated workflows.
  • Always up-to-date within 24 hours - scheduled github action run daily, Claude Code automatically regenerates completions when the CLI changes. No manual maintenance required.

How It Works

  1. Claude Code writes completion scripts for Claude Code
  2. Claude Code writes slash commands to update Claude Code completions
  3. Claude Code creates GitHub workflows to run the slash commands every morning
  4. Claude Code opens PRs when updates are needed
  5. Me: sips coffeeclicks mergeresumes sipping

🐢 It's Claude Code all the way down.

Features

  • Command completion for all subcommands (mcp, plugin, install, update, etc.)
  • Option/flag completion with descriptions
  • Value completion for:
    • Model names (sonnet, opus, haiku, full model IDs)
    • Output formats (text, json, stream-json)
    • Permission modes (default, acceptEdits, bypassPermissions, etc.)
    • Tool names (Bash, Read, Write, Edit, etc.)
  • Context-aware: different completions based on current subcommand
  • File/directory completion where appropriate

Installation

Oh My Zsh

git clone https://github.com/wbingli/zsh-claudecode-completion.git \
  ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-claudecode-completion

Then add zsh-claudecode-completion to your plugins array in ~/.zshrc:

plugins=(... zsh-claudecode-completion)

Reload your shell:

exec zsh

Manual Installation

Clone the repository:

git clone https://github.com/wbingli/zsh-claudecode-completion.git

Add the directory to your fpath in ~/.zshrc:

fpath=(/path/to/zsh-claudecode-completion $fpath)
autoload -Uz compinit && compinit

Usage

Type claude followed by Tab to see available completions:

claude <TAB>              # Show commands and options
claude mcp <TAB>          # Show MCP subcommands
claude --model <TAB>      # Show model names
claude --output-format <TAB>  # Show output formats

Developer Guide

Updating Completions

When a new Claude CLI version is released, update the completion script by running:

claude /update-completions

This command will:

  1. Upgrade Claude CLI to the latest version
  2. Check if the completion script is outdated
  3. Regenerate _claude from the new --help output
  4. Commit the changes automatically

Troubleshooting

If completions don't work after installation, try:

rm -f ~/.zcompdump*
exec zsh

License

MIT

About

Minimal zsh completion plugin for Claude Code CLI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages