UserPromptExpansion (^claude-security:claude-security$)
Hook OfficialA display-only banner: on the /claude-security menu it prints the Claude Security banner as a systemMessage. It fires only on UserPromptExpansion for that slash command. It is a sensor: it emits a message and never returns a permission decision.
Fires on
UserPromptExpansionmatching^claude-security:claude-security$While a slash command is being expanded into a full prompt.
Where this sits in a session
- Session start→
- Prompt submitted→
- Prompt expansion→
- Before tool use→
- After tool use→
- Notification→
- Before compaction→
- Subagent finished→
- Turn finished→
- Session end
Observes only — Emits messages or context. It never returns a permission decision.
What it runs
Executed automatically when the event fires — no prompt, no confirmation.
sh "${CLAUDE_PLUGIN_ROOT}/hooks/banner_hook.sh"Install it yourself
Paste into .claude/settings.json to run this hook without installing the whole plugin. Adjust the paths to point at your own copy of the scripts.
{
"hooks": {
"UserPromptExpansion": [
{
"hooks": [
{
"type": "command",
"command": "sh \"${CLAUDE_PLUGIN_ROOT}/hooks/banner_hook.sh\""
}
],
"matcher": "^claude-security:claude-security$"
}
]
}
}Source
Read this before installing — it runs on your machine with your permissions.
#!/bin/sh
if python3 -c 'import sys' >/dev/null 2>&1; then
python3 "$(dirname -- "$0")/banner_notice.py"
else
printf '%s\n' '{"systemMessage":"\n⚠️ Claude Security needs a working python3 (3.9 or newer) on PATH and could not run one. Install Python 3, then start a new session.\n"}'
fi
exit 0
Shipped by 1 plugin
Installing any of these installs this hook.
Reviews
Log in to leave a review.
No reviews yet — be the first.
Explore related
Other things in this space — across every part of the ecosystem, not just hooks.