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.
By Sanchay-Tv1.0.0MIT
AI-powered permission gatekeeper — routes permission requests to Opus 4.5 via AWS Bedrock for context-aware auto-approval with instant DENY safety net
You run one by typing its /name in Claude Code.
2 cautions to review before installing
A hook runs when Claude uses the Bash tool
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
AI-powered permission gatekeeper for Claude Code. Routes permission requests to Opus 4.5 for context-aware auto-approval, with an instant safety net for dangerous patterns.
type: "prompt"?Other approaches use Claude Code's built-in type: "prompt" hooks for permission evaluation. This doesn't work. Due to a known issue, type: "prompt" hooks acknowledge the permission but the dialog still appears — defeating the purpose.
Opus Shield uses type: "command" with hookSpecificOutput JSON, which is the only approach that actually suppresses the permission dialog.
Permission request arrives
│
├── In your AllowList? → auto-approved instantly (hook never fires)
│
└── Not in AllowList? → Opus Shield fires
│
├── DENY safety net (~40ms)
│ Instant regex matching for dangerous patterns:
│ • rm -rf /, sudo, chmod 777
│ • Pipe-to-shell (curl | bash)
│ • Data exfiltration (pipe to curl/wget/ssh)
│ • System path edits (/etc, /usr, /bin)
│ • Secrets access (.ssh, .aws, .env)
│ • Internal IP access (localhost, 127.0.0.1)
│
└── Opus 4.5 review (~2-4s)
Context-aware AI evaluation via AWS Bedrock or Anthropic API.
Reads your session transcript to understand what you're working on.
Returns ALLOW or DENY based on whether the action makes sense.
| Tool | What's checked |
|---|---|
| Bash | Command content, working directory, description |
| Edit/Write | File path (blocks system paths, secrets, .env) |
| WebFetch | URL, domain (blocks internal IPs, auth tokens in URLs) |
jq installed (brew install jq)aws CLI installed (for Bedrock backend) or curl (for Anthropic API)/plugin marketplace add sanchay/opus-shield
/plugin install opus-shield@sanchay
git clone https://github.com/sanchay/opus-shield.git
claude --plugin-dir ./opus-shield
After installing, run the setup:
bash opus-shield/src/setup.sh
This copies the hook script to ~/.opus-shield/ and creates a credential file.
Edit ~/.opus-shield/.env with your credentials:
Option A — AWS Bedrock (recommended):
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret
Option B — Anthropic API:
ANTHROPIC_API_KEY=sk-ant-...
Restart Claude Code for hooks to take effect.
Opus Shield works best when paired with a generous AllowList. Safe commands in the AllowList are auto-approved instantly (0ms) and never fire the hook. Only unknown/risky commands reach Opus Shield.
Add this to your ~/.claude/settings.json:
{
"permissions": {
"allow": [
"Read", "Glob", "Grep", "Task", "WebSearch",
"Bash(git:*)", "Bash(npm:*)", "Bash(pnpm:*)", "Bash(yarn:*)",
"Bash(npx:*)", "Bash(node:*)", "Bash(tsc:*)", "Bash(tsx:*)",
"Bash(python3:*)", "Bash(biome:*)", "Bash(eslint:*)",
"Bash(prettier:*)", "Bash(jest:*)", "Bash(vitest:*)",
"Bash(ls:*)", "Bash(cat:*)", "Bash(grep:*)", "Bash(find:*)",
"Bash(head:*)", "Bash(tail:*)", "Bash(wc:*)", "Bash(mkdir:*)",
"Bash(touch:*)", "Bash(cp:*)", "Bash(mv:*)", "Bash(diff:*)",
"Bash(sort:*)", "Bash(jq:*)", "Bash(echo:*)", "Bash(pwd:*)",
"Bash(which:*)", "Bash(file:*)", "Bash(stat:*)"
]
}
}
Commands NOT in this list (like curl, rm, docker, lsof) will be evaluated by Opus Shield.
| Path | Latency | When |
|---|---|---|
| AllowList | 0ms | Safe commands (git, npm, ls, etc.) |
| DENY safety net | ~40ms | Dangerous patterns (sudo, rm -rf /, etc.) |
| Opus L2 | 2-4s | Everything else (curl, docker, unknown commands) |
settings.local.jsonClaude Code accumulates user-approved commands in .claude/settings.local.json (project-level). These bypass hooks entirely. If a command isn't hitting Opus Shield, check this file and clean out accumulated permissions.
| Feature | Opus Shield | type: "prompt" plugins | AllowList only |
|---|---|---|---|
| Actually auto-approves | Yes | No (dialog still shows) | Yes |
| Context-aware | Yes (reads session) | Partial | No |
| Instant dangerous blocks | Yes (DENY net) | No | No |
| Covers Edit/Write/WebFetch | Yes | Usually Bash only | N/A |
| Latency for unknown commands | 2-4s | N/A (broken) | N/A (shows dialog) |
Check if hooks are loaded:
/hooks
Enable debug mode to see hook execution:
claude --debug
Check the debug log for PermissionRequest entries to verify the hook is firing.
MIT
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.
Generated from the plugin's indexed repository (sanchay-t/opus-shield) — no native marketplace selected
npx claudepluginhub p/sanchay-t-opus-shieldPlugins from other owners that cover similar ground