# Agent introspection debugging

> Agent introspection debugging is an open-source agent skill for developer tools. Gives an agent a structured capture-diagnose-recover loop for failing runs. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/smartworldarafath/REA_Skill/tree/main/.agents/skills/agent-introspection-debugging
- **Repository:** https://github.com/smartworldarafath/rea_skill
- **GitHub stars:** 66
- **License:** MIT
- **Skill name:** agent-introspection-debugging
- **Collection:** https://github.com/smartworldarafath/REA_Skill
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/agent-introspection-debugging)
- [License: MIT](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/agent-introspection-debugging)

## Features

- **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

## Install

### Claude Code

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

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

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

```sh
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.

### Codex

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

```sh
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.

### Cursor

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

```sh
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.

### Gemini CLI

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

```sh
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.

### VS Code

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

```sh
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.

### Other agents

Get the folder:

```sh
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.

## 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.

## Alternatives

- [Agent architecture audit](https://ai-powered.com/skills/agent-architecture-audit): Agent architecture audit is an open-source agent skill for developer tools.
- [Continuous agent loop](https://ai-powered.com/skills/continuous-agent-loop): Continuous agent loop is an open-source agent skill for developer tools.
- [Debug](https://ai-powered.com/skills/debug-jasgujral): Debug is an open-source agent skill for developer tools.
- [Diagnostic reasoning](https://ai-powered.com/skills/diagnostic-reasoning): Diagnostic reasoning is an open-source agent skill for developer tools.
- [Principle fix root causes](https://ai-powered.com/skills/principle-fix-root-causes): Principle fix root causes is an open-source agent skill for developer tools.
- [Agent harness construction](https://ai-powered.com/skills/agent-harness-construction): Agent harness construction is an open-source agent skill for developer tools.
- [Interactive debugging](https://ai-powered.com/skills/interactive-debugging): Interactive debugging is an open-source agent skill for developer tools.
- [Ci](https://ai-powered.com/skills/ci-chachamaru127): Ci is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/agent-introspection-debugging
