A headless wrapper around the
claudeTUI for programmatic use.
Claude supports programmatic access via claude -p, but that usage is billed separately from your interactive subscription and can get expensive. claupe is a wrapper around the claude TUI that allows you to use it in a headless way, so your requests still bill against your interactive subscription instead.
Install it globally using:
npm install -g claupeThen you can run:
claupe "<prompt>" # positional prompt
git diff | claupe "review" # stdin is appended to the prompt
claupe -p "<prompt>" # -p accepted for muscle memoryEach invocation is a fresh claude conversation. You can use claupe in scripts, cron jobs, or just for quick questions in the terminal.
- Every call cold-starts claude (~3s). Fine for cron and one-shot scripts; bad for tight loops.
--dangerously-skip-permissionsis required so claude can run the callback unattended. Only run claupe in workspaces where that's acceptable.- No defense against prompt injection in piped stdin. If you
cat untrusted.txt | claupe ...and the file contains adversarial instructions, claude may follow them. With--dangerously-skip-permissionsthat includes shell commands. Only pipe content you trust. - The interactive/programmatic split is Anthropic's call, not a hard technical line. If they later decide to flag TUI traffic that comes from a PTY without a real human, this trick stops working.
MIT License