Call Claude Code from a script and capture just the text reply.
Stream every event of a Claude Code session as JSON for another program to consume.
Use claude-pee as a drop in alias for the claude command in automation contexts.
| sbhattap/claude-pee | ion-elgreco/rivers | funinkina/openeffects | |
|---|---|---|---|
| Stars | 45 | 45 | 44 |
| Language | Rust | Rust | Rust |
| Setup difficulty | moderate | moderate | moderate |
| Complexity | 3/5 | 4/5 | 4/5 |
| Audience | developer | data | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Rust 1.85+ and a working install of the official Claude Code CLI on PATH.
claude-pee is a small command line tool written in Rust that wraps the official Claude Code CLI so it can be driven programmatically, as if a person were typing into it. Instead of replacing Claude Code, it starts the real claude program inside a virtual terminal, gives that session a fresh ID, and then watches what happens inside it. The main use is sending a single one shot prompt with the -p flag and getting back just the assistant's reply on the command line, either as plain text, as JSON, or as a live stream of JSON events. This makes it possible to call Claude Code from scripts, other programs, or automation pipelines, rather than only from an interactive terminal session. A key design detail is how it knows when Claude has actually finished answering. Rather than guessing based on the screen going idle, claude-pee registers a Stop hook with Claude Code for that session only. When Claude finishes a turn, that hook creates a small marker file, claude-pee notices it, sends an exit command, and shuts down cleanly with the same exit status as the underlying program. Several environment variables let a user tune behavior, such as how long to wait before typing the prompt, how fast to simulate typing, and which claude binary to run. It can also be used as a drop in replacement for the claude command itself through a shell alias, without causing infinite loops, because it looks up the real binary through the system path. Installation requires Rust 1.85 or newer and is done by building the project with cargo and copying the resulting binary onto the system path. The project is aimed at developers who want to script or automate interactions with Claude Code rather than type into it by hand, and the source code is organized into small modules covering argument parsing, configuration, terminal handling, and the hook based shutdown logic.
A Rust CLI that wraps Claude Code so scripts can send it prompts and read back replies automatically.
Mainly Rust. The stack also includes Rust, Cargo.
No license information is provided in the README.
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.