claudeers.
// Claude Plugins

pi-claude-directsdk

Use Claude Code subscription as LLM provider for Pi without breaking Anthropic ToS.

// Claude Plugins[ cli ][ api ][ web ][ mobile ][ claude ]#claude#anthropic-claude#claude-code#claude-code-plugin#claude-sdk#npm-package#pi#pi-agent#plugins◷ MIT$open-sourceupdated about 1 month ago
Actively maintained
100/100
last commit 7 days ago
last release 7 days ago
releases 12
open issues 1
// star history

Install with your AI

Paste into Claude Code, Cursor, or any agent — it reads the repo and wires the tool into your project.

Install and set up pi-claude-directsdk (npm project) into my current project.
Found on https://claudeers.com/pi-claude-directsdk
Repo: https://github.com/joaomj/pi-claude-directsdk
Homepage/docs: —
Detected install method: npm → npm install pi-claude-directsdk
Category: plugins. Platforms: cli, api, web, mobile.
Read the repo's README for exact setup and env vars, then install it and wire it into my project.

Claudeers Health Verdict:
active; community-verified: false. Confirm the source before running anything.
// or install directly (npm)
npm install pi-claude-directsdk
// or clone
git clone https://github.com/joaomj/pi-claude-directsdk

// compatibility

Platformscli, api, web, mobile
Operating systems—
AI compatibilityclaude
LicenseMIT
Pricingopen-source
LanguageTypeScript

Get your FREE $2.50 API credits to access TickAtlas financial data ↗

Pi Claude DirectSDK

Use Claude inside Pi through the unmodified Claude Code executable. Pi owns the transcript, tools, approvals, and retries. The CLI supplies subscription authentication as a model transport.

Capabilities:

  • Run sonnet, opus, haiku, and versioned routes as Pi models, including claude-haiku-5-5.
  • Execute Pi tools (read, bash, edit, write, codemode) with Claude models.
  • Resume sessions with exact replay of native signed thinking.
  • Switch providers mid-session; foreign thinking replays as ordinary assistant text.
  • Refresh model routes, limits, and prices from Claude Code and Anthropic documentation.
  • Work in interactive, print (-p), and resumed sessions.

Limits:

  • One Pi model call spawns one request-scoped claude process.
  • One Pi model call produces at most one upstream Messages request.
  • The provider never manages login, never reads credentials, and never falls back to another billing route.
  • Required strict constrained decoding (strict: "require") is rejected. See docs/architecture.md.

Requirements

  • Node 20 or later.
  • Claude Code in the qualified range >=2.1.263 <2.2.0 (see QUALIFIED_CLI_RANGE in src/models.ts).
  • A Claude paid plan. The free plan excludes the CLI.
  • A Claude Code login via claude auth login.

The installed-Pi harness is verified with Pi 1.1.0 and Claude Code 2.1.281. Verification includes offline startup and a paid request from a complete existing-session fork.

Install

Install the qualified Claude Code version:

npm install -g --ignore-scripts=false @anthropic-ai/[email protected]

Sign in through the official CLI login:

claude auth login

Install the extension, then restart Pi:

pi install git:github.com/joaomj/pi-claude-directsdk

Refresh model catalogs once before selecting a DirectSDK model on a fresh install:

pi update --models

Then start Pi with a DirectSDK model:

pi --model claude-directsdk/haiku

DirectSDK uses the CLI login, not the Pi Anthropic login. The npm install flag enables the Claude Code installer for that command only.

The model catalog does not guarantee account entitlement. Start with haiku for a small request. Models that require usage credits can incur separate charges. To use only the included subscription allowance, disable additional paid usage in your Claude account.

Use

Start Pi with the local extension without installing it:

pi -e ./extensions/claude-directsdk/index.ts

Open /model and wait for catalog refresh. Then select a DirectSDK model. Later invocations can use the verified snapshot:

pi -e ./extensions/claude-directsdk/index.ts --list-models claude-directsdk
pi -e ./extensions/claude-directsdk/index.ts -p --model claude-directsdk/sonnet -- "Hello."

Startup performs no CLI probes or web requests. Pi restores only a previously verified catalog snapshot, labeled as such. A fresh offline install has no DirectSDK models. Interactive Pi refreshes catalogs in the background after the editor is ready.

Refresh uses Claude Code's account picker and Anthropic's public model, pricing, and effort documentation. Models absent from the account picker are labeled not in CLI picker; their account entitlement is unverified. Missing required metadata excludes the affected model with a warning. A failed refresh reports the error and removes the snapshot. There is no pinned fallback.

The request transport still loads on the first Claude request. See docs/startup.md for behavior and limits.

Configuration

SettingPurpose
CLAUDE_DIRECTSDK_COMMANDOverride the claude executable path.
CLAUDE_DIRECTSDK_CONFIG_DIRPoint at a logged-in CLI config directory.
CLAUDE_CODE_OAUTH_TOKENSupply a token from claude setup-token in the environment Pi runs in.

See docs/troubleshooting.md for login and environment errors.

Verify

npm test

This runs offline startup verification through your installed Pi and consumes no subscription allowance. Real model requests and complete-session replay require explicit approval. See docs/testing.md.

Costs

Per-model cost metadata comes from Anthropic’s pricing documentation. Pi reports it as an estimate, never as a subscription charge. Failed or interrupted requests are never reported as free.

Documentation

DocumentContents
docs/architecture.mdRequest lifecycle, model routing, tool transport, admission relay.
docs/startup.mdCache-only initialization and lazy loading.
docs/testing.mdInstalled-Pi harness, paid scenarios, and complete-session replay.
docs/troubleshooting.mdMissing CLI, logged-out CLI, conflicting environment.

Acknowledgments

Behavioral reference: Hermes Claude Subscription DirectSDK (MIT). This project copies its behavior contract, not its code.

License

MIT. See LICENSE.

// faq

What is pi-claude-directsdk?

Use Claude Code subscription as LLM provider for Pi without breaking Anthropic ToS.. It is open-source on GitHub.

Is pi-claude-directsdk free to use?

pi-claude-directsdk is open-source under the MIT license, so it is free to use.

What category does pi-claude-directsdk belong to?

pi-claude-directsdk is listed under plugins in the Claudeers registry of Claude-compatible tools.

15 views
★ 38 stars
unclaimed
updated about 1 month ago

// embed badge

pi-claude-directsdk on Claudeers
[![Claudeers](https://claudeers.com/api/badge/pi-claude-directsdk.svg)](https://claudeers.com/pi-claude-directsdk)

// retro hit counter

pi-claude-directsdk hit counter
[![Hits](https://claudeers.com/api/counter/pi-claude-directsdk.svg)](https://claudeers.com/pi-claude-directsdk)

// reviews

// guestbook

0/500

// related in Claude Plugins

🔓

A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.

// pluginsmultica-ai/★ 230,631[ claude ]
🔓

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explainin…

// pluginsanthropics/⟨Python⟩★ 154,558[ claude ]
🔓

"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/

// pluginsHKUDS/⟨Python⟩★ 58,467◷ Apache-2.0[ claude ]
🔓

financial-services — a Claude ecosystem project on GitHub.

// pluginsanthropics/⟨Python⟩★ 41,027◷ Apache-2.0[ claude ]
→ see how pi-claude-directsdk connects across the ecosystem