Crate shoutout: portable-pty vt100.
These two crates let you spawn a process in a pseudo-terminal and parse the output stream into a structured screen buffer. No fragile regex against raw terminal output.
We use them to classify agent state — idle, working, or dead — by reading the terminal screen structure, not specific strings. Works across Claude Code, Codex, Aider, or any CLI.
The kind of infrastructure that's invisible when it works and impossible to replace.