When an agent exhibits unexpected behavior, you need to find the root cause fast. OpenClaw provides a Trace Explorer with step-by-step replay — you see exactly what the agent thought and decided at every step.
The Trace Explorer is the centerpiece of the debugging workflow:
Shows each span chronologically with timing:
[12:04:01.000] Trace Start: order-processing-agent
[12:04:01.012] ├── intent-classification 12ms ✅
[12:04:01.024] ├── order-lookup 89ms ✅
[12:04:01.113] ├── inventory-check 45ms ✅
[12:04:01.158] ├── price-calculation 23ms ✅
[12:04:01.181] ├── llm-response-generation 1,203ms ⚠️ (slow)
[12:04:02.384] ├── guardrail-check 140ms ❌ (blocked)
[12:04:02.524] └── fallback-response 8ms ✅
For each LLM call, you can inspect:
The replay function lets you trace an agent interaction step by step:
OpenClaw categorizes errors automatically:
| Error Type | Description | Common Cause |
|---|---|---|
| LLM Timeout | API response not timely | Overload, large prompts |
| Rate Limit | API limit reached | Too many parallel requests |
| Hallucination | Fact-check failed | Insufficient context |
| Guardrail Block | Output blocked by policy | Toxic/unsafe content |
| Tool Failure | External tool call failed | API down, wrong parameters |
| Loop Detected | Agent in infinite loop | Missing exit condition |
| Alignment Drift | Score below threshold | Prompt degradation over time |
OpenClaw correlates errors automatically:
The recommended debugging process:
Practical Tip: Use the bookmark function to save interesting traces. Over time, you'll build a library of typical failure patterns that helps new team members during onboarding.