What does this skill do?

Skill's Introspective Agent Debugging provides a four-phase workflow that allows an AI agent to diagnose and recover from its own failures in a structured manner before escalating the issue to a human. It resolves the issues of infinite loops, uncontrolled token consumption, and context drift without real progress, returning a report that can be reused by another agent or by a human.

Tool Call Loop
The agent repeats the same command in a loop or reaches the maximum limit for tool calls without making any progress.
Context overflow
Retrying does not result in any real progress, and the context grows out of control, degrading the quality of the output.
Derived from the prompt or assignment
Output quality is compromised by prompt drift, note duplication, or a mismatch between the expected state and reality.
Tool recovery error
A tool experiences a recoverable failure, and a diagnosis and minimal corrective action are required before retrying.

Usage examples

🔁 Retry loop
I've tried running the same command three times, and the context keeps growing without making any progress. Take a screenshot of the error and diagnose the root cause.
🔌 Connection rejected
The agent fails with the error "ECONNREFUSED" on localhost:5432. Check the actual status of the service before retrying.
🎯 Context drift
The output is deteriorating, and the agent has strayed from its original goal. Trim the low-signal context and reduce the scope to a single command.
📋 Self-Reflection Report
Generate a self-diagnostic report that can be reused by another agent or a human, including the failure pattern, root cause, corrective action, and preventive measure.

Features

Structured Record of the Ruling Record the exact error, the last sequence of tools, the current target, the context pressure, and the environment assumptions before retrying.
Root Cause Analysis Classify the error into known patterns (call loop, context overflow, connection refused, quota exhausted, file not found, incorrect assumption) and determine whether it is related to logic, state, environment, or policy.
Moderate recovery Apply the smallest action that changes the diagnostic surface, stop blind retries, prune low-signal context, and scale to human intervention if the failure is high-risk.
Reusable Self-Reflection Report Returns the failure pattern, root cause hypothesis, corrective action taken, and evidence of improvement—all ready for the next agent or person without having to replay the session.
Programmable preventive replacement Each report includes a specific corrective action to be implemented to prevent the same failure pattern from recurring.

Frequently asked questions

When the agent reaches the limit on calls to tools, it repeats the same command in a loop, the context grows without any real progress, or a tool fails in a recoverable manner.
No. A skill is a structured line of reasoning that the agent itself follows. It does not require configuring any additional MCPs.
It explicitly states what remains to be done, what risk of token consumption persists, and whether it is necessary to escalate the issue to a human due to a high-risk failure.
Yes. The introspection report is designed to be used by another agent or a human without having to replay the entire session.
Introspective Agent Debugging — AI Self-Diagnosis with Claude AI

¿Prefieres escuchar el contenido? Genera la narración de audio con un clic.