Use Claude Subscriptions for Agent Workflows via PTY Wrapper
Run Claude agents cheaply by wrapping claude in a pseudo-terminal instead of using expensive API rates
About this automation
Claude-pee is a Rust wrapper that runs Claude in a PTY (pseudo-terminal), injects input, captures the session transcript from jsonl, and uses a stop hook to detect completion. It acts as a drop-in replacement for claude code, forwarding all arguments except '-p' and enabling subscription-based programmatic usage.
How to implement
Install claude-pee (Rust binary, MIT license)
Replace 'claude' command with 'claude-pee' in your agent/automation scripts
Use '-p' flag to enable programmatic mode: claude-pee -p 'your prompt'
Claude runs in PTY, transcript captured from session jsonl file
Stop hook detects completion and returns results
Integrate with OpenClaw, Hermes, or other agent frameworks