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

Updated: 5/14/2026
Difficulty
medium
Time
30m
Use Case
Enable hobbyist and budget-constrained agent builders to run automation workflows using Claude subscriptions instead of expensive API rates
Popularity
0 views

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

1

Install claude-pee (Rust binary, MIT license)

2

Replace 'claude' command with 'claude-pee' in your agent/automation scripts

3

Use '-p' flag to enable programmatic mode: claude-pee -p 'your prompt'

4

Claude runs in PTY, transcript captured from session jsonl file

5

Stop hook detects completion and returns results

6

Integrate with OpenClaw, Hermes, or other agent frameworks