Deadman chip: the dead man's switch earns a spot next to the path - #11
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/overdueWhy 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 -vand 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 onstdin_session_id, the id the CLI reports for this very render.--deadman off/STATUSLINE_DEADMAN=offdisables 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 errorclean. 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