Thanks for your interest in contributing!
If you find missing completions or bugs:
- Check existing issues first
- Provide specific examples of what's not working
- Include your ZSH version:
zsh --version - Include installation method (Oh My Zsh, manual, etc.)
When the Claude CLI adds new commands or options:
- Fork the repository
- Update
_claudewith the new completions - Follow the existing patterns and structure
- Test locally (see Testing section)
- Submit a pull request
The completion file _claude follows ZSH completion conventions:
- Main function:
_claude() - Subcommand functions:
_claude_auth(),_claude_mcp(), etc. - Uses
_argumentsfor option parsing - Uses
_describefor command listings
Example: Adding a new top-level command claude foo:
# In _claude(), add to commands array:
commands=(
...
'foo:Description of foo command'
)
# In the args case statement:
case $words[1] in
...
foo)
_claude_foo
;;
esac
# Add the new function:
_claude_foo() {
_arguments \
'(-h --help)'{-h,--help}'[Display help]' \
# Add more options here
}Example: Adding --new-flag to main options:
main_options=(
...
'--new-flag[Description of flag]:value:(option1 option2)'
)Before submitting:
# Load the completion in a test shell
zsh -c 'fpath=(. $fpath); autoload -Uz compinit && compinit && source _claude && which _claude'
# Manual testing
# In a new shell with the completion loaded:
claude <TAB>
claude --new-flag <TAB>See docs/testing-guide.md for comprehensive testing instructions.
- Use 2 spaces for indentation
- Keep descriptions concise and clear
- Follow existing patterns for consistency
- Group related options together
- Add comments for complex logic
- Update
_claudewith your changes - Test the completions locally
- Update README.md if adding major features
- Describe what you changed and why
- Submit the PR
Open an issue for discussion before making large changes.
By contributing, you agree that your contributions will be licensed under the MIT License.