An oh-my-zsh plugin that translates natural language comments into shell commands using Claude Code.
# find all js files larger than 100kb modified in the last week and show their sizesPress Enter, and the line becomes:
find . -name "*.js" -size +100k -mtime -7 -exec ls -lh {} \;Review the command, press Enter again to execute.
Another example:
# recursively find and delete all node_modules foldersBecomes:
find . -type d -name "node_modules" -prune -exec rm -rf {} +- Claude Code CLI installed and authenticated
- zsh shell
- oh-my-zsh (optional, for easiest installation)
Clone to your custom plugins directory:
git clone https://github.com/ArielTM/zsh-claude-code-shell ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-claude-code-shellAdd to your ~/.zshrc:
plugins=(... zsh-claude-code-shell)Restart your shell or run source ~/.zshrc.
Clone the repository and source the plugin:
git clone https://github.com/ArielTM/zsh-claude-code-shell ~/zsh-claude-code-shell
echo 'source ~/zsh-claude-code-shell/zsh-claude-code-shell.plugin.zsh' >> ~/.zshrczinit light ArielTM/zsh-claude-code-shellzplug "ArielTM/zsh-claude-code-shell"- Type a comment starting with
#followed by what you want to do - Press Enter
- The comment is replaced with the generated command
- Review the command, press Enter to execute (or edit it first)
# find all TODO comments in typescript files
# becomes: grep -rn "TODO" --include="*.ts" .
# show top 10 largest files in current directory recursively
# becomes: find . -type f -exec du -h {} + | sort -rh | head -10
# kill all processes matching "node"
# becomes: pkill -f node
# compress all log files older than 30 days
# becomes: find . -name "*.log" -mtime +30 -exec gzip {} \;
# show git commits from last week with stats
# becomes: git log --since="1 week ago" --stat
# find duplicate files by md5 hash
# becomes: find . -type f -exec md5sum {} + | sort | uniq -w32 -dDSet these environment variables in your ~/.zshrc before the plugin loads:
| Variable | Default | Description |
|---|---|---|
ZSH_CLAUDE_SHELL_DISABLED |
0 |
Set to 1 to disable the plugin |
ZSH_CLAUDE_SHELL_MODEL |
(default) | Override the Claude model (e.g., sonnet, opus) |
ZSH_CLAUDE_SHELL_DEBUG |
0 |
Set to 1 to show debug output |
ZSH_CLAUDE_SHELL_FANCY_LOADING |
1 |
Set to 0 to use simple loading message instead of animated spinner |
# Use a specific model
export ZSH_CLAUDE_SHELL_MODEL="sonnet"
# Temporarily disable
export ZSH_CLAUDE_SHELL_DISABLED=1The plugin overrides zsh's accept-line widget (the Enter key handler). When you press Enter:
- If the line starts with
#, it extracts your description - Calls
claude -pwith your description - Replaces the buffer with the generated command
- You review and press Enter again to execute
Lines that don't start with # work normally.
MIT