# VS Code extension

> Connect the VS Code chat view to your installed Kaitoi CLI, add selected code as context, and handle workspace trust, permissions, diffs, and cancellation.

Source: https://kaitoi.io/docs/cli/vscode/
Section: Kaitoi CLI / Editors and automation
Written for: Developers who want Kaitoi Code inside VS Code.
Prerequisites: VS Code 1.95 or newer and a local trusted workspace; Kaitoi CLI installed and a provided Kaitoi Code extension VSIX
Last reviewed: 2026-10-24

---

The **Kaitoi Code** extension brings a chat view, tool activity, permissions,
and diffs into VS Code. It starts your installed CLI through ACP and uses the
same Code runtime. This guide describes the extension in CLI **0.9.0**; it
does not assume that an extension Marketplace release is available.

## Connect the installed CLI

Install the provided VSIX through VS Code's **Extensions: Install from VSIX**
command. Open a local project and grant VS Code workspace trust when appropriate.
Virtual and untrusted workspaces are not supported.

Open **Kaitoi Code** in the Activity Bar and use its **Chat** view. The extension
launches `kaitoi code acp`. If VS Code cannot find the executable, set
`kaitoiCode.executablePath` to its absolute path. A bundled CLI or a PATH available
in your terminal is not necessarily visible to a separately launched editor.

## Add the relevant code

Select code in the editor, then run **Kaitoi Code: Send Selection**. This adds
the selection as context for your **next message**; it does not immediately
send a model request. Explain the intended change in chat before submitting.
The selection is a text snapshot with file context, not a live link that follows
later edits.


Selected editor text is attached to the next chat message. The extension sends
that message through its child Kaitoi Code ACP process. Text, tool activity,
diffs, and permission questions return to the editor. This is a conceptual
connection diagram, not a replica of VS Code's layout or an HTTP server setup.

Only line 19, return null, enters the selected-code attachment. Lines 18 and 20 remain outside that selection. A distinct message-dispatch boundary shows that attaching context alone does not start the turn.

*Figure: A selection becomes context for the next chat message, then travels through ACP.*

## Choose defaults for new sessions

| Setting                      | Effect                                                                  |
| ---------------------------- | ----------------------------------------------------------------------- |
| `kaitoiCode.executablePath`  | CLI executable; default `kaitoi`. This is a machine setting.            |
| `kaitoiCode.provider`        | Provider for new sessions; empty uses Code's default.                   |
| `kaitoiCode.model`           | Model for new sessions; empty uses Code's default.                      |
| `kaitoiCode.mode`            | Plan, Build, or Crew for new sessions.                                  |
| `kaitoiCode.permissionModal` | Whether permission questions use the modal presentation; default false. |

Use **Kaitoi Code: New Session** after changing defaults. Use
**Kaitoi Code: Sign In** for the browser login flow when using managed providers.
Local model access has its own endpoint requirements.

## Review work in the editor

VS Code trust and Code's first-turn folder trust are separate decisions. Neither
automatically approves every tool, paid operation, or Crew run. Read each
permission question and inspect diffs before accepting a proposed action.

**Kaitoi Code: Cancel** requests cancellation of the active turn. Completed edits
and dispatched remote work are not automatically rolled back. For transport
capabilities and limitations—including unavailable ACP subagents—see the
[ACP guide](/docs/cli/acp/).
