kcosr/claude-pty-wrapper — explained in plain English
Analysis updated 2026-05-18
Pipe Claude's replies into another script or tool as clean text or JSON.
Automate Claude sessions from the command line without scraping terminal output.
Resume an existing Claude session and capture only the output from the new turn.
Integrate Claude output capture into a CI pipeline or custom tool.
| kcosr/claude-pty-wrapper | adrianhajdin/job_pilot | cneuralnetwork/pracdago | |
|---|---|---|---|
| Stars | 20 | 20 | 20 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | moderate | hard | moderate |
| Complexity | 3/5 | 4/5 | 2/5 |
| Audience | developer | developer | vibe coder |
Figures from each repo's GitHub metadata at analysis time.
Requires the Claude CLI already installed and available on PATH.
claude-pty-wrapper is a TypeScript tool that lets you run Claude, Anthropic's AI assistant, through a command-line interface in a way that makes its output easier to capture and work with programmatically. Normally, Claude's interactive mode is designed for human use in a terminal, but this wrapper adds a layer that can capture what Claude says and stream it out in structured formats that scripts and other tools can consume. The core idea is a PTY, a pseudo-terminal, which tricks Claude into thinking it is talking to a real user terminal, while the wrapper reads the session log files Claude writes and re-emits the assistant's responses. You can ask it to output plain text, a JSON object, or a streaming JSON format that resembles Claude's own verbose output. You can also resume previous conversations by providing a session ID. You would reach for this tool if you are building automation or pipelines around Claude's command-line interface and need to capture its responses reliably, rather than trying to scrape raw terminal output. For example, you might pipe Claude's answers into another script, integrate it with a CI step, or build a thin wrapper for your own tool. It is marked experimental, so it is best validated against your own workflow before depending on it in production. Installation is straightforward via npm, and the project includes a test suite with smoke tests that run against a fake Claude executable.
A command line wrapper that runs Claude in a terminal emulator and streams its replies as text, JSON, or JSON lines for scripts.
Mainly TypeScript. The stack also includes TypeScript, Node.js, node-pty.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.