Back
50/65
Lesson 50
8 min
Debugging Agent Issues
Diagnose rate limits, network failures, and cost overruns with RANO, CAUT, FrankenTerm, and CASS
Ready to level up?
Mark complete to track your learning progress.
Diagnose rate limits, network failures, and cost overruns with RANO, CAUT, FrankenTerm, and CASS
Mark complete to track your learning progress.
Diagnose agent failures, rate limits, cost overruns, and network issues using RANO, CAUT, FrankenTerm, 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 observer — which process talks to which provider
Usage tracking — quota windows and per-session cost
Terminal state — pattern detection across panes (ft, installed separately)
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
ntm send myproject --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: Look for reconnect storms (RANO sees sockets, not HTTP status codes)rano --pattern claude --retry-threshold 5 --retry-window-ms 30000# Look for: retry-pattern warnings against one provider endpoint# Step 2: Check which provider is throttlingcaut usage --provider all# Shows each provider's remaining session/weekly quota and reset time# Step 3: Check FrankenTerm for usage-limit events across panesft robot events --rule-id "claude_code.usage.reached" --unhandled# Step 4: Rotate to a fresh accountcaam limits claudecaam next claude# Step 5: Check CASS for how you solved this beforecass search "rate limit workaround rotation" --limit 3
RANO attributes every socket your agents open to a process and provider (it does not decrypt or log payloads), so you can see which agent is talking to which endpoint and how often.
# Common patterns and what they mean:# Rapid reconnects to one endpoint → Retry storm, often rate limiting (use CAAM to rotate)# Connection timeouts → Network/DNS issue (check VPS connectivity)# 500/503 errors in agent output → Provider outage (switch to different provider)# Connections far longer than your baseline → Slow responses, provider overloaded (try 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 session --today# Usage trend over the last two dayscaut history show --days 2# Rescan local logs for cost totalscaut cost --refresh# Drill into one RANO session's connectionsrano report --run-id <run-id># 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 Claude Fable or Opus when Sonnet would suffice
FrankenTerm (ft, the successor to WezTerm Automata; ACFS doesn't install it) detects when agents go silent. An idle pane usually means the agent is waiting for approval, hit an error, or is genuinely stuck.
# List every pane the mux can seeft robot state# Get the last 50 lines from a stuck paneft robot get-text <pane_id> --tail 50# Search captured output from that paneft search "error" --pane <pane_id># Check if agent is waiting for approvalft robot events --rule-id "claude_code.approval_needed"# Force-send a nudge to wake up a stuck agent (policy-gated)ft 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 usage = instant health check
FrankenTerm events + RANO reports = full connection trace
caut cost + caut session drill-down = spend accountability
CASS history + CM playbook = never solve twice