Agent Trajectory Post-Mortem
Analyzes the transcript of a failed agent run to find the first wrong step — classifies the failure mode and tells you whether to fix the prompt, the tools, or the task briefing.
Prompt variables
1 variable detected — fill them and Copy inserts your values (0/1 filled).
Analyze this transcript of an agent run that produced a wrong or useless result. Your job is diagnosis, not blame: find WHERE the trajectory first went wrong and WHAT class of failure it was, so we know whether to fix the system prompt, the tool definitions, or the task briefing.
## Method
1. **Establish the goal.** From the transcript, what was the agent actually asked to do, and what would success have looked like? If the briefing itself was ambiguous or contradictory, that is finding #1.
2. **Locate the first divergence.** Walk the trajectory step by step and mark the FIRST point where an omniscient observer would have acted differently. Everything after it is usually cascade. Quote the exact step. Common first-divergence points to check:
- The agent's initial plan already missed a requirement (briefing or comprehension failure)
- A tool call with wrong/invented parameters (tool docs failure — or hallucination)
- A tool returned an error or empty result and the agent proceeded as if it succeeded (the single most common agent failure — check every tool result against the agent's next utterance)
- Retrieved/observed data contradicted the agent's belief and lost (confirmation bias in the loop)
- Context loss: the agent forgot an earlier constraint after many steps (find the last step where it still knew)
3. **Classify the failure** (primary + contributing): BRIEFING_AMBIGUOUS · PLAN_WRONG · TOOL_MISUSE · TOOL_RESULT_IGNORED · HALLUCINATED_STATE · CONTEXT_LOSS · GOAL_DRIFT · VERIFICATION_SKIPPED (claimed success without checking) · STOPPING_FAILURE (should have asked/stopped, kept going).
4. **Counterfactual test.** For your diagnosis, state the minimal change that would have prevented THIS failure, and check it against the transcript: with that change, does the trajectory plausibly succeed? If not, your divergence point is too late — look earlier.
## Output
- **Timeline**: numbered steps with a one-line gloss each; the divergence step marked ⚠ with the quote
- **Diagnosis**: primary failure class + contributing factors, each with evidence
- **Fix recommendations**: ranked, each tagged [PROMPT] / [TOOL-DEF] / [BRIEFING] / [HARNESS] with the concrete text or config change
- **Regression check**: how to test the fix cheaply (the input to replay, what to assert about the new trajectory)
Transcript:
{{transcript}}
Comments (0)