Drop-in replacement for claude -p that drives the interactive TUI via PTY, preserving subscription billing
Critical: - G-1: HR-8 vs Signal Handling contradiction resolved — SIGINT handler now sends SIGINT (not SIGTERM) to child High: - G-2: Event Loop timer is not a timerfd; Instant::elapsed() with poll() timeout parameter instead - G-3: Signal handler safety specified: AtomicBool, kill(2), self-pipe to wake blocked poll() - G-4: NEEDLE invoke_template now includes --no-inherit-hooks; AS-3 pass criterion now achievable - G-5: Error output per format: text→stderr only; json→stdout JSON; stream-json→final error line Medium: - G-6: Child resets SIGINT+SIGTERM to SIG_DFL before execvp (signal handler inheritance) - G-7: "weekly schedule" claim removed; version-compat tests run on every push (CI already covers it) - G-8: needle-transform-claude defined as NEEDLE's built-in transform for claude JSON output - G-9: Integration tests use --claude-binary <path-to-mock_claude> via CARGO_MANIFEST_DIR - G-10: XTVERSION probe accepts both ESC[>q and ESC[>0q (parameterized form) - G-11: Install Script renumbered 1-8 with clean integers (removed decimal 2.5/3.5 steps) - G-12: T-6 threat (PATH hijack) added to threat model Low: - G-13: Config path respects $XDG_CONFIG_HOME when set Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| docs | ||
| README.md | ||
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 detailsdocs/plan/plan.md— complete implementation plan