Skip to main content

Drive Claude Code headlessly in a tmux session — script and automate the claude CLI.

Project description

🪈 pipper

pipper — drive Claude Code, headlessly

Drive Claude Code headlessly in a tmux session — script and automate the claude CLI from shell, cron, or code.

python deps license


pipper is a tiny harness that runs the interactive claude CLI inside tmux, auto-accepts its permission dialogs, sends a prompt, and returns Claude's answer. It lets you call Claude Code from scripts, cron jobs, pipelines, or another program — without sitting at the terminal.

It drives your normal, already-logged-in claude client, so it inherits whatever plan and limits that login has. Use it within Anthropic's terms of service.

Why

  • Automate Claude Code in CI, cron, or batch jobs
  • Glue it into other tools — get an answer back as text or JSON
  • TUI-version-proof — instead of scraping the terminal, pipper asks Claude to write its answer to a temp file, then reads it back

Requires

  • tmux
  • the claude CLI — installed and already authenticated (claude runs without a login prompt)

Install

pip install pipper-cli      # once published; command is `pipper`
# or from source:
git clone https://github.com/sanjoxtech/pipper && cd pipper && pip install -e .

Zero dependencies — Python stdlib only.

Use

pipper "summarize this repo's README in 3 bullets"
echo "list the riskiest lines in auth.py" | pipper --cwd ./myproject
pipper -f task.txt --timeout 900 --json

Options: --cwd <dir>, --session <name>, --timeout <s>, --boot-timeout <s>, --json.

From Python:

import pipper
answer = pipper.run("explain what this project does", cwd="./repo")

How it works

  1. Spawns claude --permission-mode bypassPermissions in a fresh tmux session
  2. Auto-accepts the startup/permission dialogs (handles different orderings + plain y/n)
  3. Pastes your prompt via an isolated tmux buffer (so parallel runs don't clash)
  4. Asks Claude to write its final answer to a temp file, then polls that file
  5. Returns the answer; tears the session down; bails early on repeated API errors

Limitations / honest notes

  • Relies on tmux + the interactive claude TUI. If Claude Code changes its startup dialogs a lot, the auto-accept heuristics may need a tweak.
  • bypassPermissions means Claude can run tools without asking — only point it at directories you trust.
  • It automates your normal claude login; respect Anthropic's usage terms and rate limits.

Author

Built by Sanjay (sanjoxtech) — sanjox.tech · sanjox.tech@gmail.com

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipper_cli-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipper_cli-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file pipper_cli-0.1.0.tar.gz.

File metadata

  • Download URL: pipper_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pipper_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1903935a2b1f55e33ec2cac88d56aec8c321763bbe7ffc1d73028d19e047d8b3
MD5 97f8b99cdd6cbfbae5bac397b5a68ee8
BLAKE2b-256 4e6d016239a870103c5b24bda05960486868805c336b3c9375757e368e26abcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipper_cli-0.1.0.tar.gz:

Publisher: publish.yml on sanjoxtech/pipper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipper_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pipper_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pipper_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36bd3037ecba8f3cb4382644450e8f2c95d6c3d2d1f340482d4222b609df2fef
MD5 9a7316b11149c524c20c54d07e32de56
BLAKE2b-256 dfd002c4d08c8ffdc8f748b75da45d55850fe8fe8496af4989ec35d69a201385

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipper_cli-0.1.0-py3-none-any.whl:

Publisher: publish.yml on sanjoxtech/pipper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page