BH Agent Debugger

BH Agent Debugger lets AI coding agents and scripts drive the Visual Studio debugger for native C and C++ programs. It is free and open source under the MIT license. We built it while making Veilslash and use it to debug the game.

Visual Studio Marketplace | GitHub (source, releases and documentation)

In this video, Claude Code uses BH Agent Debugger over MCP on a real performance problem in Veilslash: each 30 Hz water tick cost about 16 ms on the main thread, while the GPU water work took under 1 ms. It starts the game under the Visual Studio debugger with a recorded replay, pauses it, checks the log, sets a breakpoint on the GPU readback call and reads the locals. Then it explains the cause: during replay, a lockstep flag makes that read wait for the GPU every tick. It removes its breakpoint and stops debugging without editing any code. The middle of the video is sped up 3x; the unedited run took 2 min 44 s. Also on X.

What your agent can do

  • Start debugging a solution (with launch arguments), attach to a process, stop
  • Break, continue, step into/over/out, and wait for a break
  • Set and clear breakpoints, plus address and symbol traps
  • Read the call stack, threads, registers, raw stack, memory and locals
  • Evaluate expressions; side effects and function calls stay blocked unless it asks for them
  • Open native crash dumps read-only and inspect them with the same commands
  • Capture a CPU profile with Visual Studio’s CPU Usage tool and analyze it offline: hot functions, call tree, hot paths and source lines
  • Chain several commands in one request, for example set bp main.cpp:42; continue; poll break 15000 200; where 5
  • Work with several Visual Studio instances at once

Works with your agent

Agents connect through a command-line client, an MCP server or an OpenCode tool, so it works with any MCP client. The installer can set it up for Claude Code, Codex and OpenCode, on Windows and WSL.

Requirements

  • Windows 10 or 11, x64
  • Visual Studio 2022 (17.x) or Visual Studio 2026 (18.x): Community, Professional or Enterprise, with the C++ desktop development workload
  • Native C or C++ programs (x64 or x86)

Install

Close Visual Studio, then run bh_agent_debugger.msi from the Marketplace or the latest GitHub release. It installs per user and does not need administrator rights.

Security

A connected agent can run code as you: starting or attaching a debugger, launching with arguments and evaluating expressions all run with your account’s rights. All connections are local named pipes limited to your user account; nothing listens on the network. Connect only agents you trust and keep their approval prompts on.