agent-introspection-debugging

Diagnoses and recovers failing AI agent runs through structured capture, root-cause analysis, and introspection reports.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/freedom909/real-estate-saas --skill agent-introspection-debugging-freedom909
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agent-introspection-debugging
Source: https://github.com/freedom909/real-estate-saas/tree/main/.trae/skills/agent-introspection-debugging
Command: npx skills add https://github.com/freedom909/real-estate-saas --skill agent-introspection-debugging-freedom909

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agent runs often fail by looping on the same tools, burning tokens without progress, or drifting from the intended task. This Skill provides a structured self-debugging workflow so the agent captures the failure, diagnoses the root cause, applies a contained recovery, and reports the outcome instead of retrying blindly. ## Core Features & Use Cases - Four-Phase Debug Loop: Failure capture, root-cause diagnosis, contained recovery, and a structured introspection report. - Failure Pattern Matching: A diagnostic table maps symptoms like maximum tool calls, context overflow, ECONNREFUSED, 429 quota exhaustion, and stale file state to likely causes and checks. - Recovery Heuristics: Ordered interventions that restate the objective, verify world state, shrink scope, and run one discriminating check before retrying. - Use Case: An agent hits its tool-call limit while repeatedly running the same failing test command. The skill guides it to capture the error, classify the loop pattern, isolate the single failing test, apply one corrective action, and produce a self-debug report for the human. ## Quick Start Ask the agent to use the agent-introspection-debugging skill to diagnose why its current run keeps looping and produce a self-debug report.

Frequently Asked Questions about agent-introspection-debugging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug an AI agent stuck in a tool-call loop?▼

Capture the failure state first, including the last tool calls and error message, then match the repetition pattern against known causes like no-exit observer paths. Apply the smallest corrective action, such as shrinking scope to one failing command, before retrying.

How to stop an AI agent from burning tokens without progress?▼

Restate the real objective in one sentence, verify actual world state instead of trusting memory, and trim low-signal context like duplicated plans and oversized logs. Then run one discriminating check and only retry if the evidence supports it.

What causes AI agents to hit maximum tool call limits?▼

The most common cause is a loop where the agent retries the same command with slightly different wording and no exit condition. Inspect the last N tool calls for repetition, then classify whether the failure is logic, state, environment, or policy related.

When should an agent escalate to a human instead of self-recovering?▼

Escalate when the failure is high-risk, externally blocked, or when contained recovery actions have not produced evidence of improvement. The introspection report should mark the result as blocked and describe the follow-up needed.

What are the limitations of agent self-debugging workflows?▼

This is a workflow skill, not a hidden runtime, so it cannot enforce auto-healing actions like resetting agent state or updating harness config. It also defers feature verification after code changes to a separate verification-loop skill.