Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Run automatically on Claude Code events. Claude doesn't decide.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Block deprecated Gemini 2.x models and enforce Gemini 3 models only.
The Gemini 2.x models (gemini-2.5-pro, gemini-2.5-flash, etc.) are deprecated. Always use the latest Gemini 3 models for better performance and features.
| Model | Use Case |
|---|---|
gemini-3-pro-preview | Latest Gemini 3 Pro (recommended) |
gemini-3-flash-preview | Fast, cost-effective |
Any gemini command using a model with "2" in the name:
# BLOCKED
gemini --model gemini-2.5-pro "prompt"
gemini --model gemini-2.5-flash-preview "prompt"
gemini -m gemini-2.5-pro "prompt"
# ALLOWED
gemini --model gemini-3-pro-preview "prompt"
gemini --model gemini-3-flash-preview "prompt"
gemini "prompt" # Uses default model
CLI introspection is blocked to prevent version discovery:
# BLOCKED
gemini --version
gemini -v
gemini --help
gemini -h
This hook catches gemini invocations in many forms:
| Pattern | Example | Caught? |
|---|---|---|
| Direct | gemini -m gemini-2.5-pro | ✅ |
| Piped input | cat file | gemini -m gemini-2.5-pro | ✅ |
| Command chaining | cd /tmp && gemini -m gemini-2.5-pro | ✅ |
| Semicolon | echo x; gemini -m gemini-2.5-pro | ✅ |
| Newlines | echo xgemini -m gemini-2.5-pro | ✅ |
| Subshells | (gemini -m gemini-2.5-pro) | ✅ |
| Command substitution | $(gemini -m gemini-2.5-pro) | ✅ |
| Backticks | `gemini -m gemini-2.5-pro` | ✅ |
| Brace grouping | { gemini -m gemini-2.5-pro; } | ✅ |
| Absolute path | /usr/bin/gemini -m gemini-2.5-pro | ✅ |
| Relative path | ./gemini -m gemini-2.5-pro | ✅ |
| Home path | ~/.local/bin/gemini -m gemini-2.5-pro | ✅ |
| env wrapper | env gemini -m gemini-2.5-pro | ✅ |
| timeout wrapper | timeout 60 gemini -m gemini-2.5-pro | ✅ |
| nohup | nohup gemini -m gemini-2.5-pro | ✅ |
| exec | exec gemini -m gemini-2.5-pro | ✅ |
| time | time gemini -m gemini-2.5-pro | ✅ |
| nice/ionice | nice gemini -m gemini-2.5-pro | ✅ |
| Env var prefix | VAR=x gemini -m gemini-2.5-pro | ✅ |
| bash -c | bash -c 'gemini -m gemini-2.5-pro' | ✅ |
| sh -c | sh -c 'gemini -m gemini-2.5-pro' | ✅ |
| eval | eval 'gemini -m gemini-2.5-pro' | ✅ |
| xargs | echo x | xargs gemini -m gemini-2.5-pro | ✅ |
This plugin uses two hooks:
These patterns cannot be detected:
./script.sh where script contains gemini callscmd=gemini; $cmd -m gemini-2.5-proFor external scripts, consider adding a Write hook to scan script contents.
Add to your hooks setup:
./scripts/setup-hooks.sh
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub rbozydar/rbw-claude-code --plugin gemini-model-guardPlugins from other owners that cover similar ground