Agent Introspection is a specialized reliability skill for Claude Code designed to prevent the 'hallucination loop' where an AI agent repeats failing commands. It provides a structured framework for self-diagnosis that triggers automatically after three consecutive failures or when context usage becomes critical. By classifying errors into specific patterns—such as environment drift, context overflow, or tool mismatch—the skill enforces a 'smallest safe action' recovery strategy. This ensures the agent pivots to new strategies rather than repeating unsuccessful attempts while logging every failure to persistent memory for long-term improvement.
主な機能
01Structured introspection reporting for transparent debugging and audit trails
02Persistent memory integration to prevent the recurrence of identified error patterns
03Systematic root cause classification for syntax, environment, and logic errors
048 GitHub stars
05Automated loop detection after three consecutive tool failures
06Context pressure monitoring with automatic compaction triggers at 70% usage
ユースケース
01Diagnosing environment-specific issues like missing variables or tool version mismatches
02Breaking out of circular retries where the agent repeats failing shell commands or edits
03Recovering from context window exhaustion during long-running autonomous tasks