Agent Introspection is a specialized diagnostic skill designed to prevent AI agents from getting stuck in hallucination loops or unproductive debugging cycles. By monitoring for specific triggers—such as three consecutive failures or excessive context usage—it forces the agent to stop, classify the error type (e.g., environment drift, tool mismatch, or context overflow), and execute a controlled recovery action. This systematic self-diagnosis ensures that Claude remains efficient and autonomous, moving beyond circular logic to find fundamentally different strategies for complex coding challenges.
主要功能
01Root Cause Classification: Categorizes failures into patterns like environment drift, tool mismatch, or context overflow.
02Structured Introspection Reports: Generates a detailed breakdown of what failed and why before attempting a new strategy.
038 GitHub stars
04Memory-Backed Recovery: Saves failure patterns to harness-mem to prevent recurring errors in future sessions.
05Automated Loop Detection: Triggers immediately when the agent attempts the same failing approach three times.
06Context Management: Identifies when context windows are overwhelmed and triggers compaction to maintain reasoning quality.
使用场景
01Managing long-running sessions where the context window has become cluttered and confusing.
02Diagnosing 'works locally' failures that stem from environment or tool version mismatches.
03Breaking infinite retry loops during complex refactoring or debugging tasks.