Back to Hooks

Shell Wrapper Guard

Hooks security 196

Detects destructive commands hidden inside shell wrappers (sh -c, bash -c, python3 -c, node -e, perl -e, ruby -e). Complements dangerous-command-blocker by catching bypass vectors like 'sh -c "rm -rf /"' that evade direct command checks. Covers 8 bypass patterns: interpreter one-liners, nested wrappers, pipe-to-shell, here-strings, and env-based wrappers.

Install Command
npx claude-code-templates@latest --hook security/shell-wrapper-guard
View on GitHub
claude-code — shell-wrapper-guard

Content

JSON
{
"description": "Detects destructive commands hidden inside shell wrappers (sh -c, bash -c, pytho..."
"supportingFiles": [
{3 keys}
]
"hooks": {
"PreToolUse": [1 item]
}
}

Stack Builder

0 components

Your stack is empty

Browse components and click the + button to add them to your stack for easy installation.