https://github.com/jlhg/claude-bash-completion
Bash completion script for Claude Code CLI, providing tab completion for both built-in slash commands and custom commands.
https://github.com/jlhg/claude-bash-completion
bash-completion claude claude-code
Last synced: 2 months ago
JSON representation
Bash completion script for Claude Code CLI, providing tab completion for both built-in slash commands and custom commands.
- Host: GitHub
- URL: https://github.com/jlhg/claude-bash-completion
- Owner: jlhg
- License: mit
- Created: 2025-11-07T22:29:28.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2025-11-07T22:49:43.000Z (2 months ago)
- Last Synced: 2025-11-08T00:19:39.662Z (2 months ago)
- Topics: bash-completion, claude, claude-code
- Language: Shell
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Claude Bash Completion
Bash completion script for Claude Code CLI, providing tab completion for both built-in slash commands and custom commands.
## Features
- Auto-completion for all Claude Code built-in slash commands (26 commands)
- Auto-completion for custom commands from `~/.claude/commands/` directory
- Smart detection: completions only trigger when input starts with `/`
## Requirements
- Bash shell
- [Claude Code](https://github.com/anthropics/claude-code) installed and configured
- `bash-completion` package (usually pre-installed on most systems)
## Installation
### Method 1: Source in `.bashrc`
1. Clone or download this repository:
```bash
git clone https://github.com/jlhg/claude-bash-completion.git
```
2. Add the following line to your `~/.bashrc`:
```bash
source /path/to/claude-bash-completion/claude-completion.bash
```
3. Reload your shell configuration:
```bash
source ~/.bashrc
```
### Method 2: Install to system completion directory
Copy the script to your system's bash completion directory:
```bash
sudo cp claude-completion.bash /etc/bash_completion.d/claude
```
Then reload your shell or start a new terminal session.
## Usage
Once installed, you can use tab completion with the `claude` command:
```bash
# Type and press Tab to see all available commands
claude /
# Type partial command and press Tab for completion
claude /con # Completes to /config, /context, /cost, etc.
# Works with both built-in and custom commands
claude /my-custom- # If you have custom commands in ~/.claude/commands/
```
## Custom Commands
The script automatically discovers custom commands from `~/.claude/commands/` directory. Any `.md` file in that directory will be available for completion.
## License
MIT License