Hacker News new | ask | show | jobs
AgentPTY: Script Claude Code’s interactive CLI through a persistent PTY (github.com)
2 points by quietforgelabs 32 days ago
1 comments

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?