Dead man's switch for Claude Code — writes the handoff before your prompt cache dies.
Claude Code keeps your conversation in a 1-hour prompt cache. The moment you walk away from a long session is exactly the moment its state gets expensive to save:
deadman arms a switch every time Claude stops. Come back — it disarms, nothing happens, ever. Stay away — it pings your phone at 45m, then at 50m wakes the idle session for one last cheap read of everything and has Claude write a dated handoff. Next session in that workspace, the handoff is offered back.
14:02 ● deadman armed: auto-handoff in 50m, warn at 45m if idle └ you close the laptop and go live your life 14:47 ▲ phone: "claude idle 45m: myproject — auto-handoff in 5m unless you return" 14:52 ◆ session wakes itself — writes .claude/handoffs/2026-07-30-1452-5f3759df.md goal · verified state · decisions · next action — then stops next ● claude in that repo: "an auto-handoff was written 2h ago — read it before starting."
One bash file, needs jq. No daemon, no service, nothing resident — the switch is a Claude Code hook.
$ curl -fsSL https://raw.githubusercontent.com/thevibeworks/deadman/main/bin/deadman -o /tmp/deadman $ bash /tmp/deadman install $ deadman doctor # everything wired? $ deadman drill # 10-second live self-test drill green. the real thing runs at AFTER=3000s (50m idle).
The hard part isn't firing — it's not firing. The transcript file is not append-only while you're away: Claude writes housekeeping into it, and a turn's final message can flush to disk after the Stop hook already started. File size and mtime are lies. deadman trusts one signal only — the timestamp of the last real user/assistant entry — and re-checks every gate every 30 seconds:
| you came back | a newer sleeper superseded this one → dies instantly |
| claude exited | parent process gone → dies |
| real activity | user/assistant entry after schedule + grace → dies |
| already fired | same activity position → deduped |
| /clear, session switch | sibling session went active → aborts the fire |
Every decision lands in a host-tagged event log: deadman status shows what's armed and counting down, deadman events shows every fire and every abort with its reason. Notifications are pluggable — Bark, ntfy, terminal-notifier, or any command — and optional: with none configured the wake still fires.