DAP Debugger

Built-in Debug Adapter Protocol support gives the Kimchi agent runtime debugger access — breakpoints, stepping, variable inspection, and expression evaluation across multiple languages.

Kimchi ships with built-in Debug Adapter Protocol (DAP) support, giving the agent runtime debugger access. The DAP extension loads by default — no configuration required. It detects installed debug adapters on your PATH and registers debug tools the agent can use to set breakpoints, step through code, inspect variables, and evaluate expressions.

Supported languages

LanguageAdapterTransportInstall
TypeScript / JavaScriptjs-debugTCPDownload js-debug-dap-<ver>.tar.gz from vscode-js-debug releases, extract, and set JS_DEBUG_PATH to the extracted js-debug/src/dapDebugServer.js
Pythondebugpystdiopip install debugpy
GodlvTCPgo install github.com/go-delve/delve/cmd/dlv@latest
C / C++ / Rust / Swiftlldb-dapstdioInstall via your LLVM/Clang distribution or cargo install lldb-dap
Java / Kotlinjava-debugstdioInstall the Java Debug Server
RubyrdbgstdioShips with Ruby 3.1+ or: gem install debug
PHPphp-debug-adapterstdionpm install -g php-debug-adapter

Adapters are auto-detected via which on PATH (or module-presence checks for debugpy and js-debug). If an adapter binary is not found, the corresponding tools are silently unavailable and the status bar shows the adapter as not installed.

Project detection

Adapters are only activated when the current project has a matching root marker file:

AdapterRoot markers
dlvgo.mod
js-debugpackage.json, tsconfig.json
debugpypyproject.toml, setup.py, requirements.txt, Pipfile
lldb-dapCargo.toml, CMakeLists.txt, Makefile, Package.swift
java-debugpom.xml, build.gradle, build.gradle.kts
rdbgGemfile, Rakefile
php-debug-adaptercomposer.json

Kimchi walks from the working directory up to the filesystem root looking for these markers. A Go project won't activate js-debug even if it's installed, and vice versa.

Tools

The DAP extension registers two layers of tools.

Composed tools (one-call)

These handle the full launch → breakpoint → inspect → terminate lifecycle in a single call. Prefer these for most debugging tasks.

ToolDescription
debug_state_atSet a breakpoint at file:line, run to it, and return locals + backtrace + evaluated expressions
debug_last_errorRun until an exception is thrown, return the exception type/message + locals at the throw site
debug_trace_callsRun to completion, return structured call records via sentinel parsing
debug_watch_changeWatch an expression for value changes across stepping

Primitive tools (interactive)

For fine-grained control over a debug session. Each tool takes a session_id returned by debug_launch.

ToolDescription
debug_launchLaunch a debug session (program, adapter, stop_on_entry)
debug_set_breakpointSet a breakpoint at file:line (with optional condition)
debug_continueResume execution, wait for next stop
debug_localsGet local variables (with one level of nested struct expansion)
debug_evalEvaluate an expression in the current frame
debug_backtraceGet the call stack
debug_terminateEnd the debug session
step_in / step_over / step_outStep through code
debug_set_variableSet a variable's value at runtime
debug_restartRestart the debug session (if the adapter supports it)

The agent is prompted to prefer composed tools over manual stepping — for example, debug_state_at over a manual launch → breakpoint → continue → inspect sequence.

Plan mode

All debug tools are available in plan mode (explore/plan phases). Debugging is treated as investigation — launching and stopping a debuggee does not modify project files. Note that a launched debuggee executes arbitrary code and debug_set_variable mutates runtime memory, so plan mode is not strictly read-only while debug tools are enabled.

Language-specific skills

Language-specific debugging skills are injected into the system prompt on demand. They start inactive and activate on the first debug_* or step_* tool call, keeping the prompt compact when the agent is not debugging.

Each skill provides concrete expression syntax, data structure inspection patterns, and adapter-specific guidance for the language. For example, the Go skill documents that len(slice) works in debug_eval but method calls like cache.lru.Len() do not.

Status bar

The status bar reflects the three adapter states:

DAP: dlv, js-debug

When the project has markers for an adapter but the binary isn't installed, the missing adapter is called out:

DAP: dlv, js-debug · debugpy not installed

If every relevant adapter is missing:

DAP: dlv not installed

A one-time warning notification is shown on the first agent turn when adapters are missing.

Prerequisites

The DAP extension requires debug adapter binaries to be installed and available on your PATH. Install them with the commands listed in the Supported languages table above.

To verify an adapter is available:

which dlv
which lldb-dap
python3 -c "import debugpy"

For js-debug, set the JS_DEBUG_PATH environment variable to the path of dapDebugServer.js, or install it in node_modules:

# Option 1: Set the environment variable
export JS_DEBUG_PATH=/path/to/js-debug/src/dapDebugServer.js

# Option 2: Install in node_modules
npm install js-debug-adapter

If no adapters are found, the debug tools are not registered and the extension has no effect.

See also


Did this page help you?