Run and debug

Run and Debug starts your program under a debugger, stops at breakpoints and lets you inspect variables, the call stack and the console. Agents can drive the same debugger themselves: set breakpoints, start a session and read the state when it stops.

What it is#

IZ Code uses the debug protocol (DAP) and the debugger extensions you already know from VS Code. Launch configurations live in .vscode/launch.json and tasks in .vscode/tasks.json, so a project that is set up for debugging in VS Code works as is.

IZ Code does not ship language debuggers. Install the debugger extension for your language from the Extensions panel, for example JavaScript Debugger (ms-vscode.js-debug) for Node.js and browser pages.

The Run and Debug view#

Click Run and Debug in the Activity Bar. The view has:

  • a configuration picker with Start Debugging (▶) and a More Actions... menu with Start Without Debugging, Stop, Restart, Open launch.json, Add Configuration..., Enable All Breakpoints, Disable All Breakpoints, Remove All Breakpoints and Open Debug Console;
  • Variables, Watch, Call Stack, Breakpoints and Loaded Scripts sections, plus any views a debugger extension adds (for example a Network view);
  • a floating debug toolbar while a session runs, with Continue, Pause, Step Over, Step Into, Step Out, Restart and Stop. Drag it to move it; double-click to put it back.

When more than one session runs (a compound configuration, or a parent and child process), a session picker lets you switch between them.

Debug a program#

  1. Install a debugger extension Open the Extensions panel and install the debugger for your language.
  2. Create a launch configuration In Run and Debug, choose Create a launch.json file, then Add Configuration.... IZ Code adds a starter configuration for the debugger that fits the open file (pick one if asked). Your existing comments and formatting in launch.json are kept.
  3. Set breakpoints Click a line's gutter to add a breakpoint. In the Breakpoints section you can add a function breakpoint, turn breakpoints on and off, and choose which Exceptions to break on.
  4. Start debugging Pick the configuration and click Start Debugging. The editor opens the file where the program stopped and highlights the current line.
  5. Inspect and step Read Variables and the Call Stack, add expressions to Watch, evaluate expressions in the Debug Console, and step with the toolbar.

A minimal Node.js configuration:

.vscode/launch.json
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Run app",
      "program": "${workspaceFolder}/src/index.js"
    }
  ]
}

Compound configurations ("compounds") and preLaunchTask work as in VS Code. If a pre-launch task fails, IZ Code asks whether to Debug Anyway.

To debug a web page in IZ Code's own browser tab, use a configuration of type editor-browser. See Browser preview.

Let the agent debug#

With Let agents use Run and Debug on, agents get a short guide in each new session and these tools:

ToolWhat it does
debugListLaunchConfigsLists the configurations in launch.json.
debugSuggestLaunchConfigSuggests a configuration from the installed debugger extensions.
debugStartStarts a named configuration or an inline one, and can wait until the program stops.
debugListSessions, debugGetStatusShows running sessions and whether they are stopped.
debugSetBreakpointsSets the breakpoints of a file (replaces the file's list).
debugContinue, debugStepOver, debugStepIn, debugStepOutResumes or steps.
debugGetCallStack, debugGetVariables, debugEvaluateReads the stack, variables and expression values.
debugGetConsoleOutputReads the program's output.
debugListExceptionFilters, debugSetExceptionBreakpointsBreaks on exceptions.
debugStopEnds a session.
listBuildTasks, runBuildTaskLists and runs tasks from .vscode/tasks.json.

A typical request: "The total is wrong for an empty cart. Put a breakpoint in calculateTotal, run the tests under the debugger and tell me what items holds." The agent sets the breakpoint, starts the session, waits for the stop, reads the variables and reports back. Sessions the agent starts appear in the Run and Debug view like your own, so you can take over at any point.

How an agent investigates with the debugger
sequenceDiagram
  participant A as Agent
  participant D as Debugger
  participant P as Your program
  A->>D: debugSetBreakpoints
  A->>D: debugStart
  D->>P: Launch
  P-->>D: Stops at breakpoint
  A->>D: debugGetVariables
  D-->>A: Variable values

In a workspace with several folders, the agent can name the folder whose launch.json to use.

Settings#

SettingValuesDefault
izcode.debug.enableChatTools (Settings ▸ Run and Debug ▸ Let agents use Run and Debug)true, falsetrue

Off removes the guide and the debug*, listBuildTasks and runBuildTask tools, and refuses every call to them. In a project's .izcode/settings.json you can only turn it off, not on.

Limits#

Last updated: December 1, 2026Was this page helpful?