agent-introspection-debugging

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

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/inuishan/mac-storage-organiser --skill agent-introspection-debugging-inuishan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agent-introspection-debugging
Source: https://github.com/inuishan/mac-storage-organiser/tree/main/.codex/skills/agent-introspection-debugging
Command: npx skills add https://github.com/inuishan/mac-storage-organiser --skill agent-introspection-debugging-inuishan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agent runs often fail by looping on the same tool calls, burning tokens without progress, or drifting from the original task. This Skill gives the agent a systematic four-phase self-debugging workflow so failures are captured, diagnosed, and recovered before escalating to a human. ## Core Features & Use Cases - Failure Capture: Records error type, last tool calls, context pressure, and environment assumptions before any retry. - Root-Cause Diagnosis: Matches failures against known patterns such as tool-call loops, context overflow, connection refused, rate limits, and stale filesystem state. - Contained Recovery: Applies the smallest reversible corrective action, from restating the objective to shrinking the failing scope. - Introspection Report: Produces a structured human-readable report covering failure, root cause, recovery action, and follow-up. - Use Case: An agent hits its maximum tool-call limit while retrying the same failing command. Activate this Skill to capture the failure state, classify it as a loop pattern, verify actual filesystem state, and produce a debug report instead of blindly retrying. ## Quick Start Use the agent-introspection-debugging skill to diagnose why this agent run keeps looping on the same tool call and produce a recovery 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 the repeated pattern. Then classify it against known patterns like no-exit loops, verify actual environment state, and apply one small corrective action instead of retrying the same command.

What should I do when an agent hits its maximum tool call limit?▼

Treat it as a loop or no-exit observer pattern. Inspect the last N tool calls for repetition, restate the real objective in one sentence, shrink the failing scope to a single command or file, and run one discriminating check before retrying.

When should I use agent self-debugging instead of manual troubleshooting?▼

Use it for recoverable failures like retry storms, context drift, or state mismatches where a smaller corrective action can validate a diagnosis. Escalate to a human when the failure is high-risk, externally blocked, or involves decision ambiguity rather than technical failure.

Why does an agent keep failing after applying a fix?▼

The original hypothesis was likely wrong. Isolate the exact failing test or command, re-derive the bug from direct observation rather than memory, and verify the actual filesystem, branch, and process state before changing the plan.

What are the limitations of agent introspection debugging?▼

It is a workflow skill, not a runtime, so it cannot enforce harness-level behaviors like resetting agent state automatically. It is also not meant for feature verification after code changes or framework-specific debugging covered by narrower skills.