Drop-in replacement for claude -p that drives the interactive TUI via PTY, preserving subscription billing
https://jedarden.com โ// momentum
// why it's here
- Active: last commit today
- Built almost entirely by one person
- Health 69/100 with only 5 stars
- 17 open issues handled by one or two people
// how to help
// readme
claude-print
Drop-in replacement for claude -p (print/headless mode) that drives the Claude Code interactive TUI via PTY โ keeping sessions on the unlimited subscription pool rather than the per-token Agent SDK credit pool.
Why this exists
Anthropic routes claude -p (headless/SDK mode) through a separate Agent SDK credit pool ($100โ$200/month on Max plans). Only the interactive TUI (cc_entrypoint=cli) draws from the unlimited subscription.
The billing path is determined by an isatty check inside the claude binary: when stdout is a TTY, the session is tagged cc_entrypoint=cli and billed against the subscription. When stdout is a pipe (as with claude -p), it becomes cc_entrypoint=sdk-cli and draws from the credit pool instead.
claude-print allocates a PTY, drives the interactive TUI over it, auto-dismisses the trust dialog, injects the user prompt via bracketed paste, waits for the Stop hook via a FIFO, reads the JSONL transcript, and emits clean stdout output โ giving callers claude -p wire-compatible output while billing against the subscription.