u/DurianDiscriminat3r

Claude -p is moving to metered pricing on June 15, so I built a drop-in-ish replacement that runs through interactive Claude Code

I have a bunch of tools and workflows built around claude -p aka print mode. With the June 15 change moving claude -p and Agent SDK into a separate credit pricing, I'll be paying out the wazoo if I want to continue using those tools.

So I built clarp: an open source CLI meant to be a drop-in replacement for claude -p for local tools.

In most projects, the migration is changing the binary name from claude to clarp.

Under the hood, it launches the normal interactive Claude Code CLI in a hidden PTY, then uses a local read-only proxy to observe the Anthropic API stream and reconstruct claude -p style output. It does not modify Claude’s requests or responses.

What works:

  • text/json/stream-json output
  • stdin prompts
  • multi-turn stream-json input
  • most Claude Code flag passthrough
  • permission forwarding
  • token-level partials via --include-partial-messages

What does not fully match native claude -p:

  • sideband/non-assistant events are not exact parity
  • some hook/task/progress events are still incomplete
  • this is aimed at local developer workflows, not a hosted service

I’d call it high parity for common claude -p use, but not a perfect reimplementation of Claude Code’s internal print-mode pipeline.

Lots of help from Claude: implementing the proxy/session pieces, writing parity tests, finding edge cases in argument parsing, and tightening the release/docs. I basically whipped Claude.

Repo: https://github.com/dn00/clarp

npm: npm install -g clarp-cli

u/DurianDiscriminat3r — 20 days ago