claude-wrap-conptylisted
Install: claude install-skill Nucs/Agentmaster
# Driving the Claude Code TUI under ConPTY
Claude Code's interactive mode is an **Ink (React-for-terminals) TUI**. It only behaves like
itself when its stdin/stdout is a **real TTY** — on Windows that means a **pseudo-console
(ConPTY)**. A plain pipe makes it degrade or refuse; `claude -p` is a different, non-interactive
code path entirely.
So this is the harness for everything `-p` can't reach: the input box, startup modals, paste
framing, type-ahead queuing, draft handling, and the "the TUI ate my submit Enter" class of bug.
**The contract:** drive it like a user (bytes into a pty), but **never assert on the screen** —
assert on the **transcript on disk**. The screen repaints constantly and is a rendering, not a
fact. The screen is for *waiting* and *diagnosing*; the `.jsonl` is for *verifying*.
## Quickstart
```bash
S=".claude/skills/claude-wrap-ConPTY/scripts/conpty_claude.py"
python "$S" selftest --cwd "C:/some/trusted/dir" # 11 checks, one tiny turn — run this first
python "$S" probe --cwd "C:/some/trusted/dir" # spawn, wait for the box, dump the screen
python "$S" send "What is 2+2?" --verify --wait-idle --cwd "C:/some/trusted/dir"
python "$S" raw --seconds 10 --out raw.txt # the escape stream, for parser work
```
Exit codes: `0` ok · `1` verification failed · `3` blocked by a startup modal · `4` never ready.
Add `--answer-modals` to auto-answer known modals that have a safe answer (read the caveat in
§3 before you rely on it). The **screen goes t