session-debugginglisted
Install: claude install-skill on-keyday/agent-harness
# Debugging live sessions (snapshot / send / exec)
## Overview
You have no TTY, so `session attach` is not for you (it splices a real local
terminal to the remote PTY). The non-TTY trio gives you eyes and hands on any
live interactive session:
```bash
harness-cli session snapshot <id> # SEE the current screen (read-only)
harness-cli session send -enter <id> <text> # TYPE keystrokes (co-write, no takeover)
harness-cli session exec <id> <cmd>... # RUN one shell cmd, wait, get output + exit code
```
All three authenticate with your task ticket's `exec_attach` capability — no
operator PSK. `snapshot` is a read-only `view` attach and never disturbs
whoever is driving; `send`/`exec` co-write into the live PTY without taking
over the human controller and without resizing. The human may be attached in
parallel — that is expected.
Get `<id>` from `harness-cli session ls` (interactive sessions) or `ls`
(all tasks) — pipe it into a variable; never hand-type a 32-hex id.
## Choosing the tool
- Foreground is a **POSIX shell** (bash/zsh/sh — incl. one reached over ssh or
inside a netns) → **`exec`**: synchronous, greppable output, real exit code.
- Foreground is **anything else** (TUI, REPL, claude, full-screen app) →
**`send` + `snapshot` loop**. `exec` on a non-shell foreground finds no
completion marker and times out with a diagnostic — that timeout is your
signal to switch.
- Target is a **claude worker you're coordinating** (tasks, corrections) →
the