affaan-m avatar

Agent Introspection Debugging

When your agent hits max tool calls, loops on the same command, or burns tokens without progress, this gives it a structured way to debug itself before you step in. It walks through capture, diagnosis, contained recovery, and a final introspection report. The core idea is solid: match the failure to a known pattern like context overflow or service timeouts, then take the smallest reversible action that changes the situation. The four phase loop keeps things systematic instead of retrying blindly with slightly different wording. Pairs naturally with verification-loop after code changes and works best when you need the agent to stop, assess what actually broke, and produce a legible report instead of just claiming it fixed something.

skills.sh installs
5.7K
GitHub stars
300.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add affaan-m/ecc --skill agent-introspection-debugging --agent claude-code

Installs into .claude/skills of the current project.

Files

Agent Introspection Debugging

Use this skill when an agent run is failing repeatedly, consuming tokens without progress, looping on the same tools, or drifting away from the intended task.

This is a workflow skill, not a hidden runtime. It teaches the agent to debug itself systematically before escalating to a human.

When to Activate

  • Maximum tool call / loop-limit failures
  • Repeated retries with no forward progress
  • Context growth or prompt drift that starts degrading output quality
  • File-system or environment state mismatch between expectation and reality
  • Tool failures that are likely recoverable with diagnosis and a smaller corrective action

Scope Boundaries

Activate this skill for:

  • capturing failure state before retrying blindly
  • diagnosing common agent-specific failure patterns
  • applying contained recovery actions
  • producing a structured human-readable debug report

Do not use this skill as the primary source for:

  • feature verification after code changes; use verification-loop
  • framework-specific debugging when a narrower ECC skill already exists
  • runtime promises the current harness cannot enforce automatically

Four-Phase Loop

Sponsors

Details

Repository
github.com/affaan-m/ecc
Categories
AI & Agent Building, Debugging, Automation & Workflows
First seen
Jul 14, 2026

More from affaan-m/ecc

All 263
1affaan-m avatarai-regression-testingaffaan-m/eccRegression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns t5.7Kskills.sh installs
2affaan-m avatarmcp-server-patternsaffaan-m/eccBuild MCP servers with Node/TypeScript SDK — tools, resources, prompts, Zod validation, stdio vs Streamable HTTP. Use Context7 or official MCP docs for latest A5.6Kskills.sh installs
3affaan-m avatarai-first-engineeringaffaan-m/eccEngineering operating model for teams where AI agents generate a large share of implementation output.5.5Kskills.sh installs
4affaan-m avatarcontinuous-agent-loopaffaan-m/eccPatterns for continuous autonomous agent loops with quality gates, evals, and recovery controls.5.5Kskills.sh installs
5affaan-m avataragent-sortaffaan-m/eccBuild an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel5.5Kskills.sh installs
6affaan-m avatarregex-vs-llm-structured-textaffaan-m/eccDecision framework for choosing between regex and LLM when parsing structured text — start with regex, add LLM only for low-confidence edge cases.5.5Kskills.sh installs