Connect Codant to VS Code
The experimental Codant extension connects to the existing local daemon from the extension host. Its sidebar has views for chat, history, plans, context, usage, read-only diffs, and the swarm. Each view depends on the handshake and the data available on the current connection. The extension currently uses Simplified Chinese. This guide includes the labels shown in the UI. See renderWebviewHtml in packages/vscode/src/panel-html.ts, packages/vscode/src/bridge-client.ts, and the extension manifest. Extension entry point
Prepare the extension
The extension manifest declares engines.vscode as ^1.113.0 and uses ESM. The extension validates local permissions on the bridge record and refuses the read if the required native permission checks are unavailable. Use an existing local VSIX or build it from source. See packages/vscode/package.json and checkPrivate in packages/api/src/ide-record-reader.ts.
Connect the local bridge
- In a local terminal, run
codant serve --ide. Keep it running and note the bridge record path printed by the command. The command checks that the daemon is available before opening a WebSocket bound to127.0.0.1. SeerunIdeServeinpackages/cli/src/serve-ide.tsandpackages/api/src/ide-bridge-owner.ts. - Install the local VSIX from the Extensions view and open the Codant sidebar. Click 选择桥记录 (Select bridge record), or run
Codant: 选择 IDE 桥记录from the Command Palette. Select the exactide-bridge-UUID.jsonprinted in the terminal. The host validates the record, connects using its credential, and checks the daemon instance it receives. Seecodant.selectBridgeinpackages/vscode/package.json,packages/vscode/src/extension.ts, andpackages/vscode/src/bridge-client.ts. - Use a trusted local workspace. Once connected, choose 新会话 (New session) or resume a session. For a multi-root workspace, select the folder that owns the session. See
workspaceinpackages/vscode/src/extension.tsandpackages/vscode/src/panel-host-controller.ts.

The Codant VS Code panel uses Chinese labels. This screenshot uses a simulated connection and demo data.
Follow a task and review changes
- Save the task ID from its submission receipt in 对话 (Chat). If acceptance is unknown, use 查询原提交 (Look up original submission) to check its status. Save the task ID if the lookup finds it. Submission receipts and lookup button · Original submission lookup
- Open 蚁群 (Swarm) and click 刷新蚁群 (Refresh swarm) to read the daemon's current working set. You can see ant IDs, castes, statuses, and activities, as well as task statuses, claimants, and the effective concentrations and counts for five pheromone types. 原匹配租约 (Matching lease) is currently empty. The claimant field identifies which ant holds the claim. Snapshot decoding · Swarm panel
- 计划 (Plan) reads the current session's plan, 历史 (History) reads the selected session or archive, and 差异 (Diff) captures a read-only diff of the current session's workspace. To look up a task tree, task plan, collaboration evidence, or retained file results by task ID, follow the terminal task guide while connected to the same local daemon. Session plan reader · Session history reader · Workspace diff reader
Trust and reconnecting
- The extension host handles the bridge record and Bearer credential. The webview receives display data, and the IDE bridge rejects WebSocket handshakes that carry an
Originheader. Keep the record local and select the exact file printed in the terminal. In a trusted workspace, the extension reads the saved record path from global user settings. Seepackages/vscode/src/bridge-client.ts,packages/vscode/src/extension.ts,packages/api/src/ide-record-reader.ts, andpackages/api/src/ide-bridge-owner.ts. - In Restricted Mode, the local desktop extension host supports an explicitly selected bridge and read-only history. Sending, session operations, file references, and approvals require a trusted workspace. See
untrustedWorkspacesinpackages/vscode/package.jsonandREAD_ONLY_HISTORY_METHODSinpackages/vscode/src/bridge-client.ts. - If the daemon instance changes or the record becomes invalid, select the record printed by the new bridge. If submission acceptance is unknown, use the panel's original-operation lookup to retrieve the receipt in the original session. See
packages/vscode/src/bridge-client.tsandpackages/vscode/src/panel-originals-controller.ts.
Build a VSIX from source
Run the packager from the root of the Codant source checkout. This example targets Windows x64. The output parent directory must exist and the final directory must be new. The selected target needs its matching native dependencies and licenses already installed. See packages/vscode/esbuild.mjs, packages/vscode/delivery-output.mjs, and packages/vscode/delivery-assets.mjs.
node packages/vscode/esbuild.mjs --output "C:\CodantBuild\codant-win32-x64-001" --target win32-x64 --publisher codant-local --vsixIn the VS Code Extensions view, choose Install from VSIX and select the generated local package. For a local tool that sends its own JSON-RPC messages, start with the stdio guide. See packages/vscode/delivery-vsix.mjs and packages/api/src/bridge.ts.
