agent-introspection-debugginglisted
Install: claude install-skill jxoesneon/Ciel
# CIEL ADAPTATION: Agent Introspection Debugging (Self-Diagnosis)
This skill formalizes the "Self-Debug" protocol for CIEL sub-agents. It provides a systematic 4-phase loop to diagnose and recover from repetitive failures, tool-call loops, and reasoning drift before escalating to a human.
## The 4-Phase Loop
### 1. Failure Capture
Before retrying, the agent MUST record the failure state in a structured format:
- **Session Goal**: What was the intended outcome?
- **Last Meaningful Tool**: Which tool call preceded the failure?
- **Error Signature**: Exact error message or pattern seen.
- **Environment State**: cwd, branch, and any relevant system assumptions.
### 2. Root-Cause Diagnosis
Match the capture against common failure patterns:
- **Looping**: Repeated same tool call with same inputs.
- **Drift**: Reasoning has pivoted away from the original goal.
- **Stale State**: Working on files or assumptions that no longer match the filesystem.
- **Quota/Resource**: 429s, memory exhaustion, or context overflow.
### 3. Contained Recovery
Take the smallest reversible action to change the diagnosis surface:
- **Restate**: Re-initialize the task goal in a fresh context.
- **Verify**: Re-read the filesystem or run a diagnostic command (e.g., `ls`, `git status`).
- **Narrow**: Shrink the scope to a single failing test or file.
- **Escalate**: If the failure is high-risk (e.g., persistent auth failure), stop and ask the human.
### 4. Introspection Report
Log the debugging se