Pi for VS CodeUse your existing Pi providers, models, and tools in VS Code.
Ask about code in concurrent Sidebar conversations, independent editor sessions, or native Permission boundary: Focused edit workflows generate proposals under a read-only policy and require explicit Apply. Ordinary agent sessions can run tools and change files without Preview and Apply. Pi and installed extensions own tool and shell permissions; without a permission policy, actions can run with no confirmation. Install · Get started · Workflows · Settings · Security · Documentation See the workflowAttach context and ask
Choose Attach, inspect the captured context, and enter your question. The model control selects the model and thinking level. Review a focused edit
Run Pi: Modify Selection (Preview), describe the change in the Sidebar composer, and choose Send. Choose Choose Hunks if needed, then Preview to open the native diff editor. Apply becomes available after preview; changing the hunk selection requires another preview. Pi replies have a Requirements
The extension bundles Pi 1.5.2 and uses it by default without a separate Pi or Node.js installation.
An unset, empty, or whitespace-only Pi runs as a subprocess on the workspace Extension Host, including in Remote SSH, WSL, and container windows. Bundled Pi reuses that host's existing Pi configuration, credentials, resources, provider environment, and sessions without migration or separate user stores. Configure providers on that host. Extension releases own bundled runtime updates; ordinary terminals and external Pi installations remain unchanged. Missing or invalid bundled assets fail without PATH fallback or automatic operation replay. See Runtime selection and recovery and validation coverage for compatibility limits and unverified targets.
External Pi on Windows supports native executables and standard npm Node shims, not custom batch wrappers. See Windows process launches for lookup and cleanup limits. InstallThe extension ID is
If the VS Code
Marketplace installation does not require Get started
When new messages arrive, the panel preserves text selection in messages that remain in the current window. Tool input/output Copy buttons use the VS Code clipboard. Pasting text with an image keeps both. After Enter, the draft stays until Pi accepts it; Sending this message shows this pending state. Rejected submissions keep the text, and acceptance does not clear a newer draft or move focus from the transcript. While Pi accepts queued instructions, the composer shows Stop and Steer as icons. Choose Steer or press Enter to send after the current tool; press Alt+Enter (Ctrl+Q on Windows, including Remote WSL) for a Follow-up after the response. Type Select editor text and choose Pi → Ask About Selection, the Ask Pi code action, or Ctrl+Alt+A (Cmd+Alt+A on macOS) to add an unsent reference above the Sidebar composer. Add more selections, remove individual references, and describe what to discuss or change for each file/range before sending. This targets the stable Primary Sidebar session and keeps its draft; it does not open a separate question input or send immediately. Selecting an auxiliary Sidebar conversation or focusing an editor panel does not redirect editor actions. The other selection-menu actions also prepare a labelled read-only action before Send, without replacing your text. Modify Selection (Preview) needs a description; the other presets show their default request and accept extra details. Cancel removes only the pending action, keeping references and text. Prepared read-only actions wait for idle Pi instead of entering the ordinary queue; Preview actions still require Preview before Apply. The Sessions list fills the available space above the composer and scrolls when needed, rather than showing only three entries.
Choose View all to search the discovered sessions in this workspace.
If an unnamed saved session starts with a skill, its title shows the Use Pi: Switch Session to search live and saved Sidebar sessions in the current workspace, or Pi: Previous Session / Pi: Next Session to cycle through them. Default shortcuts use Ctrl+K, then Ctrl+Alt+Shift+S / Left / Right; on macOS use Cmd+K, then Cmd+Alt+Shift+S / Left / Right. Native navigation shows the selected conversation, even if the Sidebar was hidden. If an editor panel owns the session, navigation focuses that panel and cycling continues from its position. Cycling keeps its order while sessions are updated. Selecting another conversation does not stop active requests, queues, or source-bound input dialogs. Actual RPC session mutations and exclusive workspace actions retain their existing idle and ownership gates. See session switching for discovery limits and recovery behavior. Use Concurrent Sidebar sessionsStart work in A, return to Sessions, and select live B, open a saved B, or create a new conversation while A continues.
View all, Pi: Switch Session, Previous/Next Session, New Session, and Resume Session use the same Sidebar selection.
Each conversation retains its transcript, draft, attachments, queue, model/thinking selection, and Stop.
Cancelled or rejected selection leaves session rows usable; selecting an editor-owned session can reveal its panel without locking Sidebar navigation.
Selecting a retained conversation or recreating its renderer resends referenced image payloads from the bounded host cache.
Native session navigation can initialize Primary when the Sidebar has not opened yet.
Local A status icon appears before each title in Recent Sessions and View all. After a request completes, the saved-session list refreshes in the background without delaying the reply or the next request. The green Running ring rotates unless reduced motion is enabled. Hover over a row to see the status name, or use a screen reader to hear it. See the status icon legend for all six states. An Unread result marker clears only after that result is rendered in visible conversation detail while following the latest output. Row selection alone, Sessions view, a hidden Sidebar, or earlier history does not acknowledge it. History loading must finish, and a shell result must be in the published transcript before its result revision can be acknowledged. Completed means the request settled, not that its answer or file changes are correct. One fixed pool permits one Primary plus eight additional runtimes in total across Sidebar conversations and editor panels. Retained idle conversations and cleanup-quarantined sessions count toward the additional eight. Open an additional Sidebar session directly without a confirmation dialog. Use Close Session on an auxiliary Sidebar conversation to stop only its work and discard its unsent memory-only state after confirmation, without deleting saved Pi history. Hiding the Sidebar does not close conversations. Primary labels the stable window-service owner, not the selected or busiest conversation. Terminal handoff/recovery, restart, annotations, editor actions, review/repair, settings, authentication, and public bridge broadcast stay Primary-owned. Auxiliary conversations support ordinary conversation controls, but omit or reject privileged routes like editor sessions. Selection or panel focus never silently redirects global commands. Sessions share files without worktree isolation. Activity, unread state, auxiliary transcripts, and auxiliary restore references are memory-only; reload does not restart auxiliary work or replay queues. Optional draft recovery keeps its existing consent and shared limits, without additional persistent transcript keys. See concurrent Sidebar sessions and current validation. Offline unit, browser, and VS Code 1.146.0 native checks passed; platform, remote, and screen-reader limits remain in the linked validation. Concurrent editor sessionsRun Pi: New Concurrent Session ( Sessions share workspace files and existing Pi credentials, configuration, and storage; they are not isolated or sandboxed. Sidebar navigation commands select conversations through Sessions; editor-panel focus does not redirect them. Other existing global integrations, including editor actions, review, and repair, target Primary. Terminal handoff/recovery, confirmed restart, and temporary annotations remain Primary-only and are omitted from auxiliary routes. Ordinary requests can overlap, but direct shell, session/resource controls, Apply, import, and checkpoint restore keep their exclusive workspace gates. Concurrent activity can make checkpoint restoration unavailable. If you select Stop while Pi prepares the workspace checkpoint, the extension cancels the request before it sends the prompt. After Pi responds, large checkpoints use the same background worker to verify file changes before the request releases its workspace lease. The extension rechecks matched files before offering to revert them. Editor panels do not automatically restore or restart after window reload. After a panel closes and writer cleanup is verified, resume its saved session through the sidebar. Auxiliary Sidebar and panel transcript caches and restore references stay in memory; optional text draft recovery uses the shared consent-gated store and existing limits. A late send acknowledgement cannot remove a newer retained draft written by another view, even when its text is the same. See concurrent editor sessions for writer-ownership and recovery limits. Earlier editor-session validation recorded offline host and Chromium checks and a focused macOS VS Code 1.146.0 native check for two editor sessions and independent Stop. Those results do not establish final verification of Sidebar concurrency or the shared pool. Remote, other platforms, reload, and live-provider limits remain separate. See the validation coverage. Focused workflows
See workflow instructions and limits and the feature matrix. Responses support Markdown, highlighted code, math, and supported Mermaid diagrams with bundled rendering assets. Mermaid loads only when a supported diagram is ready to render. During streaming, unchanged completed code and diagram blocks can stay in place. Tool calls appear in conversation order between responses, each collapsed by default. Expand a call to inspect its input, output, and status. History navigation keeps responses accessible when tool calls reach a window limit. Recent text-only history windows can be reused in memory; initial load, refresh, and request completion still fetch the full active branch from Pi. The Primary Sidebar agent can add temporary passage annotations: whole-line highlights, literal hovers and read-only native comments below the marked code or text. Comments start collapsed by default. Set SettingsIn the Pi view title's native ⋯ overflow menu, Extension Settings and Pi Configuration appear directly in the same configuration group, in that order.
There is no standalone settings gear or settings submenu.
Composer More… remains for session and work actions; it has no duplicate entries for these commands.
Run Pi: Extension Settings ( Run Pi: Pi Configuration ( Global Pi uses the Extension Host's
See the settings reference and native Pi settings and MCP controls. Security and limitsOrdinary agent sessions are not a sandbox. Pi and installed extensions own tool and shell permissions; pi-vscode adds no built-in tool or shell confirmation policy. Without a permission policy, tools and commands can run with no confirmation. Pi-requested dialogs continue to be displayed unchanged. Focused edit generation uses a read-only policy. Applying proposals, importing worktree results, rerunning tests, and restoring checkpoints require explicit user action. Preview checks do not protect unrelated ordinary-agent tool calls. The selected provider receives prompts and approved context under its own data policy. Inspect attachments before sending; sensitive-filename warnings are best-effort. Stop or process exit does not prove that every detached descendant stopped. Inspect remaining work before repeating an uncertain command. Short operation results and recovery instructions stay in the Sidebar. Choose Show Output on a diagnostic notice to open Output → Pi without taking editor focus. The shared log uses VS Code log levels and records safe technical categories, not conversation content or credentials. Use VS Code's built-in log-level controls for Debug/Trace command timing. VS Code log files can outlive the window; review them before sharing. Persistent Pi RPC accepts single lines up to 64 MiB, increased from 5 MiB; larger frames are rejected with a fixed Sidebar notice and a safe Output category.
After a fatal transport failure, no new RPC command or dialog reply is written to that client, including during cleanup.
Public Read Security and Privacy for trust and logging boundaries, and operational limits for attachment, review, repair, and history bounds. Upgrade from the old extension IDDo not keep both extension IDs installed. Stop old work and preserve sessions and worktree results before removing the old extension. Follow the complete migration instructions, including settings and bridge identifier changes. Persistent Pi session files remain separate from VS Code extension state. Documentation
DevelopmentSee Development and release for build, test, screenshot-capture, and release commands. No installation or publication is required to run the offline tests. License |

