LLenny's Podcast
← All frameworks
ProductivityZevi Arnovitz (Meta)

Root-Cause Tooling Post-Mortem

When AI botches something, ask what in its prompt caused it — then patch the tooling

Difficulty
Easy
Time to result
~ongoing to results
Steps
4
Confidence
90%

Instead of brute-forcing a stuck agent until it works and moving on, run a post-mortem: ask the model what in its system prompt or tooling caused the mistake, then update the documentation, tooling, or slash commands so the same mistake can't recur. This compounds: your prompts and docs get smarter over time even as the models do. Use it every time an agent fails or produces a bug that reveals a misunderstanding.

Origin

Early on Zevy would just 'keep running at the wall' until code worked. He learned that updating documentation and tooling is 'one of the biggest hacks for productivity' and now does a post-mortem on every failure — and even on successes.

Core principles

  • 01A failure is a signal about your tooling, not just a bug to squash
  • 02Have the model introspect on the root cause before you fix the symptom
  • 03Encode the fix into durable docs/tooling/commands so it never recurs
  • 04Do post-mortems on successes too, not only failures

How to run it

  1. 1

    Catch a meaningful failure

    Notice when the agent fails to execute correctly or produces a bug that shows it didn't understand something.

    Watch out Don't just re-run until it passes and move on — that leaves the root cause in place.

  2. 2

    Ask for introspection

    Ask the model: what in your system prompt or tooling made you make this mistake? Let it go introspective and surface the root cause.

  3. 3

    Patch the durable layer

    Update the tooling, documentation, or the relevant slash-command prompt so the mistake never occurs again.

    Pro tip It won't always be a slash command — sometimes it's other documentation or tooling; fix whatever the root cause points to.

  4. 4

    Iterate your prompts continuously

    Revisit prompts that weren't good enough, iterate them, and watch the AI's responses improve — this is what separates people 'okay with' AI from those who know how to use it.

In the wild

Turning a bad bug into a permanent fix

When Claude produced a bug revealing a misunderstanding, Zevy asked what in its prompt or tooling caused it, then had it update the tooling and docs so the mistake could not recur.

The workflow's non-model components (docs, tooling, commands) keep getting smarter alongside the models.

Common mistakes

Running at the wall until it works

Declaring victory the moment code works leaves the underlying prompt/tooling flaw in place, so the same class of mistake keeps recurring.

Is it for you?

Best for

Anyone building a durable AI workflow they'll reuse across many features

Not ideal for

One-off throwaway tasks where the tooling will never be reused

From the transcript

I'll ask it what in your system prompt or tooling made you make this mistake and cloud will kind of like go introspective and think…

46:30

let's update your tooling and documentation so that this mistake never occurs again

46:30

updating documentation and tooling is one of the biggest hacks for productivity

46:00

From the episode

The non-technical PM’s guide to building with Cursor

Zevi Arnovitz (Meta)