The VS Code extension that turns your debugger into a visual story of your code's execution.
See every function call, inspect every variable, and let AI agents debug for you β across 9 languages.
The built-in VS Code debugger shows you where you are. Debug Graph shows you how you got there.
When you hit a breakpoint, the standard call stack is a flat, text-heavy list. You have to click through each frame one at a time, mentally reconstructing the call chain. If you want to know a variable's value three frames up, you switch frames, scroll, squint, switch back. You repeat this hundreds of times a day.
Debug Graph renders the entire call chain as an interactive visual tree β every function, its source code, and every variable, all visible at once. No clicking between frames. No mental reconstruction. Just scroll and see everything.
And if you're using AI coding agents (Copilot, Cursor, Claude Code), Debug Graph gives them something no other extension does: direct control over the VS Code debugger through 20 MCP tools. Your AI agent can set breakpoints, step through code, inspect variables, and evaluate expressions β autonomously.
| Capability | What you get |
|---|---|
| πΊοΈ Visual Call Tree | Every function in the call chain displayed with its full source code, stacked vertically. Scroll through the entire execution path at a glance |
| π Inline Variable Inspection | Hover over any identifier in any frame to see its runtime value β no switching frames, no debug console |
| π― One-Click Navigation | Click any frame header to jump to that exact line in your editor. Click "Highlight Frame" to focus the debugger on that stack level |
| π§Ή Executed-Code-Only Mode | Collapses functions to show only the lines that actually ran. See the execution path without the noise |
| π Any Languages, One Tool | Go, Python, JavaScript, TypeScript, C, C++, Rust, C#, Zig - same UI, same workflow |
| π€ AI Agent Debugger (MCP) | 20 tools + 1 prompt that let AI coding agents control the debugger directly. See below |
This is the headline feature. Debug Graph includes a built-in Model Context Protocol server that exposes the VS Code debugger to AI agents.
Your Copilot, Cursor agent, or Claude Code can now:
- Start and stop debug sessions
- Set and remove breakpoints
- Step through code (over, into, out)
- Inspect variables in any stack frame
- Evaluate expressions in the running program
- Read source files
- List threads and switch between them
- Wait for breakpoint hits with timeouts
| Category | Tools |
|---|---|
| Session | get_active_session, list_debug_configs, start_debug, stop_debug, restart, disconnect |
| Breakpoints | list_breakpoints, set_breakpoint (source + function), remove_breakpoint |
| Execution | resume, pause, step_over, step_into, step_out |
| Inspection | get_stack_trace (per thread), list_threads, get_variables (all scopes, per frame), evaluate (per frame), get_source |
| Coordination | wait_for_breakpoint_hit (with timeout, early-return if already paused) |
The MCP server publishes a debug_session_workflow prompt. When an agent calls it, it receives a complete workflow guide. A typical agent debugging session looks like:
1. list_debug_configs β Find available launch configurations
2. start_debug β Launch the program
3. set_breakpoint β Set breakpoints at suspicious locations
4. wait_for_breakpoint_hit β Wait until the program pauses
5. get_stack_trace β Read the call stack
6. get_variables β Inspect all variables in scope
7. evaluate β Test hypotheses with expressions
8. step_over / step_into β Advance execution
9. (repeat 5-8 until root cause found)
No more "I can't see runtime values" from your AI agent. It can now inspect the actual program state.
The MCP server is enabled by default. Your AI agent discovers it automatically β no setup required.
To disable: set "debug-graph.mcp.enabled": false in VS Code settings, then run Debug: Restart MCP Server.
Works with any VS Code debug adapter. Tested and verified:
| Language | Debugger | Linux | Windows | Notes |
|---|---|---|---|---|
| Go | delve | β | β | Full symbol resolution |
| Python | debugpy | β | β | |
| JavaScript | Node.js | β | β | |
| TypeScript | pwa-node | β | β | Deno runtime |
| C++ | GDB | β | β | |
| C | GDB | β | β | |
| Rust | LLDB | β | β | |
| C# | dotnet | β | β | .NET 6 & 8 |
| Zig | LLDB | β | β | v0.14 |
β Verified Β Β β Known issues Β Β β Not yet tested
Test projects for every language live in test_code/.
VS Code Marketplace (one click):
ext install k0in.debug-graph
Or search "Debug Graph" in the Extensions panel.
- Set a breakpoint anywhere in your code
- Start debugging (F5)
- When the debugger pauses, click the π Call Graph button in the editor toolbar
- The call tree opens β scroll through every frame, hover over variables, click to navigate
Pro tip: Use the dropdown to switch between Default (full source), Only Executed Code (collapse noise), and Full Scopes (expand all scopes).
ββ VS Code Extension Host βββββββββββββββββββββββββββββββββββββββ
β β
β ββ extension.ts βββββββββββββββββββββββββββββββββββββββββββ β
β β β’ Manages webview lifecycle β β
β β β’ Fetches stack traces via Debug Adapter Protocol β β
β β β’ Extracts source code + symbols for each frame β β
β β β’ Starts HTTP server for MCP β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β β
β βΌ βΌ β
β ββ Webview (Vue 3) βββββ ββ MCP HTTP Server ββββββββββββ β
β β β’ Monaco editors β β β’ 20 debug tools β β
β β β’ Comlink RPC β β β’ Streamable HTTP transportβ β
β β β’ Theme sync β β β’ Zod schema validation β β
β β β’ Variable hover β β β’ Direct vscode.debug.* β β
β ββββββββββββββββββββββββ βββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Key design decisions:
- No child process for MCP β runs in-process via
http.Server, zero latency, no serialization overhead - Monaco in webview β full editor fidelity, VS Code theme matching, hover providers
- Comlink RPC β typed, bidirectional communication between extension host and webview
- Symbol-aware extraction β uses VS Code's document symbol providers to extract function boundaries, not just line ranges
Bug reports, feature requests, and pull requests are welcome.
git clone https://github.com/K0IN/stacktrace-history.git
cd stacktrace-history
npm run install-deps # Install all dependencies
npm run compile-all # Build extension + frontendPress F5 to launch the Extension Development Host.
| Layer | Technology |
|---|---|
| Extension host | TypeScript, VS Code API, Debug Adapter Protocol |
| MCP server | @modelcontextprotocol/server, Zod, Streamable HTTP |
| Webview UI | Vue 3, Pinia, Monaco Editor |
| RPC bridge | Comlink (Google Chrome Labs) |
| Frontend build | Vite, esbuild |
| Extension bundle | Webpack |
MIT β see LICENSE.
Built with β€οΈ for developers who are tired of `console.log` debugging.
