Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>Agent by dudko.devNew to Visual Studio Code? Get it now.
Agent by dudko.dev

Agent by dudko.dev

Dudko Dev

|
1 install
| (0) | Free
An agent inside VS Code that works on your project with you: bring your own key, any provider, a transparent plan; every change shown in a diff and every command asked first.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Agent by dudko.dev — VS Code extension (stage 4)

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, 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.

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.

What it does

Chat The Agent view in the activity bar: the plan, each step, every tool call and its result, the answer streamed. New Chat and Open Settings in the view's title bar.
Models Three stages, each its own model: the executor (dudkoAgent.model.*: calls the tools), the planner (dudkoAgent.planner.*: writes and revises the plan) and the synthesizer (dudkoAgent.synthesizer.*: writes the answer). An empty planner / synthesizer setting takes the executor's. Providers: Anthropic, OpenAI, Google (Gemini), DeepSeek, xAI, and any OpenAI-compatible server (OpenRouter, Ollama, LM Studio, llama.cpp, vLLM) through baseUrl.
Keys Agent: Set API Key… stores a provider's key in VS Code's SecretStorage (your OS keychain). Never in a setting, a file, the webview, an event or a log; sent only to that provider. Agent: Remove API Key… deletes one.
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.
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, 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.
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

Setting Default
dudkoAgent.model.provider anthropic The executor's provider (and of every stage that names none)
dudkoAgent.model.id The executor's model id - required
dudkoAgent.model.baseUrl A base URL: required for openai-compatible; https://, or http:// on localhost only. User setting only
dudkoAgent.planner.provider / .id / .baseUrl (the executor's) The planner's model
dudkoAgent.synthesizer.provider / .id / .baseUrl (the executor's) The synthesizer's model
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). 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; 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). 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

Commands: Agent: New Chat, Set API Key…, Remove API Key…, 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.

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's Read(…) deny rules; files .gitignore, files.exclude or search.exclude leave 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 over maxFileKb; 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.

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 named notes.txt that points at .env is refused); denied files are never listed or searched either. The setting is application-scoped and in restrictedConfigurations: a workspace's .vscode/settings.json cannot 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 by startLine). 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 says truncated), their order (path, line) does not.
  • Without ripgrep, still the same guard. Search uses the ripgrep VS Code ships. If it is not found, search_text falls back on the editor's file listing (which follows symlinks): each file goes through read_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

  • The chat asks. In ask-writes mode (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's answers route. 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: allow rules are never applied (a read-only tool is never asked anyway). A deny always 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_command and run_tests are asked on every call (a rule ask is 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

  • 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_*), plus NO_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 /T on 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 with setsid is 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 all rm) 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 '…' and eval. Bash(rm:*) refuses rm -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 push is refused in any form the check can see: push or send-pack anywhere 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_push is the one way: asked, then confirmed. An alias already in your git config is invisible to the check: the card shows git p, and you decide. A line naming .claude/settings is refused, and so is a shell write into .claude/ - a redirection, a writer (tee, cp, mv, rm, sed -i, …) or cd into 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.
  • 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 testObserver API), so run_tests runs the project's test command instead - asked like any command - and reads its output.

Modes

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

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)

  • Instructions: CLAUDE.md (and .claude/CLAUDE.md), AGENTS.md, .github/copilot-instructions.md, .cursorrules and .cursor/rules/*.mdc, GEMINI.md - each a switch. The root's go into the system prompt; a nested folder's CLAUDE.md / AGENTS.md / GEMINI.md come 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_file for 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 permissions of ~/.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 and run_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. Every Bash(…) also names command lines: a deny is refused by run_command / run_tests (read widely, above), an ask is always asked even if the line is on your own list. They only narrow: deny and ask apply, the strictest wins, and a deny always holds. allow rules 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 in deny rules only (Read(./secrets/**) adds to the deny list, Edit(generated/**) to what is never written). git_push is at least ask. hooks never run, env is 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.json values of editor.defaultFormatter, editor.formatOnSave, editor.tabSize, editor.insertSpaces, files.eol, files.insertFinalNewline, files.trimTrailingWhitespace and files.exclude - one short line each, as facts.

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

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)
  • 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.ended markers), and the element's backendFetch property carries every request over postMessage (src/bridge.ts, src/protocol.ts). The base URL (https://agent.vscode.invalid) never resolves; the webview's policy has connect-src 'none'. Nothing of the in-browser agent is in the webview (@dudko.dev/agent-web is 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's toolApproval.onRequest waits on it, carried to the turn by an AsyncLocalStorage scope (agent-runner.ts). The chat draws the core's tool.approval-requested as 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 by runProcess (process.ts: spawn of 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 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

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 vscode
pnpm 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. Set a model (dudkoAgent.model.id) and a key (Agent: Set API Key…), open the Agent view.

Install it locally.

cd apps/vscode && pnpm package      # builds, then dist/agent.vsix (vsce, --no-dependencies)
code --install-extension dist/agent.vsix

Publishing 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

  • 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 need rg on PATH or RG_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; needs git, 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's answers, 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).
  • 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 /mode go 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, or VSCODE_VERSION) over a trusted test workspace that is a git repository with a CLAUDE.md and 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_diff through VS Code's git, git_push denied by the project's rule, the CLAUDE.md quoted 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's Bash(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 .env untouched. The model is set through activate()'s testing seam, returned ONLY in ExtensionMode.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)

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.

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. 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.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft