Command Code for VS Code
Run Command Code in VS Code with native chat, session management, and agent approvals.
The extension adds a Sessions tree to the Activity Bar and an agent panel in the Secondary Side Bar or an editor tab. It includes the agent runtime and shares sessions, sign-in, preferences, skills, and MCP servers with the Command Code CLI.
Open the Extensions view in VS Code (Cmd + Shift + X, or Ctrl + Shift + X on Windows and Linux). Search for Command Code for VS Code and select Install. Available on the VS Code marketplace.
The extension id is commandcode.commandcode-vscode. It requires VS Code 1.106 or newer and a Command Code account. Install it with the Command Code CLI, using the same setup as IDE Integration: run cmd from the VS Code integrated terminal, run /ide inside a session, or run cmd --ide-setup.
You can also set up the extension through the CLI: run cmd in the VS Code terminal, use /ide inside a Command Code session, or run cmd --ide-setup. See IDE Integration.
See IDE Integration for more details.
Open Command Code
Click the Command Code icon in the Activity Bar or press Cmd + Shift + ' (Ctrl + Shift + ' on Windows and Linux).
Sign in
Select Continue with Command Code to sign in through your browser, or enter an API key.
Start a session
Create a session, enter your prompt, and choose a model from the composer.
Review changes
Approve edits from the permission card. Select Open in editor on a diff card, then Keep Change or Revert Change in the diff toolbar.
Manage sessions from the Sessions tree in the Activity Bar.
- Click New Session to start a session, or select an existing session to resume. You can also use
/resumeor/sessionsin chat. - Hover over a session and click … to rename or delete it. Running sessions cannot be deleted.
- Sessions are grouped by date. The tree includes the workspace, Git worktrees, and subfolders by default. Configure this with
commandcode.sessions.aggregateRoots. - Use
/forkto copy the current conversation into a new session. Use/rewindor pressEsctwice in an empty, idle composer to return to a checkpoint. Right-click a message for Rewind to Here or Copy Message. - Use
/exportto save a transcript or/copyto copy the last response.
You can run multiple sessions in the sidebar and separate editor tabs. To launch the CLI for the same project, run Command Code: Open CLI in Terminal from the Command Palette.
Use the composer to send prompts, choose models, set reasoning effort, and manage permissions. The header includes New Session, Sessions, and Settings. Goal and Queued tabs appear when needed, as does a PR chip when the current branch has an open pull request.
- Add context: Type
@for files and folders, or/for commands and installed skills. - Attach images: Paste, drag and drop, or use + to attach up to 6 PNG, JPEG, GIF, or WebP images.
- Queue prompts: Send a follow-up while the agent is working. Edit or delete it from Queued.
- Reuse prompts: Press
Up ArroworDown Arrowto browse prompt history shared with the CLI. - Choose a model or effort: Use the composer controls,
/model, or/effort. - Inspect context: Run
/contextto view session context usage, or/tasteto manage learned preferences.
Click Stop to interrupt the current turn. File paths in responses open with Cmd + Click (Ctrl + Click on Windows and Linux). Code blocks include highlighting and a copy button.
Set commandcode.preferredLocation to sidebar or tab to choose where chat opens. Run Command Code: Open Chat in Editor Tab to open the current chat in a tab, or Command Code: Open Chat in Secondary Sidebar to return. You can also use Cmd + Shift + ' to open sidebar chat.
Editor-tab chats show the session title on the tab instead of in the chat header.
Command Code uses your active file and selected code as context, so you can ask questions like "explain this" without pasting a path. The composer shows the file and line range, such as auth.ts L10–20. Click the context chip to toggle this feature.
commandcode.context.autoAttachSelection controls automatic selection sharing. commandcode.context.maxSelectionLength limits it to 2000 characters by default. Use /add-dir to grant read and write access to another directory.
Shortcuts below use macOS keys. On Windows and Linux, replace Cmd with Ctrl. Only the chat-opening shortcut works globally; the others work inside chat.
| Shortcut | Action |
|---|---|
Cmd + Shift + ' | Open chat in the Secondary Side Bar. |
Enter / Shift + Enter | Send a prompt / insert a newline. Set commandcode.composer.submitKeybinding to shiftEnter to swap them. |
Up Arrow / Down Arrow | Browse prompt history or move through / and @ menus. |
Tab | Select the highlighted menu item. |
Shift + Tab | Cycle permission modes. |
Ctrl + O | Expand or collapse thinking and tool output. |
Esc | Stop a turn, close a menu, or deny permission. |
Esc twice | Rewind when the composer is empty and idle. |
Enter / Ctrl + Y | Approve a permission request / explain a command. |
Cmd + Enter | Submit an answer to an agent question. |
Plan mode lets Command Code explore your codebase and prepare a plan without changing files. Choose it from the permission menu, press Shift + Tab, or run /plan or /plan <task>.
The plan opens as a Markdown preview beside chat. From its approval card, you can:
- Execute: Start implementation in Auto-accept mode, or Full Access mode if selected.
- Continue planning: Ask the agent to revise the plan.
- Edit the plan: Update the plan file, then select Continue planning with your edits.
Plans are saved to ~/.commandcode/plans/. Use /plans to browse them. See Plan Mode.
| Mode | Behavior |
|---|---|
| Ask for approval (default) | Ask before file edits and commands. |
| Auto-accept edits | Apply edits and run commands, but ask before risky actions. |
| Plan mode | Prepare a plan without editing files. |
| Full access | Skip permission prompts. |
Use Shift + Tab or the permission menu to switch modes. New sessions use your configured default.
Permission cards show the action and a diff for edits. Choose Allow once, Allow for this session, Allow for this project, or Deny. There is no global approval across all projects. See Permissions.
Zero Data Retention (ZDR) sessions enforce zero data retention and no prompt training on every request, like running the CLI with CMD_ZDR=1. Only ZDR-capable providers are used, which may cost more.
- Run Command Code: New Zero Data Retention Session from the Command Palette.
- Select Start ZDR Session.
- A new sidebar session opens and briefly shows a ZDR shield in the composer.
ZDR applies only to the newly created session while it is active. You cannot turn it on for an existing session, set it as a default, or restore it by resuming a session. Run the command again to start another ZDR session.
Models without ZDR providers are marked No ZDR and cannot be selected. If needed, Command Code switches to a ZDR-capable default model. Regular sessions return to your previous model selection. In /config, unsupported feature-model choices are marked No ZDR and incompatible overrides are paused.
See Zero Data Retention for provider routing and pricing.
Type / in the composer to browse commands. The menu lists only the commands the extension can run, plus installed skills with a skill badge. See the full Slash Commands reference.
Commands available only in the CLI show a message that they aren't supported in the VS Code extension. Unrecognized / commands are sent to the model as regular prompts, just like in the CLI.
See CLI vs VS Code extension for the full list.
Use /config for settings shared with the CLI, or run Command Code: Open Settings to open VS Code settings filtered to commandcode.*. The extension hides theme and force-oauth in /config because they do not apply in VS Code. See Settings & Config.
- Account:
/loginand/logoutuse credentials shared with the CLI. Signing out also signs out the CLI./usageshows plan and rate-limit usage as percentages. - MCP:
/mcplists servers, scopes, status, transport, and tools. Reconnect, disable, remove, or authenticate a server there. Add server saves to the project (.mcp.json) or user (~/.commandcode/mcp.json) configuration shared with the CLI. See MCP configuration. - Fonts: Chat uses
chat.fontSizeandchat.fontFamilywhen set, noteditor.fontSize.
| Setting | Default | Description |
|---|---|---|
commandcode.preferredLocation | sidebar | Open chat in sidebar or tab. |
commandcode.startup.autoOpen | false | Open Command Code on startup. |
commandcode.composer.submitKeybinding | enter | Send with enter or shiftEnter. |
commandcode.composer.showContextMeter | false | Show the context meter. |
commandcode.context.autoAttachSelection | true | Attach selected code automatically. |
commandcode.context.maxSelectionLength | 2000 | Maximum selection length in characters. |
commandcode.sessions.aggregateRoots | workspace+worktrees+subdirs | List sessions from workspace, workspace+worktrees, or workspace+worktrees+subdirs. |
commandcode.goal.maxTurns | 100 | Maximum turns for /goal. |
commandcode.todos.enabled | false | Show todos in the dock and /todos. |
commandcode.addDir.picker | auto | Choose auto, dialog, or overlay for /add-dir. |
Changes to preferredLocation, submitKeybinding, or showContextMeter prompt a window reload. Other settings apply immediately.
These slash commands are currently not supported in the VS Code extension. The panel declines them with a notice; run them from the CLI in the same project.
These terminal shortcuts are also unavailable:
Ctrl + Gedit the prompt in$EDITORCtrl + Sstash and restore the promptOption + Pquick model switch (use the model picker)Ctrl + Xopen the todo manager (use/todos)Ctrl + CCtrl + Cexit
Why didn't the Command Code panel open after install?
Why didn't the Command Code panel open after install?
Select the Command Code icon in the activity bar or press Cmd+Shift+' (Ctrl+Shift+' on Windows and Linux). Typing Command Code in the Command Palette will also reveal it. If it is missing, confirm the extension is enabled, that you are on VS Code 1.106 or newer, and that the workspace is trusted.
Why is Command Code disabled in this workspace?
Why is Command Code disabled in this workspace?
Command Code runs shell commands and reads workspace configuration, so it stays off in Restricted Mode and in virtual (non-filesystem) workspaces. Open the folder as a trusted workspace on a real filesystem.
Why does the Sessions view say Command Code couldn't start in this window?
Why does the Sessions view say Command Code couldn't start in this window?
Run Command Code: Show Logs to see why, then select Reload Window. Chat and sessions stay unavailable until the extension starts.
Where are the logs?
Where are the logs?
Run Command Code: Show Logs from the Command Palette to open the extension output channel. Include it when you report a problem.
Why does sign-in not return to the editor?
Why does sign-in not return to the editor?
Leave VS Code open and select Sign in again. If the browser did not open, copy the sign-in URL from the welcome screen, or paste an API key instead.
Where does the IDE bridge keep its socket?
Where does the IDE bridge keep its socket?
Session discovery files and the Unix socket that connects a terminal CLI to your editor live under ~/.commandcode/ide/, a directory created with owner-only permissions. On Windows the socket is a named pipe. The socket is a trust boundary; do not share its path.
How do I report a problem?
How do I report a problem?
Run /feedback in the panel, or open a GitHub issue and include:
- The extension version and your VS Code version.
- Operating system and architecture.
- What you did before the problem.
- What you expected and what happened.
- Logs from Command Code: Show Logs, when available.
- Install the extension.
- Compare the CLI and VS Code extension.
- Learn how permissions and plan mode work across Command Code.
- Wire up MCP servers, skills, and memory.
- Prefer the CLI in your terminal? See IDE Integration and Interactive Mode.