
pi-claude-directsdk
Use Claude Code subscription as LLM provider for Pi without breaking Anthropic ToS.
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.
npm install pi-claude-directsdk
git clone https://github.com/joaomj/pi-claude-directsdk
// compatibility
| Platforms | cli, api, web, mobile |
|---|---|
| Operating systems | — |
| AI compatibility | claude |
| License | MIT |
| Pricing | open-source |
| Language | TypeScript |
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, includingclaude-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
claudeprocess. - 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(seeQUALIFIED_CLI_RANGEinsrc/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
| Setting | Purpose |
|---|---|
CLAUDE_DIRECTSDK_COMMAND | Override the claude executable path. |
CLAUDE_DIRECTSDK_CONFIG_DIR | Point at a logged-in CLI config directory. |
CLAUDE_CODE_OAUTH_TOKEN | Supply 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
| Document | Contents |
|---|---|
| docs/architecture.md | Request lifecycle, model routing, tool transport, admission relay. |
| docs/startup.md | Cache-only initialization and lazy loading. |
| docs/testing.md | Installed-Pi harness, paid scenarios, and complete-session replay. |
| docs/troubleshooting.md | Missing 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.
// embed badge
[](https://claudeers.com/pi-claude-directsdk)
// retro hit counter
[](https://claudeers.com/pi-claude-directsdk)
// reviews
// guestbook
// related in Claude Plugins
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
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…
"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/
financial-services — a Claude ecosystem project on GitHub.