diagnose_trace
Identify where a long AI-agent run went wrong by reading the trace sequentially, detecting anomalies, and returning the 3 most likely root-cause steps to inspect first.
Instructions
Find where a long AI-agent run went wrong. Reads the trace chapter by chapter
(never all at once), raises a CUSUM alarm, looks back, and returns the 3 steps to
read first. trace: path to a .json trace or a Claude Code session .jsonl, or a
LangSmith trace id. A trace under the length gate (default 50K tokens) or over the
cost ceiling (default 250K tokens) is returned with gated true and a message
saying which: it is not analysed and nothing is spent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trace | Yes | ||
| source | No | auto | |
| project | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gated | Yes | True when the trace was not analysed and nothing was spent: it is empty, under the length gate, or over the cost ceiling. `message` says which. | |
| anchor | No | ||
| message | Yes | ||
| n_steps | Yes | ||
| cost_usd | No | ||
| suspects | No | ||
| n_chapters | No | ||
| judge_calls | No | ||
| trace_tokens | Yes | ||
| alarm_chapter | No | ||
| judge_seconds | No |