Drop-in replacement for claude -p that drives the interactive TUI via PTY, preserving subscription billing
Find a file
jedarden 4a38e8f6a3 Phase 2: implement PTY open and fork in pty.rs
Adds PtySpawner struct that calls openpty() for master/slave fds, forks,
and runs login_tty on the child side before it exits. Fixes nix feature
flag (pty module is gated by `term`, not a `pty` feature in nix 0.29).
Adds mock-claude workspace stub so the workspace resolves cleanly.

Unit test: fork_and_login_tty_does_not_panic passes (child exits 0).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 16:38:14 -04:00
.beads Close bead bf-2z4: Phase 1 Crate Scaffold complete 2026-06-07 16:04:27 -04:00
docs gap-review round 10: 3 gaps fixed 2026-06-07 14:24:50 -04:00
src Phase 2: implement PTY open and fork in pty.rs 2026-06-07 16:38:14 -04:00
test-fixtures/mock-claude Phase 2: implement PTY open and fork in pty.rs 2026-06-07 16:38:14 -04:00
Cargo.lock Phase 2: implement PTY open and fork in pty.rs 2026-06-07 16:38:14 -04:00
Cargo.toml Phase 2: implement PTY open and fork in pty.rs 2026-06-07 16:38:14 -04:00
README.md Remove prior art references; expand plan to full feature set and test coverage 2026-06-07 10:35:10 -04:00

claude-print

Drop-in replacement for claude -p (print/headless mode) that drives the Claude Code interactive TUI via PTY — preserving subscription billing after the June 15, 2026 Agent SDK credit split.

Why this exists

Starting June 15, 2026, Anthropic separates claude -p (headless) into a separate Agent SDK credit pool ($100$200/month on Max plans). Only the interactive TUI (cc_entrypoint=cli) continues drawing from the unlimited subscription. claude-print wraps the interactive TUI in a PTY so callers get claude -p wire-compatible output while billing against the subscription.

Structure

  • docs/notes/ — design decisions, constraints, integration details
  • docs/plan/plan.md — complete implementation plan