# Repository Briefing: elidickinson/pi-claude-bridge
> Source: https://repoforai.com/repo/elidickinson/pi-claude-bridge (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/elidickinson/pi-claude-bridge
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: JavaScript
- **License**: MIT
- **Engineering Health**: A (86/100 · Maintenance 35/35 · Adoption 20/25 · Releases 11/20 · License 20/20)
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: CLI
- **Momentum**: 878 ★ total (+1 24h / +18 7d) · 231 forks
- **When to Use**: Best for: Pi users who want to keep Pi's tools and branching workflow while using a Claude Code login, and whose extensions keep prompts and history stable across turns. Skip if: You need offline inference, depend on Claude Code hooks for tool authorization, frequently rewrite request history, or run the same session from multiple processes.

## Overview
```text
### Architecture & Core Mechanics
pi-claude-bridge is a Node.js model-provider extension for Pi, not a standalone inference server. Pi renders prompts, holds the user-facing conversation, and supplies tools. The extension sends that input to a Claude Code subprocess through @anthropic-ai/claude-agent-sdk and bridges the Pi tools back into the turn. The manifest also lists @modelcontextprotocol/sdk, cc-session-io, @earendil-works/pi-ai, and @earendil-works/pi-coding-agent.

The harder part is keeping Pi history aligned with Claude Code's on-disk sessions. Before a fresh query, the bridge compares conversation content: unchanged history resumes the same session; tree navigation, edits, forks, and clones use records up to a safe shared prefix; model or instruction changes import Pi history into a new session. Session pointers, content digests, and record IDs persist under claude-bridge/sessions/ in Pi's agent directory so matching can recover after restart. Compaction and branch summaries use isolated queries rather than altering the live session.

### Key Capabilities & Differentiators
The claude-bridge/... selector is populated from pi-ai's Anthropic catalog, omitting dated snapshots. The bridge also lists Mythos 5.1 and 5.2, but listing does not grant access: accounts outside approved programs receive a 404. Long-context support can reach 1M tokens; Opus 4.6 requires the matching Max-class plan configuration or, on Pro, Extra Usage, while Sonnet 4.6 uses the Extra Usage option. forceTwoHundredK provides a per-model 200K fallback. Pi's modelOverrides do not reliably change bridge model limits.

Pi skills and prompt or message edits reach Claude Code. By default, Pi's system prompt follows Claude Code's preset; the preset can be disabled. Mid-turn steering arrives at the next tool boundary, and bridged Bash commands get a 120-second timeout. The extension does not render a quota display itself: it exposes available rate-limit fields through Pi's after_provider_response event, and an event that arrives after a turn can surface on the next provider call.

### Trade-offs & Limitations
The closest alternative, pi-claude-code, runs claude -p each turn and rewrites requests through a local proxy. The bridge avoids that on-the-wire rewrite by using the Agent SDK, but takes on the complexity of synchronizing native session records. Prompt changes can trigger a full uncached import and discard prior thinking; transient context messages can repeatedly invalidate cache reuse. Rewritten suffixes may also lose Claude Code file snapshots, and two bridge processes must not operate on the same Pi session concurrently.

The permission boundary is not identical to native Claude Code. User-level Claude hooks can run on normal turns, project hooks are not loaded, and isolated summary queries do not run hooks. Do not rely on Claude Code permission rules or PreToolUse hooks to block tools; enforce authorization in Pi. Local MCP config is blocked by default and cloud MCP is always blocked. The extension's MIT license is separate from Anthropic's service terms, and subscription coverage and Extra Usage billing should be checked before adoption.

### Hardware & Deployment Guide
Use Node.js 20+ and Pi 1.5.1 or newer. Install with pi install npm:pi-claude-bridge, authenticate with claude auth login rather than Pi's /login, then select a claude-bridge/... model. Provider settings live in ~/.pi/agent/claude-bridge.json; pathToClaudeCodeExecutable can point to an installed Claude binary if the bundled one cannot run. Inference is remote. Locally, size for Pi, Claude Code subprocesses, tool workloads, and session storage rather than model weights or GPU memory.

Claude Code inherits Pi's environment, so exported Anthropic endpoint or credential variables can override the intended login path. Provider-scoped env values in ~/.pi/agent/auth.json can override or remove them; HOME, USERPROFILE, and CLAUDE_CONFIG_DIR are excluded there because session lookup relies on Pi's values. npm run test:unit runs offline; npm test adds API-backed integration tests that spawn Pi and Claude Code and need write access to ~/.claude. The supplied GitHub snapshot lists no latest release, so there is no tagged release milestone to assess.
```

## Key Capabilities
```text
- Provider routing: claude-bridge/... model IDs use Claude Code's Agent SDK path, separate from Pi's anthropic/... provider.
- Session reconciliation: content digests and record IDs identify the reusable history prefix across restarts, forks, and edits.
- Summary isolation: cacheRetention: "none" routes compaction and branch-summary requests away from the live Claude Code session.
- Context controls: forceTwoHundredK pins selected models to 200K; Opus 4.6 and Sonnet 4.6 have plan-dependent 1M options.
- Tool boundaries: MCP strict mode blocks configured local MCP servers by default, cloud MCP is always blocked, and tool authorization belongs in Pi.
- Quota integration: Claude Code rate-limit events become anthropic-ratelimit-unified-* headers on Pi's after_provider_response event.
```

## Quick Start / Clone
```bash
pi install npm:pi-claude-bridge
```
