Settings

Theme

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

github.com

2 points by quietforgelabs 6 days ago · 1 comment

Reader

quietforgelabsOP 6 days ago

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?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection