Know when a Claude Code scheduled task or routine didn't run
Add one line to a Claude Code routine, /loop or scheduled task so a missed or failed run alerts you.
Claude Code can run shell commands, so the simplest heartbeat is a curl at the end of the job. If a routine silently disappears or never fires, the ping never arrives and you get an alert.
Option A: tell the routine to ping when it's done
Add this to the end of the task / routine prompt:
When you have finished, run this exact command and nothing else:
curl -fsS -m 10 --retry 3 -X POST https://diditrun.app/p/YOUR-TOKEN \
-H "Content-Type: application/json" \
-d '{"items": <number of items you produced>, "text": "<one-line summary>"}'
If anything failed, run instead:
curl -fsS -m 10 --retry 3 -X POST https://diditrun.app/p/YOUR-TOKEN/fail -d "<what went wrong>"Set Minimum item count to 1 on the watch to catch "succeeded but produced nothing" runs.
Option B: wrap a headless run in a script
If you trigger Claude Code from cron, launchd or CI with claude -p, wrap it:
#!/usr/bin/env bash
URL="https://diditrun.app/p/YOUR-TOKEN"
curl -fsS -m 10 --retry 3 "$URL/start" > /dev/null
if out=$(claude -p "Write today's changelog summary" 2>&1); then
curl -fsS -m 10 --retry 3 -X POST --data-binary "$out" "$URL" > /dev/null
else
curl -fsS -m 10 --retry 3 -X POST --data-binary "$out" "$URL/fail" > /dev/null
fiThe output is sent as the body, so Minimum body size and Required keyword checks work on it.
Option C: no shell? Email (coming soon)
Once email check-ins launch, Claude apps that deliver results by email or to a connected inbox will be able to forward those messages to the watch's address. Until then, relay them to the ping URL with an inbox-watching automation (n8n, Make or Zapier). The watch address will look like:
your-watch-k3j9x2m4@in.diditrun.app