Log and Examine Real User Traces
Log the complete sequence needed to understand each interaction: user input, model output, retrieval, tool calls, latency, version metadata, and outcome. Redact unnecessary personal data before analysis.
Debug an AI product from observed behavior instead of vibes: sample real traces, annotate the earliest meaningful failure, count a grounded error taxonomy, and build narrow evals that can tell whether a change fixed the problem without creating a regression.


Source episode · 05:00
How I AI: Hamel Husain's Guide to Debugging AI Products & Writing Evalswith Claire Vo
Hamel walks from real user traces through open-coded notes, error categories, counts, targeted binary evals, human-labeled judge calibration, and experiments on prompts, retrieval, and agent transitions.
A prioritized error inventory, a human-labeled evaluation set, calibrated issue-specific evaluators, and evidence showing how a candidate change affects the targeted error and existing behavior.
OpenAI conversational AI
Step by step
Follow the sequence once, then adapt the prompts, checks, and handoffs to your own setup.
6 steps
Log the complete sequence needed to understand each interaction: user input, model output, retrieval, tool calls, latency, version metadata, and outcome. Redact unnecessary personal data before analysis.
Draw a stratified random sample and read the traces with human eyes. Add a short note about the earliest meaningful error, its evidence, and user impact. Do not jump directly to a global score.
For each trace, identify the earliest actionable error. Return trace ID, quoted evidence, expected behavior, observed behavior, user impact, and a one-sentence open-code note. If the trace is acceptable or uncertain, say so.
Focusing on the most upstream error is a powerful heuristic. Fixing early intent clarification or tool call issues often resolves many downstream problems.
Use a low-friction annotation view that preserves the trace and its metadata. Define who may label which domain, record uncertainty, and retain disagreements for calibration instead of forcing consensus.
Cluster the open-coded notes into a taxonomy, then have domain experts merge, split, and define the categories. Count errors by important segment and prioritize by frequency, severity, and strategic importance.
Cluster these notes into candidate error categories. For each category, propose a definition, inclusion and exclusion rules, representative trace IDs, count, affected segments, and likely system layer. Preserve an other category and do not erase ambiguous notes.
For each priority error, write a binary evaluator grounded in the human labels. Measure its agreement, precision, recall, and failure examples on held-out data before applying it at scale.
Create a binary evaluator for [specific error]. Define pass and fail behavior with examples from the labeled set. Return the decision plus cited evidence. Do not score unrelated qualities. Compare its predictions with held-out human labels and list every disagreement.
Use the evidence to choose the likely system layer: prompt, context, retrieval, tool, model, or product flow. Change one versioned component, run the targeted and regression sets, inspect failures, and record the result before rollout.
Evaluate candidate version [version] against baseline [version]. Report target-error results, regression-suite results, changed trace IDs, new failure categories, latency, and cost. Do not summarize away individual regressions with an average score.
Turn an idea into a PRD, user stories, and a plan.
After the steps
How to recover when the loop fails and where human judgment helps.
Recover
Keep building

Log your workouts effortlessly without ever opening a spreadsheet. This workflow uses the Claude mobile app to parse a simple voice note and automatically update your workout tracking spreadsheet in the background.

Create a custom email management interface within Claude to read, triage, and draft replies without opening the Gmail tab. This workflow helps you reclaim focus and compound your learnings by training your AI on every interaction.

Build a fully automated system in Claude to generate personalized, interactive HTML proposals and client onboarding materials, saving hours on administrative work and creating a high-touch experience.
Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.