# Agent introspection debugging

> Agent introspection debugging is an open-source agent skill for developer tools. Gives agents a structured workflow to capture, diagnose and recover from their own. 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/Fmarzochi/EGC/tree/main/.agents/skills/agent-introspection-debugging
- **Repository:** https://github.com/fmarzochi/egc
- **GitHub stars:** 71
- **License:** Apache-2.0
- **Skill name:** agent-introspection-debugging
- **Collection:** https://github.com/Fmarzochi/EGC
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill guides an AI coding agent through a repeatable process when a run stalls, loops on the same tool calls, burns tokens without progress, or drifts from the task. Instead of retrying blindly, the agent first records the failure state, including the error, the last successful and failed steps, and the environment assumptions it relies on.

The workflow then matches the symptom to a known failure pattern, such as repeated tool calls, service connection errors, rate-limit retries, or stale files after a write, and suggests a single discriminating check before any change. Recovery stays deliberately small: restating the goal, verifying the real filesystem or branch state, narrowing the scope to one command or test, and escalating to a human when the risk is high. The skill ends with a standard debug report so the next agent or person can see what went wrong and what was done.

The skill is written as Markdown instructions with no bundled scripts. It expects the agent to have access to its own shell, files and git state, and it points to other EGC skills for follow-up verification, learning from repeated failures and repository drift.

## When your agent uses it

> Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports.

## What it can access

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

- [Instructions only, no scripts](https://github.com/Fmarzochi/EGC/tree/HEAD/.agents/skills/agent-introspection-debugging)
- [License: Apache-2.0](https://github.com/Fmarzochi/EGC/tree/HEAD/.agents/skills/agent-introspection-debugging)

## Features

- **Failure capture template:** A fixed checklist for recording the error, last steps, goal in progress and environment assumptions before retrying.
- **Pattern-based diagnosis:** A table that maps common symptoms like loops, timeouts, rate limits and stale files to likely causes and checks.
- **Contained recovery actions:** Guidance to shrink the failing scope and run one direct check rather than repeating the same action.
- **Self-debug report:** A structured report template covering root cause, recovery action, result and follow-up needs.
- **Links to related skills:** Pointers to verification, learning and repository audit skills for work that follows a recovery.

## Good for

- Break out of a loop when the agent keeps calling the same tool
- Diagnose why a service call fails with connection refused or timeout errors
- Recover from repeated 429 rate-limit errors without retry storms
- Find out why a file is missing after a write or why the diff looks stale
- Produce a debug report summarising a stalled agent run for a teammate

## Install

### Claude Code

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

```sh
/plugin marketplace add Fmarzochi/EGC
/plugin install egc@egc
```

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

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Fmarzochi/EGC.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/Fmarzochi/EGC.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/Fmarzochi/EGC.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/Fmarzochi/EGC.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/Fmarzochi/EGC.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/Fmarzochi/EGC.git
```

Then copy `EGC/.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 is meant for runs that fail repeatedly, consume tokens without progress, loop on the same tools, drift from the task, or hit environment mismatches that diagnosis may fix.

### Does Agent introspection debugging run scripts or change the harness?

No scripts are included. It is a workflow the agent follows, and it explicitly avoids claiming automatic healing such as resetting agent state unless real tools do that.

### Which skills should follow Agent introspection debugging?

The skill suggests verification-loop after code changes, continuous-learning-v2 for recurring failure patterns, council for decision ambiguity and workspace-surface-audit for conflicting local state.

### Is Agent introspection debugging a replacement for feature verification?

No. The skill states that feature verification after code changes belongs to verification-loop.

### 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 egc plugin, which includes it: /plugin marketplace add Fmarzochi/EGC, then /plugin install egc@egc.

### 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 introspection debugging, Debugging and error recovery, Agent architecture audit, Ci and Agent harness construction.

## Where this comes from

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

## Alternatives

- [Agent introspection debugging](https://ai-powered.com/skills/agent-introspection-debugging): Agent introspection debugging is an open-source agent skill for developer tools.
- [Debugging and error recovery](https://ai-powered.com/skills/debugging-and-error-recovery): Debugging and error recovery is an open-source agent skill for developer tools.
- [Agent architecture audit](https://ai-powered.com/skills/agent-architecture-audit): Agent architecture audit 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.
- [Agent harness construction](https://ai-powered.com/skills/agent-harness-construction): Agent harness construction is an open-source agent skill for developer tools.
- [Correct](https://ai-powered.com/skills/correct): Correct is an open-source agent skill for developer tools.
- [Debug hypothesis](https://ai-powered.com/skills/debug-hypothesis): Debug hypothesis is an open-source agent skill for developer tools.
- [Agent architecture](https://ai-powered.com/skills/agent-architecture): Agent architecture is an open-source agent skill for developer tools.

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