Skip to content

deadman chip: show the armed dead man's switch countdown #10

Description

@lroolle

thevibeworks/deadman v0.2.0 ships a statusline contract: deadman chip <session-id> prints armed 42m, warned 3m, or nothing (PID-checked, one file read from $TMPDIR/deadman/.meta).

Proposal: a session-identity chip next to the cctrace one (statusline.sh ~3118 pattern) — dim while armed, amber once warned:

# deadman chip: is a dead man's switch armed for this session?
build_deadman_chip() {
    command -v deadman >/dev/null 2>&1 || {
        [ -x "$HOME/.claude/deadman/bin/deadman" ] || return 0; }
    local dm
    dm="$("${DEADMAN_BIN:-deadman}" chip "$session_id" 2>/dev/null)"
    [ -n "$dm" ] || return 0
    case "$dm" in
        warned*) echo " ${YELLOW}[dm $dm]${RESET}" ;;
        *)       echo " ${DIM}[dm $dm]${RESET}" ;;
    esac
}

Why it fits: the switch is invisible between the Stop announce and the phone warn; the statusline is exactly where "something is counting down on this session" belongs. Cost is one subprocess + one file read, only when deadman is installed.

Happy to send the PR if the chip is wanted.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions