explaingit

equality-machine/claude-p

Analysis updated 2026-05-18

55PythonAudience · developerComplexity · 3/5LicenseSetup · easy

TLDR

A CLI and Python library that gives scripts programmatic access to Claude Code through your existing interactive login session.

Mindmap

mindmap
  root((claude-p))
    What it does
      Programmatic Claude Code access
      Uses subscription login
      Reads session log file
    Tech stack
      Python
      Claude Code
    Compatibility
      Matches claude -p flags
      Text JSON stream-json
      SDK-style Python API
    Use cases
      Automate scripts
      Run evals and CI
      Call from Python code
    Audience
      Developers
      Automation builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Run Claude Code from a script or automation pipeline when the standard programmatic mode isn't available.

USE CASE 2

Call Claude Code from Python code using an SDK-style interface without a separate API key.

USE CASE 3

Get JSON or streaming JSON output from Claude Code for use in CI-like workflows or evals.

What is it built with?

PythonClaude Code

How does it compare?

equality-machine/claude-pbhartiyashesh/purelymailcalendargnipbao/codex-whiteboard-video-skill
Stars555555
LanguagePythonPythonPython
Setup difficultyeasymoderatehard
Complexity3/54/53/5
Audiencedevelopergeneralvibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires Python 3.10+ and an existing local Claude Code login, it does not bypass Anthropic account rate limits.

Use freely for any purpose, including commercial use, as long as you keep the copyright and license notice.

In plain English

claude-p is a command line tool and Python library that lets people use automated, script-friendly access to Claude Code, Anthropic's coding assistant, through the same login session as the interactive app they already use. It is built to solve a specific gap: in some setups, the interactive Claude Code app works fine with a subscription login, but the separate programmatic mode normally used for scripts and automation is limited, capped, or unavailable. Instead of calling that programmatic mode directly, claude-p starts the regular interactive Claude Code application in the background inside a virtual terminal, gives it a specific session id, waits for it to finish responding, and then reads the response from Claude Code's own session log file rather than trying to capture what appeared on screen. The project's README explains that reading this log file is more reliable than scraping terminal output, since terminal displays can drop or garble characters due to cursor movement and redrawing. The tool is designed to be a near drop-in replacement for the existing programmatic command, matching many of the same command line flags and output formats, including plain text, JSON, and a streaming JSON format. It also ships a Python library shaped similarly to Anthropic's official Agent SDK, so a developer can write code that sends a prompt and reads back a response using familiar patterns. Installing it is done through either the uv tool or a standard pip install, and it requires Python 3.10 or newer. The README is direct about its limits. It states clearly that this is a developer convenience tool, not a replacement for the official Anthropic API, and that it does not bypass authentication, billing, or rate limits since it still relies on the user's existing authenticated session and account restrictions. Some features, like replaying certain event types or accepting streaming input, are not yet fully implemented. It is released under the MIT license, a permissive open source license, and is distributed through PyPI.

Copy-paste prompts

Prompt 1
Walk me through installing claude-p and running my first command with it.
Prompt 2
Explain how claude-p reads Claude Code's session log instead of scraping the terminal.
Prompt 3
Help me convert my existing claude -p script to use claude-p instead.
Prompt 4
What are the current known limitations of claude-p compared to the official Anthropic API?

Frequently asked questions

What is claude-p?

A CLI and Python library that gives scripts programmatic access to Claude Code through your existing interactive login session.

What language is claude-p written in?

Mainly Python. The stack also includes Python, Claude Code.

What license does claude-p use?

Use freely for any purpose, including commercial use, as long as you keep the copyright and license notice.

How hard is claude-p to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is claude-p for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.