Back
50/65
Lesson 50
8 min
Debugging Agent Issues
Diagnose rate limits, network failures, and cost overruns with RANO, CAUT, WA, and CASS
Ready to level up?
Mark complete to track your learning progress.
Diagnose rate limits, network failures, and cost overruns with RANO, CAUT, WA, and CASS
Mark complete to track your learning progress.
Diagnose agent failures, rate limits, cost overruns, and network issues using RANO, CAUT, WA, and CASS together.
When agents stop working, you need to answer: Is it a rate limit? A network issue? A cost overrun? A bug in the prompt?Four tools give you complete observability.
Network traffic — see every API call
Cost tracking — per-session spend analysis
Terminal state — pattern detection across panes
History — search past sessions for solutions
Agent Debug War Room
Step through 6 real debugging scenarios. Click “Diagnose” to analyze each one.
runLoop() called 47 times without progress
Same edit applied and reverted repeatedly
Write succeeds but lint fails
Error persists after each edit attempt
I need to fix this lint error
Let me edit the file...
Edit applied successfully
Running lint check...
Lint failed. Let me try again...
(repeats 47 times)
Agent applies correct fix
BUT: another rule conflicts
Lint reports different error
Agent reverts to original approach
Same conflict triggers again
Context window filling with retries
wa robot send pane-1 "/clear"Agent: "Add eslint-disable comment"ntm send myproject --pane=1 "Fix only the type error first"Rate limits are the most common agent failure. Here's how to diagnose and work around them.
# Step 1: Check if RANO sees 429 responsesrano status# Look for: HTTP 429 Too Many Requests# Step 2: Check which provider is throttlingcaut breakdown# Shows per-provider token consumption# Step 3: Check WA for rate limit patterns across paneswa robot events --rule-id "claude_code.rate_limit" --unhandled-only# Step 4: Rotate to a fresh accountcaam status --verbosecaam rotate# Step 5: Check CASS for how you solved this beforecass search "rate limit workaround rotation" --limit 3
RANO intercepts all agent API traffic, letting you see exactly what's happening at the network level.
# Common patterns and what they mean:# Lots of 429s → Rate limiting (use CAAM to rotate)# Connection timeouts → Network/DNS issue (check VPS connectivity)# 500/503 errors → Provider outage (switch to different provider)# Slow responses (>30s) → Provider overloaded (try during off-peak)# SSL errors → Certificate issue (check system time/certs)
When costs spike unexpectedly, use CAUT to find the expensive sessions and RANO to see what they're doing.
# Find your most expensive sessions todaycaut sessions --sort cost --limit 5# Compare against yesterdaycaut summary --period 1dcaut summary --period 2d # includes yesterday# Check token efficiency (high input/low output = wasted context)caut efficiency# Drill into a specific session's API callsrano log --session <session-id> --verbose# Common cost culprits:# 1. Agents re-reading large files repeatedly# 2. Long context windows with low-value content# 3. Agents stuck in retry loops# 4. Using Opus when Sonnet would suffice
WA detects when agents go silent. An idle pane usually means the agent is waiting for approval, hit an error, or is genuinely stuck.
# Check all pane stateswa robot state | jq '.data.panes[] |select(.idle_seconds > 120) |{id, title, idle_seconds, last_output_preview}'# Get the last 50 lines from a stuck panewa robot get-text <pane_id> --tail 50# Search for error patterns in pane outputwa search "error|failed|panic|traceback" --pane <pane_id># Check if agent is waiting for SLB approvalwa robot events --rule-id "claude_code.waiting_approval"# Force-send a nudge to wake up a stuck agentwa robot send <pane_id> "Continue with the task"
CASS stores all past agent sessions. When you encounter a new problem, search for how you (or another agent) solved it before.
# Search for how a specific error was resolvedcass search "ECONNREFUSED anthropic API fix" --limit 5# Find sessions that worked with a specific toolcass search "successfully deployed with docker" --limit 3# Search across all agent typescass search "memory leak node process" --robot --limit 5# Use CM to check if there's a playbook rulecm context "debugging API connection failures" --json
RANO status + CAUT summary = instant health check
WA events + RANO logs = full request trace
CAUT breakdown + session drill-down = spend accountability
CASS history + CM playbook = never solve twice