ClaudeSuperPower
U

UserPromptExpansion (^claude-security:claude-security$)

Hook Official

A 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

  1. Session start
  2. Prompt submitted
  3. Prompt expansion
  4. Before tool use
  5. After tool use
  6. Notification
  7. Before compaction
  8. Subagent finished
  9. Turn finished
  10. Session end

Observes onlyEmits messages or context. It never returns a permission decision.

What it runs

Executed automatically when the event fires — no prompt, no confirmation.

command
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.

settings.json
{
  "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.