Bash tab-completion for the claude CLI
(Claude Code): top-level flags, subcommands (agents, auth, auto-mode,
mcp, plugin, project, ...), their sub-subcommands, and known enum/path
option values.
See SPEC.md for exact scope and non-goals.
Targets Bash 3.2+, no bash-completion framework dependency required.
./install.shInstalls completions/claude.bash to
${BASH_COMPLETION_USER_DIR:-~/.local/share/bash-completion}/completions/claude.
If the bash-completion framework isn't detected, also adds a source line
to ~/.bashrc so the completion loads without it.
For a system-wide install (requires write access to /etc):
sudo ./install.sh --systemsource completions/claude.bashOpen a new shell (or re-source your ~/.bashrc) after installing, then:
claude <TAB>
claude mcp <TAB>
claude --permission-mode <TAB>The claude CLI surface is hand-transcribed from claude --help / claude <command> --help output. When Claude Code adds or renames flags/commands,
re-run those --help commands and update the word lists at the top of
completions/claude.bash accordingly.