claude-code-slack-stop-hook.json A developer published a Claude Code hook that posts a Slack notification when an agent turn runs longer than two minutes, letting users step away from long runs and be pulled back when they finish. The hook uses UserPromptSubmit to stamp a turn's start time to /tmp and a Stop hook to read it back, firing a Slack incoming webhook with a member mention when the elapsed time meets a configurable threshold (default 120 seconds). The Stop hook runs async so it adds no latency, and missing stamp files from /clear, resume, or compact cause it to exit quietly. A Claude Code https://docs.claude.com/en/docs/claude-code hook that posts to Slack when a turn takes longer than two minutes, so you can walk away from long agent runs and get pulled back when they're done. 1. Save 1-notify-long-turn.sh to ~/.claude/hooks/notify-long-turn.sh , then chmod +x it. 2. Create a Slack incoming webhook https://api.slack.com/messaging/webhooks and export the URL as SLACK WEBHOOK URL . 3. Set MENTION in the script to your own Slack member ID Slack profile - More - Copy member ID . Without the mention the message is silent -- the mention is what makes Slack actually notify you. 4. Merge 2-settings-snippet.json into ~/.claude/settings.json , replacing the paths with absolute ones. settings.json does not expand $HOME . Requires jq and curl . UserPromptSubmit stamps the turn's start time to /tmp . Stop reads it back, and if the turn ran = THRESHOLD SECS default 120 it posts to the webhook. A missing stamp file means the Stop came from /clear , a resume, or a compact, so there's nothing to time and the hook exits quietly. The Stop hook is async , so it never adds latency to your turn. - THRESHOLD SECS -- raise it if you get pinged too often. - Stamp files are per-session in /tmp ; a session that dies without a Stop leaves one behind. Harmless, but rm /tmp/claude-turn-start- clears them. The webhook call is fire-and-forget: output is discarded, so the hook reports success whether or not Slack accepted the post. Fine for a personal nudge, but don't debug Slack delivery by trusting that message.