Skip to content

About

A provider to access a Claude code subscription via code-code in pi

Resources

Stars

66 stars

Watchers

1 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

pi-claude-code

This Pi extension lets you use your Claude Pro or Max subscription in Pi by routing all Claude model requests through the official Claude Code CLI.

Pi still handles conversation history, approvals, compaction, and tool execution. Claude Code only talks to the model. It never runs tools itself.

Warning

The future of this extension is uncertain. Right now it works by running Pi's requests through the official Claude Code CLI in non-interactive mode (claude -p), and that usage counts against your normal Claude subscription limits. In May 2026 Anthropic announced that claude -p, Agent SDK, and third-party usage would move to a separate, smaller "Agent SDK credit" billed at API rates. Anthropic has since put that change on hold and says it will give advance notice before any future change.

Until then the extension keeps working as described here, but that could change at any time. If Anthropic changes how claude -p usage is billed, this extension may cost more, stop drawing from your subscription, or stop working altogether. See Zed's write-up for more background.

Requirements

  • Pi

  • Claude Code, installed and on your PATH:

    npm install -g @anthropic-ai/claude-code
  • A Claude subscription that you are logged into with Claude Code

Installation

pi install https://github.com/earendil-works/pi-claude-code

Then pick a model from the Claude Code Subscription (Experimental) provider in Pi.

Login and logout

Claude Code handles authentication. Log in and out with the Claude Code CLI:

claude auth login
claude auth logout

The extension uses whatever login Claude Code currently has. You don't need Pi's /login or /logout for this provider. The extension doesn't read, copy, or store your Claude Code credentials.

Run /claude-code-status in Pi to check that Claude Code is installed and logged in.

Configuration

These environment variables are optional:

  • PI_CLAUDE_CODE_COMMAND: path or name of the Claude Code executable (default: claude).
  • PI_CLAUDE_CODE_CONFIG_DIR: Claude Code config directory to use. The extension passes it to Claude Code as CLAUDE_CONFIG_DIR.

Usage and billing

Requests made through this extension count against your Claude subscription's usage quota and rate limits, the same as any other Claude Code usage. The extension does not give you separate or unlimited usage.

To avoid silently changing how you're authenticated or billed, the extension refuses to run if your environment sets an API key, proxy, Bedrock, Vertex, or Foundry override for Claude Code.

Limitations

  • The extension is experimental.
  • Branching, editing earlier messages, or changing settings mid-conversation starts a fresh Claude Code process that replays the conversation. The first response after that can be slower and may use more quota.
  • Complex tool schemas (nullable types, oneOf, allOf, anyOf) may be simplified before Claude sees them.
  • Adding or removing tools in the middle of a conversation keeps the prompt cache only on supported models. On other models it may use more quota.

For details on how the extension works internally, see ARCHITECTURE.md.

About

A provider to access a Claude code subscription via code-code in pi

Resources

Stars

66 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages