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 bifrost-mcpv1.0.0MIT
Security & protection hooks for Claude Code. Blocks destructive commands, protects sensitive files, prevents force-push to main/master, and maintains a full audit trail of all tool use.
You run one by typing its /name in Claude Code.
1 critical · 2 cautions to review before installing
A hook runs before every tool call and can block or approve it
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.
protection, audit, hooks, destructive-commands, file-protection, force-push, claude-code
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Security & protection hooks for Claude Code. Blocks destructive commands, protects sensitive files, prevents force-push to main/master, and maintains a full audit trail of all tool use.
Claude Shield adds a security layer to Claude Code through hooks:
rm -rf, DROP TABLE, git reset --hard, chmod 777, --force, --no-verify, and more.env, *.pem, *.key, id_rsa, credentials.*, .npmrc, and moregit push --force to main/master branchesgit clone https://github.com/bifrost-mcp/claude-shield.git ~/.claude/tools/claude-shield
npm install -g claude-shield
If using npm, find the install path for the next step:
echo "$(npm root -g)/claude-shield"
Add the following to your ~/.claude/settings.json. If using npm, replace ~/.claude/tools/claude-shield with the path from the command above.
{
"hooks": {
"PreToolUse": [
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "bash ~/.claude/tools/claude-shield/hooks/scripts/pre-tool-blocker.sh"
}
]
}
],
"PostToolUse": [
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "bash ~/.claude/tools/claude-shield/hooks/scripts/post-tool-auditor.sh"
}
]
}
]
}
}
Note: If you already have hooks in your settings.json, merge the arrays — don't replace them. Multiple hooks can coexist under the same event.
Start a Claude Code session and try a destructive command:
You: run rm -rf /tmp/test
Claude Shield: 🛡️ Blocked: rm -rf is a destructive command
Intercepts every tool call before execution. If a destructive command or protected file write is detected, the hook returns {"permissionDecision": "deny"} with a reason, preventing Claude Code from executing the action.
Blocked commands include:
| Pattern | Example |
|---|---|
rm -rf | rm -rf /, rm -Rf ./src |
DROP TABLE | sqlite3 db 'DROP TABLE users' |
git reset --hard | git reset --hard HEAD~3 |
git clean -f | git clean -fd |
chmod 777 | chmod 777 /etc/passwd |
rm -r -f (separate flags) | rm -r -f /important |
git commit --no-verify | git commit --no-verify -m 'msg' |
git push --force to main/master | git push --force origin main |
Protected files include:
.env, .env.*, credentials.*, *.pem, *.key, id_rsa, id_ed25519, .npmrc, .pypirc, secrets.*, *.keystore
Logs every tool use to SQLite (~/.claude-shield/audit.db):
/shield — View protection status, recent blocked attempts, and audit log/shield-config — View and update protection settingsConfig lives at ~/.claude-shield/config.json (auto-created on first use):
{
"enabled": true,
"block_destructive_commands": true,
"block_protected_files": true,
"block_force_push": true,
"audit_logging": true,
"audit_retention_days": 30,
"blocked_commands": [],
"protected_files": [],
"protected_branches": ["main", "master"]
}
Add your own blocked command patterns (regex):
{
"blocked_commands": ["npm\\s+publish", "docker\\s+rm"]
}
Add your own protected file patterns (glob):
{
"protected_files": ["*.secret", "config.production.*"]
}
All data is stored locally in ~/.claude-shield/:
| File | Purpose |
|---|---|
audit.db | SQLite database — blocked attempts + audit log |
config.json | Protection settings and custom rules |
No data is sent anywhere. Everything stays on your machine.
bash 3.2+ (ships with macOS)jq (brew install jq on macOS, apt install jq on Linux)sqlite3 (pre-installed on macOS and most Linux distributions)If jq or sqlite3 are missing, Claude Shield will silently disable itself rather than break Claude Code.
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 (bifrost-mcp/claude-shield) — no native marketplace selected
npx claudepluginhub p/bifrost-mcp-claude-shieldPlugins from other owners that cover similar ground