U
Fires on
UserPromptSubmitEvery time you send a message, before Claude sees it.
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.
command· timeout 3s
bash ${CLAUDE_PLUGIN_ROOT}/hooks/check-version.shInstall 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": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/check-version.sh",
"timeout": 3
}
]
}
]
}
}Source
Read this before installing — it runs on your machine with your permissions.
#!/usr/bin/env bash
#
# Runs on every UserPromptSubmit. Silent unless the plugin version changed.
# When it changes, injects a one-line notice into the conversation context.
#
set -uo pipefail
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-}"
[[ -z "$PLUGIN_ROOT" ]] && exit 0
VERSION_FILE="$PLUGIN_ROOT/.claude-plugin/plugin.json"
[[ -f "$VERSION_FILE" ]] || exit 0
current=$(python3 -c "import json,sys; d=json.load(open(sys.argv[1])); print(d['version'])" "$VERSION_FILE" 2>/dev/null) || exit 0
[[ -z "$current" ]] && exit 0
SEEN_DIR="${HOME}/.claude"
SEEN_FILE="$SEEN_DIR/mp-plugin-seen-version"
mkdir -p "$SEEN_DIR" 2>/dev/null || exit 0
seen=$(cat "$SEEN_FILE" 2>/dev/null || echo "")
if [[ "$current" != "$seen" ]]; then
echo "$current" > "$SEEN_FILE" || exit 0
if [[ -n "$seen" ]]; then
echo "[Mercado Pago plugin updated: v${seen} → v${current}. Run /mp-connect to verify your connection.]"
fi
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.