@vanillagreen/pi-claude-bridge4.2.0
Pi provider bridge that runs Claude Code through the Claude Agent SDK, with opt-in forwarding for Pi prompt context.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@vanillagreen/pi-claude-bridge
A Pi provider that uses a logged-in Claude Code account through the Claude Agent SDK. You keep Pi's terminal interface and tools while Claude Code handles model requests.

Features
- Select Claude models from Pi's model menu.
- Run Pi tool calls during Claude conversations.
- Resume the Claude conversation across Pi turns.
- Configure model effort and forwarded prompt context.
- Optionally use the Claude account's connectors.
Install
- npm:
pi install npm:@vanillagreen/pi-claude-bridge. - kendex: add the declaration below to the project's
kendex.toml, or to~/.config/kendex/kendex.tomlfor user scope. Runkendex update-pi.
[pi-extensions."@vanillagreen/pi-claude-bridge"]
source = "kendex"
Restart Pi after installation. Use kendex update-pi --check to preview the installation. A Claude Code login is required. Make claude available on PATH or set its executable path below.
Fable 5.1 requires Claude Code 2.1.255 or later. This includes any executable chosen through pathToClaudeCodeExecutable or found on PATH, which takes precedence over the SDK's bundled CLI. Account access and usage-credit requirements still apply.
How it works
- You pick one of the
pi-claudemodels in Pi's model menu; Claude Fable 5.1 ispi-claude/claude-fable-5-1. - The bridge starts Claude Code, or resumes it, through the Claude Agent SDK, Anthropic's library for driving Claude Code from another program.
- It sends your prompt to Claude Code and offers it Pi's tools.
- When Claude Code calls a tool, Pi runs the tool and sends the result back to Claude Code.
- Pi shows the reply and remembers which Claude Code conversation it belongs to, so your next message continues it.
Memory use
- The tool names, full tool arguments and parked tool results of one Claude Code query are released when that query ends, so an idle session holds none of them.
Prompt context
The bridge sends the nearest context file and Pi's skills list with the prompt. It checks AGENTS.override.md, AGENTS.md and AGENTS.MD while walking up from the working directory. With no context file found, it falls back to the one in the Pi agent directory (~/.pi/agent, or PI_CODING_AGENT_DIR), unless the loaded settings sources include user. Then Claude Code's own user CLAUDE.md and output style carry the global instructions. This rule follows the loaded sources, not the connectors switch. The nearest project context file and Pi skills still append when appendSystemPrompt is on. Claude Code loads its own CLAUDE.md files. Use the prompt settings above to forward other Pi extension instructions.
Connectors
Connectors are disabled by default. Set enableConnectors in user settings, user claude-bridge.json, or the CLAUDE_BRIDGE_ENABLE_CONNECTORS environment variable. Project settings cannot enable them.
Connector access is read-only unless connectorWriteMode is exactly allow. Set CLAUDE_BRIDGE_CONNECTOR_WRITE=allow only for a dedicated process running an approved write. Keep it out of persistent settings. Use /pi-claude:connectors to list the account's connectors.
With connectors enabled, Claude Code loads user settings by default. An explicit provider.settingSources list in claude-bridge.json wins verbatim with connectors on or off. For example, {"provider":{"settingSources":["user"]}} loads Claude user settings while connectors stay off and Pi's project context and skills still append. The Pi agent-directory fallback follows the loaded sources as described in Prompt context. Including project or local settings lets those files affect the subprocess.
With connectors off, the bridge pins ENABLE_CLAUDEAI_MCP_SERVERS to 0 in both the child environment and command-line settings. User settings cannot turn it back on. Strict MCP config also stays on, even if strictMcpConfig is false, so only MCP servers declared by the bridge load.
Setup
The settings editor writes project values to .pi/settings.json. The default user file is ~/.pi/agent/settings.json. PI_CODING_AGENT_DIR changes the user directory. Package values are stored under kendex.extensionManager.config["@vanillagreen/pi-claude-bridge"].
Open /extensions:settings; settings appear under the Pi Claude tab, and /pi-claude opens the same tab. Project settings in .pi/settings.json apply only after Pi marks the workspace trusted. The bridge also reads claude-bridge.json in ~/.pi/agent and in a trusted project's .pi/; a value taken from one of those files is shown with the file that supplies it, and editing it in the panel writes Pi settings, which win.
enabled: register thepi-claude/*models; reload required.appendSystemPrompt: the context file and skills block described above.includeAppendSystemPromptMd,includeProjectAgentsHook,includeTaskPanelHook,includeCavemanHook: forwardAPPEND_SYSTEM.mdand the prompt blocks ofpi-agents-tmux,pi-task-panelandpi-caveman. Each is off by default because it adds Pi prompt text to every Claude Code request, so each block is sent only after the user turns it on.strictMcpConfig,fastMode,pathToClaudeCodeExecutable: how the Claude Code subprocess is launched.forceEffort,modelEffortOverrides: pin a Claude effort for every request or per model. Override keys are bare ids (claude-opus-4-8),pi-claude/<id>or*; values arelow,medium,high,xhighormax; a per-model entry beats the global force.
Environment variables:
CLAUDE_BRIDGE_STREAM_IDLE_TIMEOUT: how long a turn may stay silent before its first output; bare numbers are seconds,ms,sandmsuffixes are accepted,0disables.CLAUDE_BRIDGE_DEBUG=1: write the bridge log, the integrity diagnostics and per-query Claude Code CLI logs under the Pi agent directory;CLAUDE_BRIDGE_DEBUG_PATHandCLAUDE_BRIDGE_DIAG_PATHmove the two log files. Nothing is written to disk without it.CLAUDE_BRIDGE_ISOLATED=1: for embedding hosts that own every config directory; the bridge then reads nothing from the working directory or home. Details in DEVELOPMENT.md.
Tool-result integrity problems always surface as a Pi error notification plus a metadata-only claude-bridge-integrity entry in the Pi session file, so a lost tool result can be analysed from the session alone.
Maintainer notes, the embedding and account-router contracts, and the test suites are in DEVELOPMENT.md.