Skip to content
Skill

Agent introspection debugging

Gives an agent a structured capture-diagnose-recover loop for failing runs

Agent introspection debugging is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
66
Last commit
License
MIT
Listing updated

Similar skills

About Agent introspection debugging

This skill guides an agent through a repeatable debugging process when a run loops, burns tokens without progress, or drifts from its task. Instead of retrying, the agent first records the failure state, including the error, the last successful and failed steps, and the environment assumptions it relies on. It then matches the symptoms against common failure patterns such as tool-call loops, context overflow, connection refusals, rate-limit retry storms, and stale file state.

Recovery is kept deliberately small. The agent is steered toward restating the objective, checking the real filesystem, branch, or process state, narrowing the task to a single failing command or test, and running one discriminating check before any retry. Escalation to a human is included as an explicit option for high-risk or externally blocked failures.

The skill ends with a standard self-debug report covering root cause, the action taken, the result, and any follow-up or preventive change. It is a set of instructions rather than a runtime, so it relies on the agent's own tools and cross-references other skills such as verification-loop for post-fix checks. No scripts are included.

When your agent uses it

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 2 files (6 KB) on GitHub on 1 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the rea-skills plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add smartworldarafath/REA_Skill
/plugin install rea-skills@smartworldarafath

Or copy only this skill to ~/.claude/skills/agent-introspection-debugging:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/agent-introspection-debugging &&
cp -R "$tmp/.agents/skills/agent-introspection-debugging" ~/.claude/skills/agent-introspection-debugging &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/agent-introspection-debugging inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/agent-introspection-debugging to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/agent-introspection-debugging &&
cp -R "$tmp/.agents/skills/agent-introspection-debugging" ~/.agents/skills/agent-introspection-debugging &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/agent-introspection-debugging inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/agent-introspection-debugging to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/agent-introspection-debugging &&
cp -R "$tmp/.agents/skills/agent-introspection-debugging" ~/.cursor/skills/agent-introspection-debugging &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/agent-introspection-debugging inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/smartworldarafath/REA_Skill.git --path .agents/skills/agent-introspection-debugging

Or copy the folder to ~/.gemini/skills/agent-introspection-debugging yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/agent-introspection-debugging:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/agent-introspection-debugging &&
cp -R "$tmp/.agents/skills/agent-introspection-debugging" ~/.copilot/skills/agent-introspection-debugging &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/agent-introspection-debugging inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git

Then copy REA_Skill/.agents/skills/agent-introspection-debugging into your agent's skills folder as agent-introspection-debugging. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Failure capture template
A fixed checklist for recording the error, last steps, and environment assumptions before retrying.
Pattern-based diagnosis
A lookup table mapping common symptoms like timeouts, 429 errors, and loops to likely causes and checks.
Contained recovery steps
Smallest-first corrective actions such as narrowing scope and re-checking the filesystem or branch.
Introspection report format
A structured end-of-run report covering root cause, result status, and preventive follow-ups.
Links to related skills
Pointers to verification-loop, council, and workspace-surface-audit for specific follow-on situations.

Good for

  • Diagnose why my agent keeps hitting the tool call limit without finishing
  • Stop an agent from retrying a failing command and find the real cause
  • Check whether a missing file is caused by a wrong working directory or branch drift
  • Write a structured debug report after an agent run fails
  • Narrow a repeatedly failing test down to one file before attempting another fix

Agent introspection debugging FAQ

When does Agent introspection debugging activate?

It applies when an agent run is failing repeatedly, consuming tokens without progress, looping on the same tools, or drifting from the intended task, such as hitting tool call limits or seeing file state mismatches.

Does Agent introspection debugging run any scripts or change my environment automatically?

No scripts are included. It is a workflow the agent follows, and it warns against claiming automatic healing actions unless they are actually performed with the available tools.

What does the skill expect me to provide?

It works from the failure information available in the run, such as error messages, stack traces, recent tool calls, and environment details like cwd, branch, and expected files.

Is Agent introspection debugging a replacement for verification after code changes?

No. The skill points to verification-loop for feature verification after code changes and is meant for diagnosing failures rather than checking features.

How do I install Agent introspection debugging in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/agent-introspection-debugging to use it in all your projects, or to .claude/skills/agent-introspection-debugging in one project. Or install the rea-skills plugin, which includes it: /plugin marketplace add smartworldarafath/REA_Skill, then /plugin install rea-skills@smartworldarafath.

Does Agent introspection debugging run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Agent introspection debugging?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Agent introspection debugging?

The closest alternatives to Agent introspection debugging are Agent architecture audit, Continuous agent loop, Debug, Diagnostic reasoning and Principle fix root causes.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from smartworldarafath/REA_Skill

  1. Guides building and auditing UI to WCAG 2.2 AA across web, iOS and Android

    • Open source
    • 66 GitHub stars
    • Developer tools
  2. Diagnoses agent and LLM stacks for hidden failures and ranks the fixes by severity

    • Open source
    • 66 GitHub stars
    • Developer tools
  3. Compare coding agents head-to-head on your own tasks by pass rate, cost and time

    • Open source
    • 66 GitHub stars
    • Developer tools
  4. Guides an agent to design tool sets, observations and error recovery for better completion

    • Open source
    • 66 GitHub stars
    • Developer tools
  5. Lets an AI agent make x402 payments within per-task budgets and spending policies

    • Open source
    • 66 GitHub stars
    • Finance and payments
  6. Gives agents read-only access to social, video, code and web platforms via one CLI

    • Open source
    • 66 GitHub stars
    • Web search and scraping