---
title: 'Closing the loop: using coding agent traces in Pydantic Logfire'
description: >-
  Coding agents do real work every day, and almost none of it gets recorded.
  This recording shows how to trace any coding harness into Pydantic Logfire,
  then query those traces to compare harnesses on cost, output and quality.
date: '2026-10-29'
dateDisplay: 'Oct 29, 2026'
duration: 30 min
status: past
tags:
  - Logfire
speakers:
  - Duncan McKinnon
canonical: 'https://pydantic.dev/events/closing-the-loop-coding-agent-traces'
---

> Markdown version of [Closing the loop: using coding agent traces in Pydantic Logfire](https://pydantic.dev/events/closing-the-loop-coding-agent-traces) — the canonical HTML page.
>
> Oct 29, 2026 · 30 min · Speakers: [Duncan McKinnon](https://pydantic.dev/authors/duncan-mckinnon.md)
>
> All events: [/events.md](https://pydantic.dev/events.md) · Site index: [/llms.txt](https://pydantic.dev/llms.txt)

---

# Closing the loop: using coding agent traces in Pydantic Logfire

Coding agents do real work every day, and almost none of it gets recorded. This recording shows how to trace any coding harness into Pydantic Logfire, then query those traces to compare harnesses on cost, output and quality.

## What you'll learn

- How to capture traces from your coding harness, and what's inside them
- How to compare harnesses on cost, output and quality using real data, not vibes
- How to turn traces into better skills, evals and self-improvement loops

## About

Coding agents do real work every day, and almost none of it gets recorded. The commit and the PR survive, but how the agent got there doesn't. When a result is bad, you have few good options. You can ask an agent to fix it without showing it where things went wrong. You can rewrite your instructions without knowing what was off. Or you can switch tools without knowing what you're giving up.

Every question you'd want to ask is answered in the traces. Which harness is best at code review? Would a cheaper model give the same results? Did the agent get confused by its tools and burn two million tokens? Is it re-exploring the same tasks every session?

In this workshop, Duncan McKinnon sets up tracing for a coding harness into Pydantic Logfire. He walks through what a trace holds, from the full session down to each turn, model call, tool run and subagent. Then he puts that OpenTelemetry data to work by querying it with the Logfire MCP server, and builds the metrics you should use to evaluate your harness.

## Recording

Watch the recording on the event page: https://pydantic.dev/events/closing-the-loop-coding-agent-traces
