VS Code extension
An agent inside VS Code that works on your project with you: bring your own key, any provider,
a transparent plan you can follow step by step. It runs the Node agent of this monorepo
(@dudko.dev/agent) in the extension host, and draws its chat with
<dd-agent-chat> in a webview.
Stage 2: it changes your project, with you. The agent reads, lists and searches the
workspace’s files, opens a file at a line - and, in a trusted workspace, creates, edits,
renames and deletes files and uses git. Every change is asked in the chat first; a file change is
shown in VS Code’s diff view before you decide, and you may take parts of it back there. It follows
the project’s own conventions (CLAUDE.md, AGENTS.md, Copilot’s and Cursor’s rules, GEMINI.md, its
skills and .claude permissions), and - only if you switch it on - sees what you are looking at in
the editor.
Stage 3: it runs commands and tests, reads the Problems panel and the code’s symbols, and works
in modes. In a trusted workspace a command runs in a terminal you see - each one asked first, on a
card that shows its exact line, the folder and the shell -, run_tests runs the project’s tests
and points at the failures, get_problems, find_symbol, find_references and go_to_definition
read what the editor knows. A mode picker in the chat’s header (and /mode) switches between
Write code, Fix a failing test, Review (findings shown as comments in the editor; it
changes nothing) and Study the project.
Stage 4: it finds the right code fast in a big repository. The language servers’ symbols as
tools - a file’s outline (document_symbols), implementations (find_implementations), who calls
what (call_hierarchy), on top of find_symbol, find_references and go_to_definition - and,
only if you turn it on, a local code index searched by meaning (search_code_semantic):
the workspace’s source files chunked by symbol and embedded by the provider you choose - or by a
model on this computer (multilingual-e5-small, downloaded once: the code never leaves it) -, the
vectors kept on this computer, updated as files change. In Write code and Study the project the
agent looks for code in that order: symbols, then the index, then ripgrep.
Stage 5: your tools. Your own MCP servers and the project’s (.mcp.json, .vscode/mcp.json:
stdio, Streamable HTTP or HTTP+SSE, with OAuth or a header token), each asked
about before it starts and every call of their tools asked in the chat; your own skill folders;
the workspace’s past chats (☰ in the chat’s header); and, if you switch it on, web search through
your chat provider’s own search.
On the Visual Studio Marketplace
(dudko-dev.dudko-agent); not on npm (private: true; not in .github/scripts/release-plan.mjs) and not
yet on Open VSX. Or build the .vsix and install it yourself (below). Privacy:
https://agent.dudko.dev/privacy/#vscode. Needs VS Code 1.104 or newer (the chat lives in the
Secondary Side Bar, which an extension can contribute to from 1.104 on).
Quick start
Section titled “Quick start”- Install it: the chat opens once by itself. It lives in the Secondary Side Bar (on the
right, next to where Copilot’s chat lives); Agent in the status bar, Agent: Open Chat
or
Ctrl+Alt+A(Cmd+Alt+Aon macOS) opens it from anywhere, also when that side bar is closed. Drag its icon to the Activity Bar if you prefer it on the left. The Get started with Agent walkthrough (Welcome page) shows the rest. - The chat shows a setup card: pick a provider (Anthropic, OpenAI, Google, DeepSeek, xAI, or an OpenAI-compatible server), click Get a key if you have none, paste the key, Save and start. The key is checked against the provider’s own model list first (a key the provider refuses is not saved), then kept in VS Code’s secret storage (your OS keychain) - the chat’s page never keeps it.
- The model is picked for you from that list: the newest middle-tier chat model the provider lists (its Sonnet, GPT mini, Gemini Flash…) - no model id is written in the extension, so the pick never points at a retired model. Ask your first question.
Then: the model chip in the chat’s header switches the provider or the model (and, under “A model per role”, gives the planner or the answer a model of their own); ⚙ opens the chat’s settings - Keys (connected ✓, Replace, Remove), what the agent may do, what it shares with a message, which of the project’s instructions it reads. Everything else is in VS Code’s settings, grouped (Model, Approvals and commands, Sharing, Project instructions, Files, Code index, Advanced) - every one has a working default.
A local or other server
Section titled “A local or other server”Pick OpenAI-compatible server on the card and give its address - Ollama
(http://localhost:11434/v1), LM Studio (http://localhost:1234/v1), llama.cpp, vLLM, or any
https:// service with OpenAI’s API (OpenRouter: https://openrouter.ai/api/v1). http:// is
taken for this machine only (localhost, 127.0.0.1, [::1]). Its key is optional; the model is
the first chat model the server lists (embedding, reranking and speech models it lists are not
offered) - pick another in the chip. Adding the server does not change the models you use: it is
one more provider, for the whole chat or for one role (“A model per role” - a small local planner,
say, with a hosted model doing the steps).
Ollama, step by step.
- Pull a model that calls tools (Ollama’s library marks them tools) - the agent works through
tool calls, and a model without them cannot read a file:
ollama pull <model>. - Give it room. Ollama often runs a model with only a few thousand tokens of context (it depends
on the version and the GPU’s memory), and the agent’s instructions and tools alone take
several thousand: start the server with
OLLAMA_CONTEXT_LENGTH=32768 ollama serve(the Ollama app: its Settings’ context length), then setdudkoAgent.model.contextWindowto the same number so the agent compacts the conversation to fit it. A window smaller than the server’s is safe; a bigger one is cut by the server without a word. The window is the whole chat’s: with a hosted planner next to a local model, the smaller one governs. - In the chat: OpenAI-compatible server, address
http://localhost:11434/v1, no key. Pick the model in the chip.
A model of 7-8 billion parameters answers questions about the code and makes small edits; plans of many steps go better on a larger one, or with a hosted model as the planner.
What it does
Section titled “What it does”| Chat | The Agent view in the Secondary Side Bar (Agent: Open Chat, Ctrl+Alt+A / Cmd+Alt+A): the plan, each step, every tool call and its result, the answer streamed - in VS Code’s own colours (any light, dark or high-contrast theme: the answer is text on the panel, your message a quiet tint, code in the editor’s code-block colour). New Chat, the mode and Open Settings in the view’s title bar. |
| Models | Picked in the chat: the model chip in its header lists the provider’s own models (read from its API with your key) and marks the suggested one. Three roles: the model (dudkoAgent.model.*: works on each step, calls the tools), the planner (dudkoAgent.planner.*: writes and revises the plan) and the answer (dudkoAgent.synthesizer.*: writes the reply) - the last two take the model’s unless you pick others (“A model per role”). Providers: Anthropic, OpenAI, Google (Gemini), DeepSeek, xAI, and any OpenAI-compatible server (OpenRouter, Ollama, LM Studio, llama.cpp, vLLM) through its address. |
| Keys | Pasted in the chat (the setup card; later ⚙ → Keys: Connected ✓, Replace, Remove) and stored in VS Code’s SecretStorage (your OS keychain): checked against the provider’s model list first, never kept by the chat’s page, never in a setting, a file, an event or a log; sent only to that provider. Agent: Set API Key… opens the same panel; Agent: Remove API Key… deletes one. A turn that finds no key or no model shows the setup card - never a message telling you to run a command. |
| Reading | list_files (honours .gitignore and files.exclude / search.exclude), search_text (ripgrep - the one VS Code ships), read_file (numbered lines, a line range, size-capped), open_file (shows a file at a line; changes nothing). Marked read-only: they run without asking. |
| Writing | create_file, edit_file (exact replacements, or the whole content), rename_file, delete_file - trusted workspaces only, each asked in the chat and shown in VS Code’s diff view first (left: the file now; right: after the change). The right side is editable: revert a hunk with the diff editor’s arrows, or change a line, and what you leave is what is written - byte for byte: a new or edited file is written straight to the disk (workspace.fs), so no format-on-save or code action on save changes it after you approved it (an open editor reloads it); a rename or a deletion is a WorkspaceEdit (the editor’s Undo takes it back). A file with unsaved changes in the editor is not changed: save or revert it first. A rejected change is not made and its diff closes. The approval card says what the change is: the file and its added / removed lines. |
| Git | Through VS Code’s built-in git extension. git_status, git_diff (the working tree, the staged changes, or the branch’s changes since it left its base - branch: true, or base: main), git_log, git_blame run without asking; git_stage (a folder: its changed files, each listed on the card; refused whole if one is on the deny list), git_commit (the card shows the message as text and what is staged), git_branch, git_stash are asked; git_push is asked every time (no “always allow” answers it, whatever a settings file says) and confirmed once more in a modal dialog; it never forces. Trusted workspaces only (a repository’s own config can run commands). A workspace folder inside a larger repository (a package of a monorepo) uses that repository, shown only as far as the folder goes. |
| Commands | run_command: one command line, run in the workspace (or a folder of it) through the shell you chose - in a terminal of its own that you see, its output and exit code read back. Trusted workspaces, ask-writes only; every command asked on a card with its exact line, the folder, the shell and the timeout (below). Ctrl+C in its terminal, closing it, the chat’s Stop or Agent: Stop the Running Command end it and everything it started. A server or a watcher (npm run dev) runs in the background (background: true, said on its card): the call returns after a few seconds with what it printed, the process goes on in its terminal; command_output reads what it printed since, stop_command stops it (both read-only: they touch only what a command you allowed started). |
| Tests | run_tests: the project’s test command (from its package.json, Makefile, …), narrowed to a file or a test when the model can - asked like any command; the result says passed, the counts the runner printed (vitest, jest, node:test, pytest, mocha, cargo), and lists the places of the failures it names (file:line, inside the workspace only). The chat shows it under the answer: passed or failed, the counts, the first five places. |
| Problems and code | get_problems (the Problems panel: errors and warnings of the language servers and linters), find_symbol (workspace symbols), document_symbols (a file’s outline: classes, functions, methods with their lines, nested), find_references, go_to_definition, find_implementations (at a file, a line and the symbol’s name), call_hierarchy (who calls a function - incoming - or what it calls - outgoing - where the language server offers it) - the editor’s own providers (vscode.execute*Provider), read-only, run without asking. Every place they name goes through the reading guard: a file outside the workspace or on the deny list is left out (counted as hidden). |
| Code index | Off by default (dudkoAgent.codeIndex.enabled). On, in a trusted workspace and after you allow it once: the workspace’s source files chunked by symbol (the language server’s outline; lines where there is none), embedded by OpenAI, Google or an OpenAI-compatible server with your key - or on this computer (provider: device, no key, nothing of the code sent) -, the vectors in the extension’s storage, updated on save / create / rename / delete. search_code_semantic (a query in words, k results) returns file:start-end ranges with a snippet, best first. Progress and size in the status bar (click: rebuild, clear, settings); Agent: Rebuild Code Index, Agent: Clear Code Index. Without an index (off, not allowed, a provider without embeddings…) the tool says why and answers from the workspace symbols and ripgrep instead. Below: what is sent. |
| Modes | A picker above the chat, Agent: Choose the Chat’s Mode… in the view’s title bar, or /mode <name> in the message box: Write code (default), Fix a failing test, Review, Study the project (below). Kept per workspace. |
| Review comments | In Review, each finding is a comment at its line in the editor (add_review_comment: plain text, read-only threads, at most 100). Agent: Clear Review Comments (or New Chat) takes them down. |
| Conventions | In a trusted workspace: the repository’s instruction files, its skills, its .claude permissions and a few facts of .vscode/settings.json (below). Agent: Show What This Workspace Gives the Agent lists what was read, applied - and ignored. |
| Chats | ☰ in the chat’s header: New chat and the workspace’s past chats (newest first), each opened again where it stopped - after a reload of VS Code too - or deleted. Kept in VS Code’s workspace state on this computer (the questions and the answers, at most 50 chats of 40 turns), never in the workspace’s files. |
| MCP servers | Your own, in dudkoAgent.mcp.servers (a user setting: a workspace cannot add or change one) - a program run on this computer (stdio) or a Streamable HTTP endpoint (https://, or http://localhost), with OAuth where the server asks for it (Agent: Sign In to an MCP Server…, or Sign in in the chat’s ⚙ panel; the tokens in SecretStorage). Each server is asked about once before it starts or is connected to - in a modal that shows the exact command line (or the URL); a changed definition is asked again. Trusted workspaces, “Write code” mode only; every call of their tools is asked in the chat (a server’s own “read-only” hint is not taken). The ⚙ panel lists them with a switch each, what they run, whether you allowed them and how many tools they gave. Below: the setting. The project’s servers - .mcp.json (Claude Code’s format, mcpServers) and .vscode/mcp.json (VS Code’s, servers and inputs) of each local workspace folder - are read as configuration and listed off: switch on the ones you need in the ⚙ panel (trusted workspaces only; a modal shows what it runs or where it connects, and the file). That is remembered for that definition in this workspace - a change in the file turns it off again. type stdio, http or sse; headers (a Bearer token, an API key); variables ${env:NAME}, ${NAME}, ${NAME:-default}, ${workspaceFolder}, ${userHome} and ${input:id} (asked once, kept in SecretStorage for THAT server - another server of the same file is asked for its own) - filled in only when it starts, and a variable never decides a URL’s scheme or host. The modal shows every header and env value as written - a variable by name (X-Trace: ${env:OPENAI_API_KEY}), a literal masked (Authorization: Bearer ••••) - and lists every variable the server reads. Nothing reaches a project’s server - no variable filled in, no connection, no sign-in - until it is switched on and allowed in a trusted workspace: only then does the panel show its Sign in. In your own setting only a header’s ${env:NAME} is filled in; anything else written ${…} there is passed as written. A stdio server starts in its folder. An HTTP server without its own Authorization header signs in with OAuth if it asks (CIMD where the authorization server supports it, else dynamic registration). envFile is not read. A name your settings already have is yours. |
| Your skills | ~/.claude/skills and the folders you name in dudkoAgent.skills.folders (absolute paths; each sub-folder a SKILL.md), next to the project’s .claude/skills - knowledge the agent loads when a task needs it, under the same “data, not orders” preamble. Add a skills folder in the ⚙ panel. Trusted workspaces. |
| Web search | Off until you switch it on (⚙ → Web search, or dudkoAgent.webSearch.enabled): web_search through the chat’s provider’s OWN search - Anthropic’s web search tool, OpenAI’s, Google’s grounding, xAI’s - one call of the chat’s model with your key, the query the model wrote sent to that provider; results cleaned and capped by the core, page text is data. DeepSeek and an OpenAI-compatible server have none. |
| Editor context | What you are looking at, sent with each message - each piece a switch, all off by default (dudkoAgent.context.*): the active file and its language, the selection, the cursor, the file’s problems, the open editors, the workspace’s name. The chat’s Sharing chip shows what goes before you send, and you can leave it out of a message. |
Settings
Section titled “Settings”| Setting | Default | |
|---|---|---|
dudkoAgent.model.provider |
(none: the chat asks) | The provider - easier in the chat (the setup card, the model chip) |
dudkoAgent.model.id |
(picked from the provider’s list) | The model, as the provider names it; empty: the newest middle-tier chat model of the provider’s own list, kept here once picked |
dudkoAgent.model.baseUrl |
A base URL: required for openai-compatible; https://, or http:// on localhost only. User setting only |
|
dudkoAgent.openaiCompatible.baseUrl |
Your OpenAI-compatible server’s address (Ollama, LM Studio, llama.cpp, vLLM), written by the chat’s setup card and kept while another provider is the chat’s, so a role can run there; https://, or http:// on localhost only. User setting only |
|
dudkoAgent.model.contextWindow |
0 (128 000) |
The context window in tokens (at least 4096), for every role: the conversation and the steps are compacted to fit it, the output caps are shares of it. Set it for a local model - what the SERVER gives the model (Ollama: OLLAMA_CONTEXT_LENGTH), the smallest of the roles’ |
dudkoAgent.statusBar |
true |
Agent in the status bar: it opens the chat |
dudkoAgent.planner.provider / .id / .baseUrl |
(the model’s) | The planner’s model (Advanced; or the chip’s “A model per role”) |
dudkoAgent.synthesizer.provider / .id / .baseUrl |
(the model’s) | The answer’s model (Advanced; or the chip’s “A model per role”) |
dudkoAgent.files.deny |
.env*, *.pem, *.key, id_* |
Files never read, listed or searched (below). User setting only |
dudkoAgent.files.maxReadKb |
512 |
The largest file read_file opens |
dudkoAgent.maxIterations |
6 |
Plan revisions per turn |
dudkoAgent.approval.mode |
ask-writes |
ask-writes: reads run, every change and every command is asked (a file change in a diff, a command as its exact line); read-only: no tool that writes or runs a command. An untrusted workspace is always read-only. User setting only |
dudkoAgent.terminal.shell |
(/bin/sh; cmd.exe on Windows) |
The shell a command line runs through: the line is ONE argument to it (-c for sh / bash / zsh / fish, -NoProfile -NonInteractive -Command for PowerShell, /d /s /c for cmd.exe). User setting only |
dudkoAgent.terminal.timeoutSeconds |
120 |
How long a command may run (a call may name its own, at most 1800); a background command has none. User setting only |
dudkoAgent.terminal.allowedCommands |
[] |
Command lines that run without asking, each matched exactly (the whole line). Your own list only - no project file adds to it, and a project’s Bash(…) ask or deny still holds. User setting only |
dudkoAgent.conventions.claudeMd / .agentsMd / .copilotInstructions / .cursorRules / .geminiMd |
true |
Each instruction source a switch |
dudkoAgent.conventions.projectSkills / .userSkills |
true |
.claude/skills, .agents/skills; your ~/.claude/skills |
dudkoAgent.conventions.claudeSettings |
true |
.claude/settings.json, .claude/settings.local.json, ~/.claude/settings.json permissions as approval rules |
dudkoAgent.conventions.editorFacts |
true |
The workspace’s formatter, indentation, excludes - as facts |
dudkoAgent.codeIndex.enabled |
false |
Build the code index (asked once before anything is sent). User setting only |
dudkoAgent.codeIndex.provider |
(the chat’s) | openai, google, openai-compatible, device (a model on this computer - below); empty: the chat’s provider - Anthropic, DeepSeek and xAI have no embeddings model, so pick one here. User setting only |
dudkoAgent.codeIndex.model |
text-embedding-3-small / gemini-embedding-001 |
The embeddings model (required for an OpenAI-compatible server; not used with device). User setting only |
dudkoAgent.codeIndex.baseUrl |
(the chat’s, same provider) | https://, or http:// on localhost. User setting only |
dudkoAgent.codeIndex.maxFileKb |
256 |
The largest file indexed |
dudkoAgent.context.activeFile / .selection / .cursor / .diagnostics / .openEditors / .workspaceName |
false |
What of the editor goes with a message. User settings only |
dudkoAgent.mcp.servers |
{} |
Your MCP servers: "name": { "command": "npx", "args": ["-y", "pkg"], "env": {…}, "cwd": "/abs" } (stdio) or "name": { "url": "https://…/mcp", "oauth": true } ("type": "sse" for an HTTP+SSE server); "enabled": false switches one off. headers only with the secret from the environment ("Authorization": "Bearer ${env:MY_TOKEN}"): a literal secret does not belong in a setting. User setting only |
dudkoAgent.skills.folders |
[] |
More folders of your own skills (absolute paths). User setting only |
dudkoAgent.webSearch.enabled |
false |
web_search through the chat’s provider’s own search. User setting only |
VS Code’s settings page groups them: Model, Approvals and commands, Sharing with each message, Project instructions, Files, Code index, Advanced (a model per role, plan revisions); each with a one-line description - this table has the details. The chat’s ⚙ panel writes the same settings (your user settings, never a workspace’s): the approval mode, the sharing switches and the project instructions’ switches - nothing else.
Commands: Agent: Open Chat (Ctrl+Alt+A / Cmd+Alt+A), New Chat, Set API Key… (the
chat’s Keys), Remove API Key…, Sign In to an MCP Server…, Forget the MCP Servers I
Allowed or Refused, Open Settings, Show What
This Workspace Gives the Agent (the instructions, skills and rules read; what was ignored; the
commands refused, always asked and run unasked), Choose the Chat’s Mode…, Stop the Running
Command, Clear Review Comments, Rebuild Code Index, Clear Code Index, Remove the On-Device Model.
The code index: what is sent, and where
Section titled “The code index: what is sent, and where”Opt-in: dudkoAgent.codeIndex.enabled is off by default and is a user setting only (a workspace
cannot turn it on or point it elsewhere). The first time it would build - and again for another
embeddings model - a dialog asks you, naming the provider and the model. Only a trusted
workspace is indexed.
- What is sent: the text of the workspace’s source files, in chunks (a function, a class, a
method, or about 50 lines), each with its file path and symbol name, to the embeddings provider
you configured - with your key for it, from SecretStorage, to that provider’s own endpoint (or
your
baseUrl). Your search queries go there too, to be embedded. Nothing else is sent anywhere, no other network request is made. - What is never sent: files on the deny list (
dudkoAgent.files.deny, by the name asked and by the real path) and a project’sRead(…)deny rules; files.gitignore,files.excludeorsearch.excludeleave out; links that lead out of the folder; dependency and build folders (node_modules,dist,build,out,target,vendor,.venv, …); generated files (minified, source maps, lockfiles,*.generated.*, protobuf output, snapshots); binary files (by name, and any file with a NUL byte); files overmaxFileKb; more than 20 000 files or 100 000 chunks. - Where it is kept: the vectors and the chunks’ places (no code text) in the extension’s global storage, one folder per workspace - not in the workspace. Agent: Clear Code Index deletes it.
- Kept up to date by a file watcher: a saved, created or deleted file (a rename re-uses its vectors: nothing is sent again), unchanged files never re-sent (by a hash of their bytes); a branch switch (hundreds of files at once) is a whole pass, which sends only what changed.
- Answers are guarded again: every hit goes through the reading guard before it is shown, so a file denied after it was indexed never appears; the snippet is read from the file now, capped, as data.
On this device (dudkoAgent.codeIndex.provider: device)
Section titled “On this device (dudkoAgent.codeIndex.provider: device)”The code is embedded on this computer and is never sent anywhere; no key is needed. The model is
multilingual-e5-small (intfloat, MIT;
Xenova’s ONNX export, 8-bit weights, about 100 languages): its four files, 129.1 MB, are
downloaded once from Hugging Face (huggingface.co and its CDN, *.hf.co) - the only network
request this makes. The same rules decide what is indexed (above).
- Asked first: the dialog names the model, its size and where it comes from; nothing is downloaded before you agree. A download runs only right after you agree in that dialog, or when you run Agent: Rebuild Code Index - never by itself when the chat opens, a setting changes or another window starts - with its progress in a notification and a Cancel. Cancelled, it stays cancelled until you rebuild.
- Exactly the files pinned in the extension: the repository at a fixed commit, every address checked before the first request, every redirect followed only to Hugging Face over https, each file exactly its listed size with its listed SHA-256 (hashed as it arrives, cut off the moment it is longer; a download that receives nothing for 60 seconds is stopped). A file is written under a temporary name and kept only once whole and checked: cancelled or refused, the file in progress is deleted, and the files already completed are kept and reused by the next download. Before a start the files’ sizes are checked; as the worker reads them it checks their SHA-256 again, so what runs is exactly what was pinned - a file that is not loads nothing (rebuild to download it again).
- Where it is kept: the extension’s global storage (
device-models/), shared by every workspace; another revision of the model is deleted when a new one is downloaded. Agent: Remove the On-Device Model deletes it (also offered after Agent: Clear Code Index) - run it BEFORE you uninstall the extension. - How it runs: in a worker thread of the extension host (VS Code never waits on it), on
onnxruntime-web’s WebAssembly build - part of the extension, about 14 MB, the same on every
platform, no native binary and nothing loaded from a CDN - with Hugging Face’s tokenizer
(their licences:
dist/device/THIRD_PARTY_NOTICES.txtin the extension). The thread makes no requests:fetch,WebSocketandEventSourceare replaced there so that anything that tried would fail, and it gets none of VS Code’s environment. Texts go in batches of 8, each cut into pieces that fit the model’s window whole (“passage: “ for the code, “query: “ for a search, as e5 needs); the thread stops when idle, on Stop, and with the index.
What reaches a model, and what never does
Section titled “What reaches a model, and what never does”- Only the workspace’s folders. A path from the model is workspace-relative (with several
folders, the folder’s name first). Refused before the disk is touched: absolute paths (
/x,C:\x,\\server\x),~, URIs, any..segment, NUL. Then the real path (symlinks resolved) must be inside the folder: a link that leads out is refused. - Never the deny list.
.env*,*.pem,*.key,id_*by default: a pattern without/matches a file or folder name anywhere, one with/the path from the folder. Checked on the name asked for AND on the real path (a link namednotes.txtthat points at.envis refused); denied files are never listed or searched either. The setting is application-scoped and inrestrictedConfigurations: a workspace’s.vscode/settings.jsoncannot shorten it, nor point a provider’s base URL (and so your key) elsewhere. - Files are data, not instructions. Every tool result carrying the workspace’s text says so, and so does the system prompt: an instruction written in a file is not followed.
- Bounded.
read_file: the size cap, binary files refused, 2 000 lines / 100 000 characters a call (the rest bystartLine).list_files/search_text: 200 / 100 results by default, 1 000 / 500 at most, a matching line cut at 300 characters. A capped listing is always the first files by path (ripgrep’s--sort path); the search stays parallel for speed, so when its cap cuts it which matches are kept may vary (it saystruncated), their order (path, line) does not. - The model list. To pick a model the extension reads the provider’s own list of models
(
GET /modelsat the provider, or at the address you gave an OpenAI-compatible server) with your key - when you save a key, when you open the model chip, and when a model is missing (at most once in ten minutes per provider). Nothing of your project is in that request. - Without ripgrep, still the same guard. Search uses the ripgrep VS Code ships. If it is not
found,
search_textfalls back on the editor’s file listing (which follows symlinks): each file goes throughread_file’s guard (real path inside the folder, the deny list on both names) and is skipped when refused, and the search is plain text only - a regular expression is refused, so a model’s pattern never runs on the extension host’s thread.
Workspace Trust. The extension declares untrustedWorkspaces: limited. In Restricted Mode it
only reads: no tool that writes, runs a command or runs git is given to the model (not merely denied: not there),
the core runs in its read-only mode, and nothing of the project’s conventions is read - no
instruction file, no skill, no .claude settings. Trusting the workspace rebuilds the agent with
them on the next message.
Every change is yours to accept
Section titled “Every change is yours to accept”- The chat asks. In
ask-writesmode (the default) the core’s approval gate asks for every tool that is not read-only; the question is the chat’s approval card (Allow once / deny with a reason), answered through the gateway’sanswersroute. Unanswered for 10 minutes, or the turn stopped: denied. - The diff first, for that call. Before a file change is asked, it is planned with every guard below and opened in VS Code’s diff view, held for THAT call (the model’s call id): what is written is what the right side holds when you allow it, byte for byte (checked again: size, NUL). A change whose diff cannot be opened is refused - never written unseen. While one change to a file waits for you, a second change to the same file is refused. If the file changed on disk after the diff was shown, or the call is not the change you saw, nothing is written. A rejected change’s diff closes at once. The card can appear a moment before its diff: an answer given in that moment is kept, and counts only once the diff is open (no diff: refused all the same).
- No allow skips it. No rule from any settings file - yours or the project’s - lets a write or
a git change run without being shown and asked:
allowrules are never applied (a read-only tool is never asked anyway). Adenyalways holds. - Refused without asking. A write the guards refuse (outside the workspace, the deny list, the git directory, the agent’s own settings, through a link) is denied before anything is shown, with the reason.
- Push twice.
git_push: asked in the chat, then a modal dialog of VS Code; no rule, setting or “always allow” makes it run without both. - Every command, as it will run.
run_commandandrun_testsare asked on every call (a ruleaskis forced: the chat’s “always allow” never answers them), on a card that shows the exact line, the folder, the shell and the timeout. The only way to skip the card is your own exact list,dudkoAgent.terminal.allowedCommands- never a project’s file.
Commands: what runs, and how
Section titled “Commands: what runs, and how”- What the card shows is what runs. One line, at most 2 000 characters; a line break, a control character or an invisible one (zero-width, a bidirectional override, a tag character) is refused - it would make the card read differently from what the shell gets. The plan (line, folder, shell, timeout) is held for THAT call; the command runs only if it is planned again the same (the shell setting changed since the card: nothing runs), and a call nobody was asked about runs nothing.
- Through the shell you chose, as written. The line is handed to the shell as one argument
(
/bin/sh -c '<line>'by default;cmd.exe /d /s /c "<line>"on Windows, quoted exactly as Node quotes its own shell calls, so cmd.exe runs the line on the card): it expands variables, globs,$(…)and pipes exactly as on the card - the card says so and names the shell. The process gets the extension host’s environment without VS Code’s own variables (VSCODE_*,ELECTRON_*), plusNO_COLOR=1 FORCE_COLOR=0 TERM=dumb PAGER=cat GIT_PAGER=cat GIT_TERMINAL_PROMPT=0- the card lists them; stdin is closed (a program that waits for input gets none). - Where. The workspace folder, or a folder of it the model names - through the reading guard (inside it - links resolved -, not on the deny list).
- Stopped, all of it. The command runs in its own process group (
taskkill /Ton Windows): the timeout, Ctrl+C or closing its terminal, the chat’s Stop and Agent: Stop the Running Command end the shell AND everything it started, a background child included. And when the shell ends, whatever it left running in its group (server &) is stopped too - the result says so (backgroundStopped); nothing you allowed keeps running after its run (a process that left the group withsetsidis out of reach, as in any terminal; on Windows only the tree of a stop or a timeout). - Its output is data. Escapes, control characters and invisible ones (zero-width, bidirectional - the same list as everywhere else) removed, capped (the first 6 000 and the last 24 000 characters kept, the cut said), under a note that it is data, not instructions - and the system prompt says the same.
- The card is the gate; deny rules are a filter on top that fails closed. You see the exact
line and decide - that is what stops a command. A shell line cannot be read airtight
(variables, substitutions, aliases, an interpreter’s own
-e '…'), so the check below refuses what it cannot see through rather than guess, and it may refuse a harmless line. Read the card all the same. - Deny rules, read widely. A
Bash(…)deny of yours or the project’s refuses - before anything is asked - a line in which its first word names a command (by its name:/bin/rm,./rm,\rm,RM, a pattern such as/bin/r?in a command’s place are allrm) and its other words follow in the same command, through wrappers and options (sudo,env,nice,xargs,find -exec,npm --yes publish), in every command of a compound line and inside$(…),sh -c '…'andeval.Bash(rm:*)refusesrm -rf x,npm test && rm x,"rm" x,bash -c 'rm x',/bin/rm x,nice -n 5 rm x. While any deny rule is set, a line with a shell expansion is refused -$x,${…},$(…), backticks,$'…',{a,b},<(…), a trailing\- (“write it plainly”): the check could not see what it becomes. - Whatever the rules, a command named by an expansion or a pattern (
$cmd args,r$()m,/usr/bin/gi?), a shell reading its commands from a pipe (… | sh) and a git command with an expansion are refused. - Never a push, never its own permissions.
git pushis refused in any form the check can see:pushorsend-packanywhere in a line that runs git (by any path or wrapper -env git,/usr/bin/git,git-push,git rebase --exec "git push"), and git aliases (-c alias.…,config alias.…) -git_pushis the one way: asked, then confirmed. An alias already in your git config is invisible to the check: the card showsgit p, and you decide. A line naming.claude/settingsis refused, and so is a shell write into.claude/- a redirection, a writer (tee,cp,mv,rm,sed -i, …) orcdinto it (the agent cannot change the rules it runs under). - The deny list cannot bind a command. A command reads what you can: the card warns when the
line names a file on the deny list (
cat .env), and what it prints goes to the model. Read the card. - A server runs in the background, never blocks the chat.
run_commandwithbackground: true(the card says “Start this command in the background”, and that it keeps running): the call returns afterwaitSeconds(8 by default, at most 60) with what it printed and an id (bg1…), the process stays in its terminal with no time limit until Ctrl+C there, Agent: Stop the Running Command, the agent’sstop_commandor VS Code closing - its whole tree. At most 4 at once. A foreground command that hits its time limit says so and suggests the background. The background flag is part of what the card showed: a call planned in the foreground never runs in the background, nor the other way round. - Why not VS Code’s Testing API? VS Code’s stable API gives an extension no access to another
extension’s test controllers or their results (that is the proposed
testObserverAPI), sorun_testsruns the project’s test command instead - asked like any command - and reads its output.
The picker above the chat, /mode <name> or Agent: Choose the Chat’s Mode…. Each is a
preamble of the system prompt and a set of tools - a SUBSET of what the trust and the approval mode
already allow: a mode never adds a tool, never loosens the approval mode and keeps every rule.
| Mode | Does | Tools |
|---|---|---|
| Write code (default) | What you ask: reads, changes in small steps, runs the tests or the build when it helps. | Everything mounted (except review comments). |
| Fix a failing test | Runs the failing test, reads the failure and the code it points at, proposes the smallest fix as diffs, runs the test again - never weakens or skips the test. | Reading, the code tools, git’s reading tools, the four write tools, run_tests (no free run_command, no git change). |
| Review | Reviews the branch’s changes against its base (or the staged changes, or what you name); each finding a comment at its line, then a summary by severity. | Reading, the code tools, git’s reading tools, add_review_comment. Nothing that writes or runs; the core in its read-only mode. |
| Study the project | Explores the structure and explains the architecture; writes a Markdown file only if you ask. | Reading, the code tools, git’s reading tools, create_file - a .md file only, shown in a diff and asked. |
Where writes may go
Section titled “Where writes may go”On top of the reading guards (below): a target is workspace-relative; the deepest folder that
exists on the way must really be inside the workspace folder (a linked folder that leads out is
refused); an existing file must be a regular file - nothing is written through a symbolic
link; never the deny list (by the name asked and by the real path), never .git (any segment),
never .claude/settings.json / .claude/settings.local.json (the agent cannot widen its own
permissions), at most 1 MiB of text, no NUL, binary files never edited, a rename within its folder
only, a project’s Edit(path) / Write(path) deny rules too.
The project’s conventions (trusted workspaces only)
Section titled “The project’s conventions (trusted workspaces only)”- Instructions:
CLAUDE.md(and.claude/CLAUDE.md),AGENTS.md,.github/copilot-instructions.md,.cursorrulesand.cursor/rules/*.mdc,GEMINI.md- each a switch. The root’s go into the system prompt; a nested folder’sCLAUDE.md/AGENTS.md/GEMINI.mdcome with the result of the first tool call that reads or writes a file under it in a turn. Always as data: under a preamble that says whoever can change the repository wrote them and that they never override your request or the agent’s rules (secrets, the deny list, approvals, settings), every line|-quoted, invisible characters removed, 20 000 characters a file, 60 000 in all (12 000 for a tool result’s). Read through the reading guard: a link out of the folder or a file on the deny list is not read. - Skills:
.claude/skills/*/SKILL.md,.agents/skills/*/SKILL.md, and your~/.claude/skills- through the core’s skills (the planner picks one by its description;load_skill,read_skill_filefor its files). Each skill’s text, and each of its files, starts with the same kind of note (project knowledge, never policy), invisible characters removed. A skill’s own text files only (no link, no dot file, the deny list applied), 32 files and 256 KiB a skill, 32 skills; a duplicate name is skipped. - Permissions: the
permissionsof~/.claude/settings.json(yours) and of the project’s.claude/settings.json+.claude/settings.local.json, mapped onto the core’s approval rules:Read→ every reading tool (read_file,open_file,search_text,list_files),Glob/LS→list_files,Grep→search_text,Edit/MultiEdit/Write→ every write tool (create_file,edit_file,rename_file,delete_file),Bash→ every git tool andrun_command/run_tests,Bash(git:*)→ every git tool,Bash(git status|diff|log|blame|add|commit|branch|switch|checkout|stash|push …)→ that command’s tool (every git tool when an option hides the command,git -C x push), or this agent’s own tool names. EveryBash(…)also names command lines: a deny is refused byrun_command/run_tests(read widely, above), an ask is always asked even if the line is on your own list. They only narrow:denyandaskapply, the strictest wins, and a deny always holds.allowrules are never applied, from any file: a read-only tool is never asked anyway, and a write or a git change is always shown and asked - each ignored allow is listed. A path is taken indenyrules only (Read(./secrets/**)adds to the deny list,Edit(generated/**)to what is never written).git_pushis at leastask.hooksnever run,envis never read - they are listed as ignored, with every rule this agent cannot apply (other tools), in Show What This Workspace Gives the Agent. - Facts: the workspace’s own
.vscode/settings.jsonvalues ofeditor.defaultFormatter,editor.formatOnSave,editor.tabSize,editor.insertSpaces,files.eol,files.insertFinalNewline,files.trimTrailingWhitespaceandfiles.exclude- one short line each, as facts.
What of the editor is shared
Section titled “What of the editor is shared”Nothing unless you switch it on (dudkoAgent.context.*, user settings only - a workspace cannot
turn them on). Then, with each message: file and language, selection (1 500 characters) and
selectedLines, cursor, diagnostics (10, one line each), openEditors (20), workspace. A
file outside the workspace folders, not on disk, or on the deny list gives nothing of itself -
not its name, not its selection. The webview only shows the context (the Sharing chip) and says
which keys go with a message; the host takes the values itself at that moment, never the webview’s.
The core puts it in the user prompt as data the editor supplied, never as instructions.
How it is built
Section titled “How it is built”webview (<dd-agent-chat backend>) --postMessage--> extension host backendFetch = the bridge's fetch view channel → bridge → local gateway (no network: connect-src 'none') → agent runner → @dudko.dev/agent → workspace tools (fs + VS Code's ripgrep) → write tools (diff review, workspace.fs) → git tools (VS Code's git extension) → command tools (a pseudoterminal, the process the extension's own) → code tools (VS Code's providers, the Problems panel, the comments API) → code index (src/index/: chunks, vectors in globalStorage, the embeddings provider or src/index/device/: e5 in a worker thread)- The chat is the element’s “agent on a server” mode.
<dd-agent-chat backend>speaks the swarm gateway’s HTTP API (examples/swarm-shared); here that API is served IN the extension host as a fetch handler (src/gateway.ts: sessions in memory, a turn per message, the agent’s events as an SSE stream,turn.started/turn.endedmarkers), and the element’sbackendFetchproperty carries every request overpostMessage(src/bridge.ts,src/protocol.ts). The base URL (https://agent.vscode.invalid) never resolves; the webview’s policy hasconnect-src 'none'. Nothing of the in-browser agent is in the webview (@dudko.dev/agent-webis left out of its bundle). - The messages are checked on both sides (
webviewMessageOf/hostMessageOf): only the gateway’s routes,GET/POST, bounded headers and bodies, ids from a closed set; the host answers at most 16 requests at once. - The agent (
src/agent-runner.ts) is built from the settings and the keys on the first turn and again after a change; the three stages’ models are built here from the AI SDK’s provider packages (bundled) and handed to the agent as model objects. - Approvals go through the gateway’s
POST /sessions/:id/answers/:requestId({ approved, reason? }, checked; 404 when nothing waits for that id, 409 once answered): the core’stoolApproval.onRequestwaits on it, carried to the turn by anAsyncLocalStoragescope (agent-runner.ts). The chat draws the core’stool.approval-requestedas its approval card. - The diff is VS Code’s own (
vscode.diff): the proposal lives on an in-memory, writable file system (dudko-agent-proposal:), the other side of a new or deleted file on a read-only one. - The editor’s context is taken by the host (
vscode-host.ts’s snapshot,editor-context.ts’s rules) and posted to the webview (context, checked) for the chip; a message names the keys it shares and the runner takes the host’s values for them. - A command is planned (
command-tools.ts,command-policy.ts), asked, then run byrunProcess(process.ts:spawnof the shell with the line as one argument, its own process group) while a pseudoterminal (vscode-host.ts) mirrors its output; the terminal’s Ctrl+C and close stop it. - The mode is kept in the workspace’s state; the picker posts
mode(checked), the host builds the next turn’s agent for it (modes.ts). - The setup (
src/setup.ts, the page’s halfsrc/webview/setup-ui.ts, the names both sharesrc/setup-names.ts): the host postssetup(which providers have a key - never the key -, the models in use, the panel’s switches); the card’s Save postssetup-keyONCE (the page clears its field), the host lists the provider’s models with it (src/models.ts: the provider’s own/models, checked), keeps it only if the provider took it, sets the provider and the default model, and answerssetup-result. The chip postslist-models/set-model, the panelset-pref- only its own switches, written as your user settings. - The look follows the theme: the chat’s
--awr-*tokens from VS Code’s--vscode-*variables (media/webview.css), and a few rules adopted into the chat’s shadow root (src/webview/theme.ts). - The conversation lives in the extension host while the window is open: hiding the view and showing it again replays it. New Chat starts another.
Build, run, install
Section titled “Build, run, install”From the monorepo root, after pnpm install:
pnpm nx build vscode # dist/extension.cjs + dist/webview/pnpm nx run-many -t typecheck format:check build test -p vscodepnpm nx test:e2e vscode # the webview page in Chromium (Playwright)cd apps/vscode && xvfb-run -a pnpm test:integration # inside a real VS Code (downloads it once)Run it from source (F5). Open apps/vscode in VS Code, build once (pnpm nx build vscode),
then Run and Debug → Run Extension (.vscode/launch.json): a second window opens with the
extension loaded. Open the chat (Agent: Open Chat) and set it up on its card.
Install it locally.
cd apps/vscode && pnpm package # builds, then dist/agent.vsix (vsce, --no-dependencies)code --install-extension dist/agent.vsixPublishing is the owner’s, by hand: bump version here (a release PR of its own), merge, run
the Publish VS Code extension workflow (.github/workflows/publish-vscode.yml) from main. It
publishes through the Marketplace’s Trusted Publishing (vsce publish --oidc: no token stored; the
publisher’s policy names that workflow and the release environment) and attaches the .vsix to a
vscode-v<version> GitHub release. Never vsce publish from a machine.
tests/*.test.ts(node --test, no VS Code): the path guards (paths.test.ts), the four reading tools on real folders (tools.test.ts; listing and search needrgonPATHorRG_PATH- without it those tests skip, saying so), the write guard and the write tools (write-paths.test.ts), the git tools on a real repository through the git CLI (git-tools.test.ts; needsgit, else they skip), the conventions (conventions.test.ts), the editor context (editor-context.test.ts), the approval gate end to end - the chat, the bridge, the gateway’sanswers, the core, the tools (approval.test.ts), the message checks (protocol.test.ts), the bridge’s two ends (bridge.test.ts), the gateway driven by the ui package’s remote controller (gateway.test.ts), a whole turn on the real Node agent with a scripted model (turn.test.ts), the settings and the keys (settings.test.ts); stage 3: the process (process.test.ts, real child processes), the command line’s checks (command-policy.test.ts), the command tools on a real folder (command-tools.test.ts), the command’s consent end to end (commands-consent.test.ts), the code tools (code-tools.test.ts), the modes (modes.test.ts); stage 4: the chunking (index-chunk.test.ts), what the index never takes (index-filter.test.ts), the index on real folders with a fake embedder - build, ranking, incremental updates, renames, saving and loading (code-index.test.ts), its consent and life (index-manager.test.ts), the search tool and its fallback (semantic-tools.test.ts); the model on this device - its download’s guards (device-download.test.ts), its input and pooling and the worker’s embedder against a fake thread (device-embedder.test.ts), the catalogue against the app’s (device-catalog.test.ts), and, opt-in only (DUDKO_DEVICE_MODEL=1, after a build: it downloads 129.1 MB), the real model end to end (device-live.test.ts).e2e/webview.spec.ts(Playwright): the built webview page under its real HTML and policy, VS Code’s API stood in for, the host’s side in the test - a message typed into the chat becomes a turn; the host’s context shows in the Sharing chip and goes with a message; an edit is asked in the chat, allowed with its button and made; the mode picker shows the host’s mode, and a pick and/modego to the host; a command’s card shows its exact line, its button runs it; no request leaves the page’s own origin; no policy violation.tests/integration/(@vscode/test-electron): the built extension activated in a real VS Code (stable, orVSCODE_VERSION) over a trusted test workspace that is a git repository with aCLAUDE.mdand a.claude/settings.json(a push denied, a hook, an env var) - the commands and the view; a turn that lists (VS Code’s ripgrep:.gitignore,files.exclude, the deny list), reads and opens a file; an edit shown in the diff editor, a line taken back in it, the rest written;git_status/git_diffthrough VS Code’s git,git_pushdenied by the project’s rule, theCLAUDE.mdquoted in the system prompt; the editor context off, then on; a command asked on its card (the wait for the card registered first), run in a terminal, its output read back, a project’sBash(rm:*)deny refusing a compound line; Agent: Stop the Running Command ending a long one; the Problems panel and symbols / references (a test provider AND VS Code’s own TypeScript server) with the.env’s left out; Review mode: no tool that writes, a finding shown as a comment; stage 4: a fixture TypeScript project read by VS Code’s own TypeScript server - a file’s outline, implementations, a definition, the incoming calls - with a denied folder that implements and calls into it left out; the code index turned on with a fake embedder: built, nothing of the deny list or the ignored / excluded files sent, searched by meaning through a turn, a new file indexed by the watcher and a deleted one dropped, cleared; the hook never ran; the.envuntouched. The model is set throughactivate()’stestingseam, returned ONLY inExtensionMode.Test. Linux needs a display:xvfb-run -a.
No test calls a real model or the network (the integration suite downloads VS Code once).
Guards (each with a test and a mutation check)
Section titled “Guards (each with a test and a mutation check)”Reading - path containment: absolute, Windows / UNC / ~ / URI, .., NUL, length, a symlink
out, the folder name with several folders (tests/paths.test.ts); the deny list - by the name
asked, by the real name, on every segment (paths.test.ts), in listing and search
(tools.test.ts); the search fallback without ripgrep - a link to a denied file or out of the
folder skipped, regular expressions refused (fallback-search.test.ts); the read cap and binary
refusal (tools.test.ts); a capped listing always the first files by path (tools.test.ts, 20
runs).
Writing (write-paths.test.ts) - the reading guard first; the deny list by name and by the real
folder; .git and .claude/settings*.json protected; nothing through a link; a linked folder
out, or into a denied / protected folder, refused; must / must not exist; exact-once edits; the
content cap, NUL and binary files; a rename across folders; a project’s write-deny patterns; the
change checked again when it runs - a file changed after its diff (edit and delete), a call that
is not the change shown, the person’s text checked like the model’s; a review answers its own
call only (another call’s review is not consent; taken once); a change nobody was shown (no
review, or one whose diff never opened) never written; the approved text written byte for byte;
the review store holds a change per call and sees a second change to a file under review.
Consent (approval.test.ts) - the diff before the question, nothing written while it waits; a
rejected change never made, its diff closed before the model goes on; the person’s edit in the
diff is what is written; a refused write denied without asking; an untrusted workspace: no write
or git tool, no convention read, read-only - and an untrusted build ignores conventions it is
given; read-only mode: no write tool, no allow rule passed on; an allow rule never lets a
write or a git change run unseen (ask-writes too); a change whose diff cannot be opened refused
and nothing written, no write tool without a diff view; a second change to a file under review
refused, the first written as the person left it; an answer given while the diff is still
opening kept (not lost to a 404), taken only once the diff is open; push asked, then confirmed, once
per call (git-tools.test.ts too); the editor context: the host’s values for the keys the chat
sent. The gateway’s answers (gateway.test.ts): shape, unknown id, answered once, a stop ends
the wait, one question per id at a time.
Git (git-tools.test.ts) - status and diff without the deny list’s files; a diff section left out
if any of its paths may not be shown, text before the first section never shown; a repository
above the folder shows nothing outside it, and is the one a folder inside it uses; blame / diff /
log paths through the reading guard; a denied file never staged; a folder staged as its changed
files, listed on the card, refused whole when one is on the deny list (an untracked src/.env),
ignored and unchanged files left out; exactly the files the card listed staged; branch names.
Conventions (conventions.test.ts) - each source a switch; a link out or a denied file not read;
the preamble, | -quoting, invisible characters removed, the caps; nested files once a turn;
skills: the preamble (their files too, invisible characters out), no link, no dot file, a linked
skills folder out refused, duplicates; rules: Edit / Write / MultiEdit cover every write
tool, Bash / Bash(git:*) every git tool and Bash(git <sub>) its tool, no allow ever
applied (yours or the project’s), the strictest deny / ask wins, push at least ask, hooks / env /
other keys listed as ignored, a path only in a deny rule. Editor facts: the
listed keys only, one line.
Editor context (editor-context.test.ts) - all off by default; each switch its keys; nothing of a
denied file, one outside the workspace or not on disk; open editors filtered and capped; the
selection capped; the turn takes the host’s values only. The context message
(protocol.test.ts): known keys, strings, bounded.
Commands (process.test.ts, command-policy.test.ts, command-tools.test.ts,
commands-consent.test.ts) - one plain line (control, invisible, bidirectional characters
refused); a deny rule read widely (compound lines, quotes, sh -c, $(…), backticks, sudo; a
command by its name - a path, ./, \, case, a file pattern; wrappers and options between its
words); with a deny rule set, every shell expansion refused; a command named by an expansion or a
pattern, a shell fed by a pipe, a git command with an expansion refused whatever the rules; git push in any form the check sees (a path, a wrapper, -c, an alias, --exec, send-pack)
refused; .claude/settings and a shell write into .claude/ refused; the person’s list exact;
cmd.exe handed exactly the line the card shows; the card lists the environment the extension adds;
what a command leaves running stopped when it ends; the output without invisible characters; a
test run’s counts read from the runner’s summary and shown under the answer (test-run.test.ts,
the webview’s e2e); the folder
through the reading guard; the card shows the exact line, the folder, the shell, the timeout, and
warns about a deny-list name; a call runs only the plan held for it, and only if it is still that
plan (line, folder, shell, timeout; a run_command plan is not a run_tests one); the output
cleaned, capped, under its note; the failure places inside the workspace and not denied; stdin
closed; VS Code’s variables out of the environment; the timeout and Stop end the whole tree (a
background child too); end to end: asked on a card, nothing run while it waits, a rejected one never
run, a refused one denied without asking, an allow rule from any file never runs one unasked (the
ask forced), only the person’s exact list does and a project’s ask still asks, not mounted untrusted
/ read-only / without a terminal, the chat’s Stop ends the tree.
Quick start (setup.test.ts, models.test.ts, protocol.test.ts, the webview’s e2e
setup.spec.ts) - a key the provider refuses is never saved and nothing is written; a key with a
space, or none, refused before anything is sent; an OpenAI-compatible address checked as the
chat’s (https, or http on this machine) before the listing is asked; the listing sent only to the
provider’s own address with its own header; only checked ids and names kept from it, pages
bounded; the state the chat gets carries no key (a non-true key flag read as false), the page
clears the field and the host sends the key back nowhere; the panel writes only its own switches,
each with its own kind of value (never a base URL, the deny list, the shell or the commands that
run unasked); a model id one word; no model id written in the code. The gateway’s cursor
(gateway.test.ts): a model call’s retry does not move it - every later event of the turn (its
steps, its approval cards, its answer) still reaches the chat.
MCP servers (mcp-config.test.ts, mcp-project.test.ts) - a user setting only (the workspace’s value never read); an
HTTP server https or http on this machine, no credentials, headers in the setting only from the
environment; a project’s servers (.mcp.json, .vscode/mcp.json) all OFF until switched on, a
variable never the scheme or host of a URL and the URL checked again once filled in, a name of the
setting kept; names, arguments,
environment and folder checked, at most 20; any change to what runs or where data goes (command,
arguments, an environment value, the folder, the URL) is a new server, asked again; mounted only in
a trusted workspace, ask-writes and “Write code”; a project’s server reached (its variables, a
sign-in) only trusted, switched on and allowed; the modal shows header and env values as written,
literals masked, and every variable read; an ${input:id} value kept per server (never sent to
another server of the same file); the setting’s servers expand a header’s ${env:NAME} only;
every call of their tools asked (a rule
<server>__*: ask outranks a server’s readOnlyHint). The messages (protocol.test.ts): server
names and the view’s commands from a closed set. Chats (chat-history.test.ts): bounded, a bad id
or stored record dropped; a restored chat replayed and its turns the next turn’s history. Your
skills (web-search.test.ts): an absolute folder read, a relative one skipped. Web search: the
provider’s own tool, only for a provider that has one, never without a key.
Background commands (command-tools.test.ts) - started only when the card said so (the flag and
the wait are part of the plan), the call returns while it runs, the output read in parts, stopped
with its tree, at most four at once and all stopped together; reading and stopping read-only,
starting asked.
Modes (modes.test.ts) - every mode a subset of “Write code”’s tools (plus the review comments);
the same rules in every mode, never a looser approval mode (untrusted and read-only stay
read-only); Review: no write, command or git-changing tool, the core read-only; Study: create_file
only, a non-.md file refused without asking; Fix a failing test: run_tests, no run_command, no
git change. The mode message (protocol.test.ts): known modes only, both ways.
Code (code-tools.test.ts) - every code tool read-only; the problems, symbols, references and
definitions of a file outside the workspace, through a link or on the deny list left out; the model’s
place guarded; a duplicate place once; review comments only at a guarded file, cleaned, at most 100.
Git: a diff base is a plain ref (no option, range or reflog) (git-tools.test.ts). Stage 4: an
outline, implementations and the call hierarchy - a denied, linked or outside place left out, the
outline of a denied file refused before the editor is asked (code-tools.test.ts).
Code index - what is sent (code-index.test.ts, index-filter.test.ts): the deny list first,
dependency / build folders, generated and binary files (by name and by a NUL), the size cap, a link
out or to a denied file, a file the listing ignores - none ever reaches the embedder, in a build or
an update, even through a listing that ignores the filter; a file denied later leaves at its next
sync. Consent (index-manager.test.ts): off by default, untrusted, a provider without embeddings,
no key, declined - nothing sent; a consent counts for its own model only; the chat’s base URL is not
taken for another provider, and an embeddings base URL is https:// or loopback. On this device
(index-manager.test.ts, device-download.test.ts): declined - nothing downloaded; the download’s
consent made only after the yes and naming the exact size; no download on any refresh - only right
after a fresh yes or from a rebuild, a cancelled one never resumed by itself; clear, dispose and
remove stop a running download; the consent’s id names the revision and the size; files that do
not check out after a download never run; the worker loads a file only with its pinned hash; the download refused without the consent to that model at
that size, at an address that is not one of its pinned files (before any request), at a redirect
hop off Hugging Face or plain http, at a body longer than listed (cut off at once), shorter, with
another hash or another status, stalled - and nothing, not even a part, left; a kept file changed or cut is
deleted before use. The copy of the app’s catalogue is pinned to it (device-catalog.test.ts). The search
(semantic-tools.test.ts): read-only; every hit through the reading guard again - a denied file,
one outside or through a link never shown, even when the index holds it; the fallback’s symbols and
matches guarded too.
The bridge - gateway paths only, header line breaks, gateway-only fetch, the in-flight cap
(protocol.test.ts, bridge.test.ts); base URLs - https or loopback http, no credentials
(settings.test.ts); the gateway’s queue cap (gateway.test.ts). Each was checked by taking the
guard out and seeing its test fail.
Ask about the agents
What you write goes to the project's server and an AI model. Answers can be wrong.
Loading the chat…