Back to browse
GitHub Repository

Use Claude Code programmatically as an interactive user

55 starsRust

Claude-pee: use Claude -p without the programmatic usage credit pool

by subarnab·May 14, 2026·7 points·2 comments

AI Analysis

●●●BangerBig BrainWizardry

PTY injection and stop-hook parsing bypass Anthropic's expensive programmatic credit pool.

Strengths
  • Termination driven by Claude's native Stop hook avoids flaky screen-idle heuristics.
  • Drop-in replacement forwards all arguments verbatim except the consumed -p flag.
  • Session transcript tailing extracts assistant replies without modifying the underlying binary.
Weaknesses
  • Relies on Anthropic not changing the CLI output format or hook behavior.
  • Ethical gray area that could violate terms of service for paid subscriptions.
Target Audience

Developers using Claude Code CLI for automation

Similar To

llm-proxy · LiteLLM

Post Description

Anthropic announced today that starting June 15, paid Claude plans get a separate monthly credit pool for programmatic usage (claude -p, Agent SDK). Seems OK at first glance but it turns out the monthly credit pool is charged at API rates, which effectively kills any serious programmatic usage for hobbyists.

This is a small Claude Code wrapper which runs claude in a PTY, injecting input, finding the session transcript jsonl file, and using a stop hook to determine when claude is done.

It's a drop-in replacement for claude code. All arguments except the "-p" argument are forwarded as-is.

claude-pee -p "hello world"

Could be used as a cheap way of using Anthropic subscriptions for OpenClaw, Hermes, etc.

Written in Rust, MIT license.

Similar Projects