Sarvam Code for VS Code
Run Sarvam Code inside VS Code. Chat with the agent, review diffs, approve actions, and resume past conversations — all without leaving your editor.
The extension speaks the Sarvam Code app-server protocol directly over stdio (not the ACP adapter), enabling fork/side conversations, structured HITL questions, and full config control.
Features
- Inline chat panel in the sidebar with streaming responses, reasoning timeline, and full Markdown rendering
- Tool call display — collapsible cards show what the agent is doing: reading files, editing code, running commands, with per-tool-type icons and inline diff previews
- Permission prompts — approve or reject agent actions before they execute, with auto-approve modes
- Elicitation & structured input — MCP forms and
request_user_input questions render inline
- Fork & side conversations —
/fork branches into a new tab; /side opens a bottom panel overlay so you can ask questions while keeping the main thread visible
- Composer dropdowns — switch collaboration mode and model from the input area
- Send while busy — queue messages during a turn (max 5)
- @mention files — type
@ to reference workspace files as context
- Slash commands — populated from
command/list with autocomplete
- Session resume — pick up a previous conversation from thread history
- Cancel support — stop a turn mid-stream via
turn/interrupt
Requirements
- VS Code 1.85 or later
- The
sarvam-code CLI with app-server support installed and on your PATH
curl -fsSL https://sarvam.ai/install.sh | bash
Quick Start
- Install this extension
- Open a workspace folder in VS Code
- Click the Sarvam Code icon in the Activity Bar
- Start chatting
The extension starts sarvam-code app-server automatically and pre-creates a thread so your first message is instant.
Commands
| Command |
Description |
Sarvam Code: Open Chat |
Focus the chat panel |
Sarvam Code: New Session |
Start a fresh conversation |
Sarvam Code: Resume Session |
Pick a past session and continue it |
Sarvam Code: Cancel |
Cancel the current prompt turn |
Settings
| Setting |
Default |
Description |
sarvamCode.executablePath |
"" |
Path to the sarvam-code binary. Leave empty to auto-detect. |
sarvamCode.autoApprove |
"ask" |
Permission handling: ask, allow-read, or allow-all. |
sarvamCode.model |
"" |
Model override passed to the CLI on startup. |
sarvamCode.approvalPolicy |
"" |
Approval policy override for the CLI. |
sarvamCode.sandboxMode |
"workspace-write" |
Sandbox mode override for the CLI. |
Development
Day-to-day: use the debugger — no VSIX packaging needed.
- Open this repo in VS Code (not Cursor, if you want to match production VS Code).
- Run Run and Debug → Run Extension (Watch) (or press F5).
- A second Extension Development Host window opens with the extension loaded from
dist/.
npm run watch rebuilds dist/ on save (esbuild + Tailwind).
After code changes:
| What changed |
What to do in the dev host window |
Extension host (src/extension/**) |
Debug toolbar → Restart Extension |
Webview (src/webview/**) |
Command Palette → Developer: Reload Webview, or reload the window |
| Both |
Developer: Reload Window |
Set breakpoints in src/extension/** — they hit in the original VS Code window while you exercise the UI in the dev host.
npm install # install dependencies
npm run build # production build (Tailwind CLI + esbuild)
npm run watch # watch mode (used by F5 debug config)
npm run compile # type-check only (tsc --noEmit)
npm test # unit tests (vitest)
npm run package # package as VSIX (only for installs / releases)
See AGENTS.md for build commands, design tokens, and webview conventions.
License
MIT