Skip to content

Deadman chip: the dead man's switch earns a spot next to the path - #11

Merged
lroolle merged 2 commits into
mainfrom
feat/deadman-chip
Aug 10, 2026
Merged

Deadman chip: the dead man's switch earns a spot next to the path#11
lroolle merged 2 commits into
mainfrom
feat/deadman-chip

Conversation

@lroolle

@lroolle lroolle commented Aug 4, 2026

Copy link
Copy Markdown
Member

What

A new optional left-lane chip surfacing deadman — the dead man's switch that writes the handoff before your prompt cache dies:

  • [☠ armed 42m] (dim) — switch armed, counting down to the auto-handoff
  • [☠ warned 3m] (yellow) — the phone warning went out
  • [☠ due] (yellow) — fire imminent/overdue
  • nothing at all when nothing is armed, or when deadman isn't installed

Why the left lane

The chip is a lifecycle fact about this session — like path and branch, unlike the quota cluster on the right. Armed is calm bookkeeping (DIM); warned/due escalate to the STATUS-lane yellow.

Cost discipline

Absence is the hot path: one builtin command -v and the builder returns — no subshell, no render, no width. When installed, deadman chip <session_id> is a single PID-checked file read (that's the tool's documented statusline contract). Keys on stdin_session_id, the id the CLI reports for this very render.

--deadman off / STATUSLINE_DEADMAN=off disables it. ☠ (U+2620) stays text-presentation single-column — same padding rationale as the cache glyph; no U+FE0F.

Tests

321 → 331 bats, all green; shellcheck -S error clean. Unit tests cover the three states, color escalation, zero-cost absence (a marker file proves the tool is never invoked in off/empty-session paths), plus three end-to-end renders through --test.

🤖 Generated with Claude Code

A session with an armed deadman switch looks identical to one without —
until the handoff fires. The chip closes that gap: [☠ armed 42m] (dim)
counts down on the left lane, escalating to yellow at warned/due. It
keys on the session id the CLI reports for this very render, and it
lives with path and branch because it is a lifecycle fact about this
session, not a quota.

The tool is optional, so absence is the hot path: one builtin
`command -v` and the builder is out — no subshell, no state, no width.
Nothing armed (empty chip output) renders nothing too, which also makes
the negative integration test safe on hosts that really have deadman
installed. ☠ (U+2620) stays text-presentation, single column, same
padding rationale as the ≡ cache glyph.

Tests: 321 -> 331

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lroolle
lroolle merged commit d054cf4 into main Aug 10, 2026
1 check passed
@lroolle
lroolle deleted the feat/deadman-chip branch August 10, 2026 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant