Claude Code · HooksPreToolUse
No Stripe live keys
Blocks writing Stripe sk_live_ and rk_live_ keys.
by Prompt Studio
securitypayments
License: MITView original
Contents
Where it goes: .claude/settings.json
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|Write|MultiEdit",
"hooks": [
{
"type": "command",
"command": "i=$(cat); printf '%s' \"$i\" | jq -r '.tool_input.content // .tool_input.new_string // ([.tool_input.edits[]?.new_string] | join(\"\\n\"))' | grep -qE -- '(sk|rk)_live_[0-9a-zA-Z]{16,}' && { echo 'Llave live de Stripe detectada.' >&2; exit 2; }; exit 0"
}
]
}
]
}
}
More in Hooks
Format on edit
Runs Prettier on every file Claude edits or creates.
Block .env files
Prevents Claude from reading or editing secret files.
Notify when done
macOS desktop notification when Claude finishes.
Typecheck on edit
Runs tsc after editing TypeScript files and shows the errors.
Session context
Loads the branch and latest commits when a session starts.
Command log
Saves every shell command to an audit log.