agent-introspection-debugging

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

Updated Jul 16, 2026
One-click install
npx skills add https://github.com/pjherron/hypoc --skill agent-introspection-debugging-pjherron
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agent-introspection-debugging
Source: https://github.com/pjherron/hypoc/tree/main/hypoc/skills/agent-introspection-debugging
Command: npx skills add https://github.com/pjherron/hypoc --skill agent-introspection-debugging-pjherron

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, and blind retries make things worse. This Skill gives the agent a disciplined four-phase workflow to debug itself before escalating to a human. ## Core Features & Use Cases - Failure Capture: Records the error, last tool calls, context pressure, and environment assumptions before any retry. - Root-Cause Diagnosis: Matches failures against a pattern table covering tool-call loops, context overflow, connection errors, rate limits, and stale filesystem state. - Contained Recovery: Applies the smallest reversible corrective action, such as trimming context, verifying world state, or narrowing scope to one failing test. - Introspection Report: Produces a structured self-debug report with root cause, recovery action, result, and preventive follow-ups. - Use Case: An agent hits its maximum tool-call limit while retrying the same failing command. The skill captures the failure, classifies it as a loop pattern, verifies actual filesystem state, and produces a report explaining the root cause and fix. ## Quick Start Ask the agent to run the introspection debugging workflow on the current failing session 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 last N tool calls to confirm repetition, then classify it as a loop pattern. Stop retrying, restate the real objective, verify actual environment state, and run one discriminating check before changing the plan.

How to recover an agent run that is burning tokens without progress?▼

Trim low-signal context such as duplicated plans and oversized logs, keeping only the active goal, blockers, and evidence. Then narrow the task to one failing command, file, or test and switch from speculation to direct observation.

What failure patterns does agent self-debugging cover?▼

It covers maximum tool-call loops, context overflow, ECONNREFUSED and timeout errors, 429 rate-limit exhaustion, stale filesystem or branch state, and tests still failing after an attempted fix. Each pattern maps to a likely cause and a concrete check.

When should I not use agent introspection debugging?▼

Do not use it for feature verification after code changes, where a verification-loop skill fits better, or for framework-specific debugging covered by a narrower skill. It also cannot perform runtime actions the current harness does not support.

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

The original diagnosis was likely wrong. Isolate the exact failing test, re-derive the bug from direct evidence, and validate the new hypothesis with the smallest reversible action before retrying.