agent-introspection-debugging

agent-introspection-debugging is a skill for Claude Code, Codex from jxoesneon/Ciel. It costs 24 tokens per session (739 once invoked), scanned A, original, Apache-2.0.

A four-phase self-debugging procedure for AI agents that get stuck, repeat failed actions, or drift away from their task.

In plain words
What is it for?
Use it to capture failure details, identify loops or stale assumptions, recover with contained actions, and decide when human help is needed.
Why use it?
It makes failures easier to diagnose by recording the error and environment before taking a small recovery step.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it to capture failure details, identify loops or stale assumptions, recover…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jxoesneon/ciel/agent-introspection-debugging
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add jxoesneon/Ciel --skill agent-introspection-debugging
Clone the repo
git clone --depth 1 https://github.com/jxoesneon/Ciel

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-introspection-debugging

README.md
[![agentmods](https://agentmods.dev/badge/skills/jxoesneon/ciel/agent-introspection-debugging.svg)](https://agentmods.dev/skills/jxoesneon/ciel/agent-introspection-debugging)
Your own site
<a href="https://agentmods.dev/skills/jxoesneon/ciel/agent-introspection-debugging"><img src="https://agentmods.dev/badge/skills/jxoesneon/ciel/agent-introspection-debugging.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 739 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00024 $0.00739
Opus 5 $0.00012 $0.00369
Sonnet 5 $0.00005 $0.00148
Haiku 4.5 $0.00002 $0.00074

Measured 6d ago against content hash 864cca81e508, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

agent-introspection-debugging scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/agent-introspection-debugging/SKILL.md · 75 lines

How it starts

The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 session to the MemPalace Diary (mempalace_diary_write):

  • Root Cause: What was actually wrong?
  • Action Taken: How was it resolved?
  • Prevention: What change should be encoded (via save_memory or coding-standards) to prevent recurrence?

Recovery Heuristics

  1. Evidence over Memory: Never trust the prior thought trace if it leads to failure; verify the world state directly.
  2. Smallest Pivot: Change one variable at a time when attempting recovery.
  3. Hard Stop: After 3 repeated failures on the same sub-task, the agent MUST enter Phase 1.

Read the full file on GitHub · 75 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 75 lines · 24 tokens per session scan A 864cca81e508

Subscribe to this mod's changes

agent-introspection-debugging is a skill published in the GitHub repository jxoesneon/Ciel (1 stars, last pushed 6d ago), licensed Apache-2.0. It adds 24 tokens to every session and 739 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.