See what your AI coding agent is doing with Datadog Lapdog

cebert1 pts0 comments

See what your AI coding agent is doing with Datadog Lapdog

Sign in<br>Subscribe

It’s important to have real-time visibility into what AI coding agents are doing. In May 2026, Datadog released Lapdog, a free local development tool that makes it easy to get these insights. If you want better visibility into what your agents are doing, Datadog Lapdog may be worth giving a try.<br>You can pair Lapdog with Claude Code, Codex, or Pi, and it shows the sessions, prompts, tool calls, and token costs in your browser as the agent runs. While you can get similar visibility with OTEL and a stack like Prometheus, Lapdog installs with a single command and provides a great, developer friendly experience. You don't have to be a Datadog customer to use this tool. By default, your session data remains on your local device. If you are a Datadog customer, you can optionally configure Lapdog to forward sessions to longer-term storage via an API key with the --forward option.<br>With Lapdog, there are two main components that make it work. First, there’s a local agent (dd-apm-test-agent) that listens on localhost:8126 and captures session information. Second, there’s a dashboard hosted at lapdog.datadoghq.com. While this site is internet-accessible, the browser only reads directly from your machine via localhost. If you decide Lapdog isn’t for you, you can easily remove it in a few steps.<br>Lapdog captures sessions in two different ways. First, the agent runs as a proxy to capture model request traffic. This allows the agent to gather prompts, responses, and token metrics. Second, Lapdog subscribes to be notified via non-blocking hooks to events such as tool calls, permission events, and lifecycle events. Lapdog has different levels of support depending on the agent. For example, both Claude Code and Codex agents are monitored via proxy and hooks. However, Pi is currently only monitored with hooks.<br>As an aside, this implementation is a great example of interesting capabilities you can add to coding agents using hooks.<br>Getting started<br>Datadog Lapdog currently supports instrumenting the Claude Code, Codex, and Pi agents. Since I use the Claude Code agent most in my free time (and have a personal Max subscription), the rest of this post will focus on Claude in the examples. However, your experience will be very similar using Codex or even Pi.<br>You can install Lapdog on macOS, Linux, or Windows, or use its Docker image.<br>I use a Mac for personal development, so the one-line installation option makes it easy to get started. On macOS machines with Brew installed, you can install Lapdog with a single command:<br>brew install datadog/lapdog/lapdogAfter installing Lapdog, you need to install the Lapdog plugin in order to register the non-blocking hooks with your coding agent. Lapdog will do the setup for your coding agent for you. For example, you can set up the hooks in Claude Code by running:<br>lapdog claudeA screenshot of Datadog Lapdog profiling a Claude Code sessionNote: Sessions launched as plain claude or codex only send hook events to Lapdog, which carry no token usage at all. If you want to gather token usage information, you must launch your agent with the proxy path (lapdog claude).<br>If you're not on macOS or want the full list of install options, commands, and flags, they're documented on the Lapdog documentation page. Additionally, the agent's source code is available in the dd-apm-test-agent repository which is helpful to reference if you want a better understanding of how this tool works.<br>If everything is set up correctly, you should be able to visit lapdog.datadoghq.com and view your session dashboard like the example below:<br>Claude Code and Codex sessions in the Lapdog dashboardOnce you load the dashboard, you can switch between sessions, traces, and spans views. Lapdog traces are timelines of what an AI coding agent did during a task:<br>Lapdog tracesA span is one operation within a trace:<br>Lapdog tracesSession management<br>It's worth noting that Lapdog only keeps sessions in the local agent's memory. If you restart your computer or the agent, prior sessions will be lost unless you opt in to the Datadog forwarding integration.<br>If you leave your computer running for several days or are a heavy LLM user, it may be helpful to clear out previous sessions. You can do this by simply restarting the Lapdog agent:<br>lapdog stop && lapdog startThis stops the background service, which clears out the sessions, and leaves you with an empty dashboard.<br>Seeing a real session<br>My favorite way to use Lapdog is to select a session of interest from the dashboard and click on it to drill into it. I created a small scratch repo at ~/Code/lapdog-demo with a buggy slugify.js and a slugify.test.js suite where two of the four tests fail on purpose. With Lapdog running, I opened Claude Code in the repo and prompted it with > the slugify tests are failing, please fix them.

Once it finished, I switched over to lapdog.datadoghq.com and opened the session view. The run shows...

lapdog agent claude datadog code sessions

Related Articles