Live data from Hacker News

AgentPTY: Script Claude Code’s interactive CLI through a persistent PTY

github.com

1–2 of 2 posts

Re: AgentPTY: Script Claude Code’s interactive CLI through a persistent PTY

#2
Hi HN, author here.

I made this to explore a local tooling boundary: Claude Code’s interactive mode is treated differently from headless modes like `claude -p` or the Agent SDK, but at the OS level an interactive terminal program is still something software can drive.

AgentPTY keeps Claude Code alive inside a PTY, uses hooks to detect turn completion, and exposes a localhost HTTP API. It is not meant to be a polished framework; it is a concept demo for scripting an interactive CLI.

The part I’m most interested in: if a CLI is interactive, is it meaningfully non-scriptable?