You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add first-class support for Anthropic's Claude Code as a selectable agent inside pi-web, alongside the existing pi agent. Today the drawer/composer assumes the pi agent's session model exclusively; running CC requires an external terminal and gives up the entire pi-web session UX.
Motivation
Many of us already use Claude Code daily for the same kinds of tasks pi handles. Forcing a context switch to a terminal pane for CC defeats the purpose of pi-web's tab/drawer/marker/folder UX.
CC's session files (~/.claude/...) follow a different layout than pi's (~/.pi/agent/sessions/...). A small adapter layer can normalise both into the existing SessionInfo shape so the drawer, marker buckets, pinned tabs, search, etc. all "just work".
CC has its own user / project / plugin slash commands and skills. Surfacing those in the composer's slash-command palette is a natural extension once the agent is wired up.
Proposed scope
A first cut should include:
Agent abstraction in server.ts — extract a small interface (start session, stream events, list sessions, fork, rename, delete, send message) and have both pi and claude-code implement it. Pick the implementation per-tab from a UI selector or per-cwd default.
Claude Code adapter — wraps the CC CLI / SDK and translates its event stream into pi-web's existing agent_event envelope (text deltas, tool start/end, message_end, agent_end, errors, replay).
Session translator — read CC's on-disk session format and project it onto pi-web's SessionInfo (id, title, cwd, firstMessage, updatedAt, etc.) so the drawer renders CC sessions next to pi sessions, with the agent shown as a small badge / icon.
Open-anywhere session lookup — when a CC session is clicked, search across every cwd we know about (CC's per-project session dirs are not 1:1 with pi's). Cache the lookup so the common case stays cheap.
Slash-command bridge — surface CC's user / project / plugin commands and skills in the composer's slash-command palette, keyed off the active agent.
Tests — unit tests for the translator + adapter (event mapping, error paths), and Playwright e2e covering the end-to-end agent UI on a CC session (replay, tool turn, slash command).
Notes / context
Locally I have a working prototype that does all of the above (feat(claude-code): add Claude Code agent alongside pi and follow-ups). Happy to clean it up and open a PR against main once the upstream direction is confirmed — wanted to file the issue first so the design choices (single adapter interface vs per-agent server modules; how to identify the active agent in SessionInfo; whether to ship a CC selector in the drawer footer or in settings) can be discussed before code review.
Summary
Add first-class support for Anthropic's Claude Code as a selectable agent inside pi-web, alongside the existing pi agent. Today the drawer/composer assumes the pi agent's session model exclusively; running CC requires an external terminal and gives up the entire pi-web session UX.
Motivation
~/.claude/...) follow a different layout than pi's (~/.pi/agent/sessions/...). A small adapter layer can normalise both into the existingSessionInfoshape so the drawer, marker buckets, pinned tabs, search, etc. all "just work".Proposed scope
A first cut should include:
server.ts— extract a small interface (start session, stream events, list sessions, fork, rename, delete, send message) and have bothpiandclaude-codeimplement it. Pick the implementation per-tab from a UI selector or per-cwd default.agent_eventenvelope (text deltas, tool start/end, message_end, agent_end, errors, replay).SessionInfo(id, title, cwd, firstMessage, updatedAt, etc.) so the drawer renders CC sessions next to pi sessions, with the agent shown as a small badge / icon.Notes / context
feat(claude-code): add Claude Code agent alongside piand follow-ups). Happy to clean it up and open a PR againstmainonce the upstream direction is confirmed — wanted to file the issue first so the design choices (single adapter interface vs per-agent server modules; how to identify the active agent inSessionInfo; whether to ship a CC selector in the drawer footer or in settings) can be discussed before code review.Out of scope (for now)
Acceptance criteria