ClaudeSuperPower
S

SessionEnd (clear|resume|logout|prompt_input_exit|bypass_permissions_disabled|other)

Hook

Fires on

SessionEndmatchingclear|resume|logout|prompt_input_exit|bypass_permissions_disabled|other

Once, as the session closes.

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· timeout 180s
bash "${CLAUDE_PLUGIN_ROOT}/scripts/hook.sh" claude SessionEnd

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": {
    "SessionEnd": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bash \"${CLAUDE_PLUGIN_ROOT}/scripts/hook.sh\" claude SessionEnd",
            "timeout": 180
          }
        ],
        "matcher": "clear|resume|logout|prompt_input_exit|bypass_permissions_disabled|other"
      }
    ]
  }
}

Source

Read this before installing — it runs on your machine with your permissions.

#!/bin/bash
DIR="$(cd "$(dirname "$0")" && pwd)"

if [[ -n "$WSL_DISTRO_NAME" ]]; then
  exec "$DIR/hook-windows-amd64.exe" "$@"
fi

case "$OSTYPE" in
  darwin*)
    case "$HOSTTYPE" in
      arm64) exec "$DIR/hook-darwin-arm64" "$@" ;;
      aarch64) exec "$DIR/hook-darwin-arm64" "$@" ;;
      *)     exec "$DIR/hook-darwin-amd64" "$@" ;;
    esac ;;
  linux*)
    case "$HOSTTYPE" in
      aarch64) exec "$DIR/hook-linux-arm64" "$@" ;;
      *)       exec "$DIR/hook-linux-amd64" "$@" ;;
    esac ;;
  msys*|cygwin*)
    exec "$DIR/hook-windows-amd64.exe" "$@" ;;
  *)
    echo "unsupported platform: OSTYPE=$OSTYPE" >&2
    exit 2 ;;
esac

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.