Claude Marketplaces
SkillsMCP serversMarketplacesDigestTools
Submit

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP servers by category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control
Claude Marketplaces

An independent directory of skills, plugins and MCP servers for Claude Code. Not affiliated with Anthropic.

Browse

  • Skills
  • MCP servers
  • Marketplaces
  • Weekly digest
  • Skill index
  • MCP index
  • Marketplace index

Site

  • About
  • Tools
  • Submit
  • Feedback
  • Privacy
  • llms.txt
  • Plugins reference

Maker

  • Snug
  • Agent Caffeine
  • knobs
  • Wax
  • Vectoys
  • mertduzgun.com
Crafted at
Skills/AI & Agent Building
affaan-m avatar

Agent Introspection Debugging

affaan-m/everything-claude-code

When your agent burns through tokens in a loop or drifts off task, this gives it a structured way to debug itself before you step in. It walks through four phases: capture the failure state, diagnose the pattern (like repeated tool calls or context bloat), apply a minimal recovery action, and write a legible report. The key discipline is "verify the world state instead of trusting memory" and shrinking scope before retrying blindly. Think of it as teaching the agent to stop, look at what's actually happening, and either fix it with evidence or escalate cleanly. Most useful when you're watching an agent spin its wheels on the same command or slowly lose track of what it was supposed to be doing.

installs
3.7K
GitHub stars
229.1K
last updated
Jul 14, 2026
View on GitHubSave

Install

$ npx -y skills add affaan-m/everything-claude-code --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

Phase 1: Failure Capture

Before trying to recover, record the failure precisely.

Capture:

  • error type, message, and stack trace when available
  • last meaningful tool call sequence
  • what the agent was trying to do
  • current context pressure: repeated prompts, oversized pasted logs, duplicated plans, or runaway notes
  • current environment assumptions: cwd, branch, relevant service state, expected files

Minimum capture template:

## Failure Capture
- Session / task:
- Goal in progress:
- Error:
- Last successful step:
- Last failed tool / command:
- Repeated pattern seen:
- Environment assumptions to verify:

Phase 2: Root-Cause Diagnosis

Match the failure to a known pattern before changing anything.

PatternLikely CauseCheck
Maximum tool calls / repeated same commandloop or no-exit observer pathinspect the last N tool calls for repetition
Context overflow / degraded reasoningunbounded notes, repeated plans, oversized logsinspect recent context for duplication and low-signal bulk
ECONNREFUSED / timeoutservice unavailable or wrong portverify service health, URL, and port assumptions
429 / quota exhaustionretry storm or missing backoffcount repeated calls and inspect retry spacing
file missing after write / stale diffrace, wrong cwd, or branch driftre-check path, cwd, git status, and actual file existence
tests still failing after “fix”wrong hypothesisisolate the exact failing test and re-derive the bug

Diagnosis questions:

  • is this a logic failure, state failure, environment failure, or policy failure?
  • did the agent lose the real objective and start optimizing the wrong subtask?
  • is the failure deterministic or transient?
  • what is the smallest reversible action that would validate the diagnosis?

Phase 3: Contained Recovery

Recover with the smallest action that changes the diagnosis surface.

Safe recovery actions:

  • stop repeated retries and restate the hypothesis
  • trim low-signal context and keep only the active goal, blockers, and evidence
  • re-check the actual filesystem / branch / process state
  • narrow the task to one failing command, one file, or one test
  • switch from speculative reasoning to direct observation
  • escalate to a human when the failure is high-risk or externally blocked

Do not claim unsupported auto-healing actions like “reset agent state” or “update harness config” unless you are actually doing them through real tools in the current environment.

Contained recovery checklist:

## Recovery Action
- Diagnosis chosen:
- Smallest action taken:
- Why this is safe:
- What evidence would prove the fix worked:

Phase 4: Introspection Report

End with a report that makes the recovery legible to the next agent or human.

## Agent Self-Debug Report
- Session / task:
- Failure:
- Root cause:
- Recovery action:
- Result: success | partial | blocked
- Token / time burn risk:
- Follow-up needed:
- Preventive change to encode later:

Recovery Heuristics

Prefer these interventions in order:

  1. Restate the real objective in one sentence.
  2. Verify the world state instead of trusting memory.
  3. Shrink the failing scope.
  4. Run one discriminating check.
  5. Only then retry.

Bad pattern:

  • retrying the same action three times with slightly different wording

Good pattern:

  • capture failure
  • classify the pattern
  • run one direct check
  • change the plan only if the check supports it

Integration with ECC

  • Use verification-loop after recovery if code was changed.
  • Use continuous-learning-v2 when the failure pattern is worth turning into an instinct or later skill.
  • Use council when the issue is not technical failure but decision ambiguity.
  • Use workspace-surface-audit if the failure came from conflicting local state or repo drift.

Output Standard

When this skill is active, do not end with “I fixed it” alone.

Always provide:

  • the failure pattern
  • the root-cause hypothesis
  • the recovery action
  • the evidence that the situation is now better or still blocked
SKILL.md on GitHub

Sponsors

SnugThe clipboard manager you and your agent can use, safelyAgent CaffeineClose your lid, come back to finished workWaxBlock anything with supervision, without erasing your iPhoneOpen StepsSponsoredFree and open-source skills that make AI coding agents easier to understand, verify, and control.

Details

Repository
github.com/affaan-m/everything-claude-code
Categories
AI & Agent Building, Debugging
First seen
Apr 16, 2026

More from affaan-m/everything-claude-code

All 256
  • Connections Optimizer3.7K
  • Dotnet Patterns3.7K
  • Finance Billing Ops3.7K
  • Gan Style Harness3.7K
  • Google Workspace Ops3.7K
  • Knowledge Ops3.7K
  • Lead Intelligence3.7K
  • Openclaw Persona Forge3.7K
  • Opensource Pipeline3.7K
  • Security Bounty Hunter3.7K
  • Workspace Surface Audit3.7K
  • Accessibility3.6K
  • Agent Sort3.6K
  • Api Connector Builder3.6K
  • Automation Audit Ops3.6K
  • Code Tour3.6K
  • Csharp Testing3.6K
  • Github Ops3.6K
  • Hipaa Compliance3.6K
  • Llm Trading Agent Security3.6K
  • Project Flow Ops3.6K
  • Social Graph Ranker3.6K
  • Terminal Ops3.6K
  • Defi Amm Security3.5K

Recommended

More AI & Agent Building
1skillsh avatarai-image-generationskillsh/skills3.7Kinstalls
2affaan-m avataragent-sortaffaan-m/everything-claude-codeagent sort3.6Kinstalls
3qodex-ai avatarword-document-processorqodex-ai/ai-agent-skillsComprehensive word document processing with full format support. Handles creation, editing, formatting preservation, tracked changes, and metadata management.3.6Kinstalls
4giuseppe-trisciuoglio avatarcopilot-cligiuseppe-trisciuoglio/developer-kitProvides GitHub Copilot CLI task delegation in non-interactive mode with multi-model support (Claude, GPT, Gemini), permission controls, output sharing, and ses3.4Kinstalls
5cloudflare avatarbuilding-mcp-server-on-cloudflarecloudflare/skillsBuilds remote MCP (Model Context Protocol) servers on Cloudflare Workers with tools, OAuth authentication, and production deployment. Generates server code, con3.4Kinstalls
6tradermonty avataredge-candidate-agenttradermonty/claude-trading-skillsGenerate and prioritize US equity long-side edge research tickets from EOD observations, then export pipeline-ready candidate specs for trade-strategy-pipeline 3.3Kinstalls