Agent Introspection Debugging
A four-phase workflow (capture → diagnose → contained recovery → report) that makes an AI agent debug its own failures instead of blindly retrying.
Dev & CodingIntermediate★ 316,622⑂ 46,367AI score 8/10Last updated: Dec 1, 2026
What it does
Triggers when an agent run keeps failing, hits tool-call limits, loops on the same command, or burns tokens without progress.
- Phase 1 – Failure capture: log the error, last successful step, repeated pattern, and environment assumptions (cwd, branch, service state) into a ready-made template
- Phase 2 – Root-cause diagnosis: match against a table of common agent failures (loops, context overflow, ECONNREFUSED, 429 quota, missing files, tests still failing after a "fix")
- Phase 3 – Contained recovery: take the smallest reversible action; explicitly forbids claiming fake auto-healing like "reset agent state"
- Phase 4 – Introspection report: a human-readable summary of failure, root cause, action, result, and follow-ups
Who it's for
- Developers running long agent sessions who have hit infinite loops and token burn
- Teams that need reproducible failure write-ups instead of "it broke, I retried"
- Anyone who wants their agent to reason about causes before retrying
Examples
- The agent repeats the same build command five times → classify as a loop, shrink scope to one failing test, run a single discriminating check
- API calls keep returning 429 → diagnose a retry storm, inspect call spacing, add backoff, then file the report
- A written file seems to vanish → hypothesize wrong cwd or branch drift, verify with git status and a direct path check
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/affaan-m/ECC/HEAD/.agents/skills/agent-introspection-debugging/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on AI Skill Mart. Copy the .agents/skills/agent-introspection-debugging folder from the GitHub repo affaan-m/ECC into my ~/.claude/skills/agent-introspection-debugging/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/affaan-m/ECC.git /tmp/ECC && mkdir -p ~/.claude/skills && cp -r /tmp/ECC/.agents/skills/agent-introspection-debugging ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open your terminal.
- Clone the repository:
git clone https://github.com/affaan-m/ECC.git /tmp/ECC - Create the skills folder:
mkdir -p ~/.claude/skills - Copy the skill:
cp -r /tmp/ECC/.agents/skills/agent-introspection-debugging ~/.claude/skills/ - (Optional) Copy companion skills it references, such as
verification-loop, if they exist in the repo. - Restart Claude Code, then when a run stalls ask: "Use the agent-introspection-debugging skill to diagnose this failure."
View source on GitHub ↗License: MIT