Automate Claude Code inside a script or CI pipeline when the built-in claude -p mode does not behave as needed.
Extract JSON or streaming JSON formatted output from a scripted Claude Code session.
Study how terminal automation tools drive interactive CLI programs through a pseudo-terminal.
Use Claude Code programmatically from a custom Zig application via the included library.
| smithersai/claude-p | coder/boo | andrewrk/zig-general-purpose-allocator | |
|---|---|---|---|
| Stars | 280 | 368 | 52 |
| Language | Zig | Zig | Zig |
| Last pushed | — | — | 2020-08-08 |
| Maintenance | — | — | Dormant |
| Setup difficulty | moderate | easy | easy |
| Complexity | 3/5 | 2/5 | 3/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires the real claude Claude Code CLI already installed on PATH, macOS or Linux only, no Windows support.
claude-p is a command line tool that acts as a drop in replacement for the claude -p command in Claude Code, Anthropic's coding assistant. The problem it addresses: the official claude -p flag runs Claude in a non interactive, one shot mode useful for scripting, but this wrapper replicates that same output by instead driving the full interactive Claude Code terminal interface behind the scenes and extracting the result. The way it works is by spawning the interactive Claude terminal application inside a simulated terminal session, called a PTY or pseudo terminal, feeding it your prompt automatically through hooks, waiting for the model to finish responding, reading the session transcript, and then printing the result in the format you requested, whether plain text, JSON, or streaming JSON. From the outside, it looks and behaves like the standard non interactive mode, accepting the same flags for output format, model selection, maximum turns, and more. The README lists several caveats: it only works on macOS and Linux, not Windows, it requires the real claude command line tool already installed on your system, it does not stream tokens live the way claude -p can, it adds a small delay of roughly 50 to 200 milliseconds compared to the original command, and multiline prompts need to be passed through a file or standard input rather than typed directly. You would use this if you are automating Claude Code in scripts or pipelines and run into cases where the standard non interactive mode does not behave as needed. The repository itself states it exists for educational purposes and to demonstrate that client side restrictions on how a tool is used are difficult to enforce. It is written in Zig and released under the MIT license.
claude-p is a command-line wrapper that mimics Claude Code's non-interactive claude -p mode by secretly driving the full interactive terminal interface behind the scenes.
Mainly Zig. The stack also includes Zig, PTY, Claude Code.
Use freely for any purpose, including commercial use, as long as you keep the copyright notice, under the MIT license.
Setup difficulty is rated moderate, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.