Agent skill

Introspect

by softspark in softspark/ai-toolkit

Agent self-debugging and recovery. An agent skill from softspark/ai-toolkit.

Apache-2.0Auto-check passedDevelopment

Install Introspect

skills CLI
$ npx skills add softspark/ai-toolkit --skill introspect -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install softspark/ai-toolkit introspect --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/softspark/ai-toolkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/app/skills/introspect .claude/skills/introspect && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
introspect
GitHub stars
179
Token cost
~1.8k tokens
SKILL.md length
918 words
Files
1
Skills in repo
112
Repo updated
First seen
Licence
Apache-2.0

At a glance

Agent self-debugging and recovery. An agent skill from softspark/ai-toolkit.

  • Works in 5 steps: Capture Failure State → Classify the Failure Pattern → Diagnose Root Cause → …
  • Making repeated errors
  • SKILL.md covers Step 1: Capture Failure State, Step 2: Classify the Failure…, Step 3: Diagnose Root Cause and Step 4: Select Recovery Action, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Introspect is an agent skill from softspark/ai-toolkit. Agent self-debugging and recovery. Use when stuck in loops, making repeated errors, or quality degrades. Triggers: introspect, self-debug, stuck, loop, why failing.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Debugging. The repository describes itself as: Professional-grade AI coding toolkit: 94 skills, 44 agents, multi-platform (Claude, Cursor, Windsurf, Copilot, Gemini, Cline, Roo Code, Aider, Augment, Antigravity, Codex CLI… The licence is Apache-2.0.

When your agent uses it

  • Making repeated errors
  • Quality degrades

Example prompts

  • “/introspect”

Requirements

  • Pre-approved tools (allowed-tools): Read, Grep

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Capture Failure State
  2. Classify the Failure Pattern
  3. Diagnose Root Cause
  4. Select Recovery Action
  5. Produce the Introspection Report

What it can do on your machine

Read from SKILL.md and the folder at commit d64db2b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Introspect loads about 1.8k tokens when it runs. Until then it costs about 44 tokens; SKILL.md has 918 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~44
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from softspark/ai-toolkit at commit d64db2b, republished under its Apache-2.0 licence (© softspark). 918 words, ~1,820 tokens.

Download SKILL.mdSave it as .claude/skills/introspect/SKILL.md (or your agent's skills folder).
name
introspect
description
Agent self-debugging and recovery. Use when stuck in loops, making repeated errors, or quality degrades. Triggers: introspect, self-debug, stuck, loop, why failing.
allowed-tools
Read, Grep
user-invocable
true
effort
low
argument-hint
[symptom or 'stuck']
agent
debugger
context
fork

Agent Self-Debugging

$ARGUMENTS

Structured self-analysis for when the agent is stuck, looping, or producing degraded output.


Step 1: Capture Failure State

Before diagnosing, gather the facts. Answer each question concisely:

QuestionAnswer
Last goal/taskWhat was the agent trying to accomplish?
Actions takenList the last 3-5 actions in order
Errors or unexpected resultsWhat went wrong? What was expected vs actual?
Attempt countHow many times has this been tried?
Time spentRough estimate of effort so far

Step 2: Classify the Failure Pattern

Identify which pattern matches the current situation:

PatternSymptomsCommon Cause
LoopSame action repeated 3+ timesMissing exit condition, wrong approach
DriftActions diverge from original goalLost context, scope creep
Assumption ErrorWorking with wrong mental modelDidn't read code, assumed behavior
Tool MisuseWrong tool for the jobGrep when should Read, Bash when should Edit
Context OverflowForgetting earlier findingsToo much context, need compaction
Wrong AbstractionOver-engineering simple taskPremature abstraction, YAGNI violation
Missing InformationCan't proceed without dataNeed to ask user, read more code

Pick the single best match. If multiple apply, pick the root cause pattern (the one that, if fixed, would resolve the others).


Step 3: Diagnose Root Cause

Answer these three questions:

  1. What assumption was wrong? — Identify the specific belief that led to failure.
  2. What information was missing? — What would have prevented the failure if known earlier?
  3. What would a fresh start look like? — If starting over with current knowledge, what would the first action be?

Step 4: Select Recovery Action

Choose the smallest recovery action and apply the smallest possible fix — do not restart from scratch unless absolutely necessary:

PatternRecovery Action
LoopStop. Change approach entirely — different tool, different strategy, different angle.
DriftRe-read the original user request verbatim. Reset scope to exactly what was asked.
Assumption ErrorRead the actual code, file, or docs. Do not guess. Verify the mental model.
Tool MisuseSwitch to the correct tool. Read instead of Grep for full context. Edit instead of Bash for file changes.
Context OverflowSummarize all findings so far in 5 bullet points. Compact and continue.
Wrong AbstractionDelete the abstraction. Do the simplest, most direct thing that works.
Missing InformationAsk the user exactly ONE specific question. Do not guess.

Step 5: Produce the Introspection Report

Output exactly this format:

markdown
## Introspection Report

**Pattern:** [Loop|Drift|Assumption Error|Tool Misuse|Context Overflow|Wrong Abstraction|Missing Information]
**Root Cause:** [1-2 sentence diagnosis]
**Recovery Action:** [Specific next step]
**Confidence:** [HIGH|MEDIUM|LOW]

### What happened
[Brief timeline of actions taken — 3-5 bullet points max]

### What went wrong
[Specific diagnosis — what assumption failed, what was missed]

### What to do next
[ONE concrete action — not a plan, a single next step]

Rules

  • MUST name a specific failure pattern (Loop / Drift / Assumption Error / Tool Misuse / Context Overflow / Wrong Abstraction / Missing Information) — vague self-diagnosis is useless
  • MUST ground the diagnosis in concrete evidence (action traces, error messages, tool outputs) — not in feelings or hunches
  • NEVER retry the exact same action. If it failed once, it will fail again. Change something.
  • NEVER continue a loop "hoping it will work this time". Hope is not a strategy.
  • CRITICAL: after 3 failed attempts, escalate to the user with a concrete report of what was tried, what failed, and what you need — do not keep flailing
  • MANDATORY: the recovery action is ONE concrete next step, not a multi-phase plan. If you need a plan, use /plan.
Show full SKILL.md (407 more words)Show less

Gotchas

  • "Introspection" invoked mid-task can itself become a procrastination loop — spending effort diagnosing instead of acting. If the report takes longer to write than the next concrete action, skip the report and just change approach.
  • Context overflow is often invisible from inside the session — the model cannot reliably detect its own forgetting. External signals (user frustration, repeated explanations of the same fact) are the real diagnostic.
  • "Wrong abstraction" is frequently misdiagnosed as "Missing information". If adding data does not unlock the next step but simplifying the code does, the abstraction is the problem.
  • Ask-the-user is the escape hatch but it has a cost: user context-switching, latency, fatigue. Use it when you truly cannot proceed, not as a habit to avoid commitment.
  • The "fresh start" thought experiment works best when written down. Articulating "if starting over, my first action would be X" out loud often reveals the current approach's sunk-cost fallacy.

Self-Correction Checklist

These rules are non-negotiable during recovery:

  1. Never retry the exact same action. If it failed once, it will fail again. Change something.
  2. Never continue a loop "hoping it will work this time." Hope is not a strategy.
  3. Prefer reading code over guessing behavior. Open the file. Read the function. Check the types.
  4. When in doubt, ask the user rather than making assumptions. One specific question beats three wrong guesses.
  5. A 2-line fix is better than a 50-line refactor. Solve the immediate problem first.
  6. Check if the goal is still correct before optimizing the approach. Sometimes the task itself needs clarification.
  7. If stuck for more than 3 attempts, escalate. Tell the user what you tried, what failed, and what you need.

When NOT to Use

  • For debugging user code (not agent self-debugging) — use /debug
  • For analyzing past sessions to find patterns — use /mem-search or /instinct-review
  • For writing a recovery plan that spans multiple steps — use /plan
  • When the user has already described the failure — respond directly, skip the structured introspection
  • As a procrastination mechanism — if the next action is obvious, take it instead of writing a report

Quick Self-Check (Use Before Retrying Anything)

Before taking the next action after introspection, answer:

  • Is this action different from what I already tried?
  • Am I working on the original goal, not a tangent?
  • Do I have enough information to succeed, or am I guessing?
  • Is this the simplest approach that could work?

If any answer is "no", stop and address that first.

© softspark, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in app/skills/introspect of softspark/ai-toolkit.

Open the folder on GitHubat commit d64db2b

Compare with similar skills

Introspect next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Introspect compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Introspect this skillsoftspark/ai-toolkit179—~1.8kAutomated safety check: PassApache-2.0
Trellis Session Insightmindfold-ai/Trellis15k4 repos~1.7kAutomated safety check: PassAGPL-3.0
Native Data FetchingCherryHQ/cherry-studio-app4k6 repos~2.9kAutomated safety check: NotesMIT
Aoti Debugpytorch/pytorch104k1 repos~1.7kAutomated safety check: PassCustom licence
Herdr Throwaway Reproductionherdrdev/herdr43k—~2.4kAutomated safety check: PassApache-2.0
Systematic Debuggingultralisp/ultralisp25851 repos~2.4kAutomated safety check: PassNone

Similar skills

  • Trellis Session Insight

    mindfold-ai/Trellis

    Reach into past AI conversation history through the trellis mem CLI.

    15k GitHub starsUsed in 4 repos~1.7k tokens
    DevelopmentAuto-check passed
  • Native Data Fetching

    CherryHQ/cherry-studio-app

    A skill your agent uses when implementing or debugging ANY network request, API call, or data fetching.

    4k GitHub starsUsed in 6 repos~2.9k tokens
    DevelopmentAuto-check: notes
  • Aoti Debug

    pytorch/pytorch

    Debug AOTInductor (AOTI) errors and crashes. An agent skill from pytorch/pytorch.

    104k GitHub starsUsed in 1 repo~1.7k tokens
    DevelopmentAuto-check passed
  • Runs a disposable, uniquely named Herdr session inside an existing one so runtime, pane, terminal or API bugs can be reproduced without touching the main session.

    43k GitHub stars~2.4k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Systematic Debugging

    ultralisp/ultralisp

    A skill your agent uses when encountering any bug, test failure, or unexpected behavior, before proposing fixes

    258 GitHub starsUsed in 51 repos~2.4k tokens
    DevelopmentAuto-check passed
  • Decides whether an OpenLogi device problem on macOS is a privacy-permission (TCC) problem, using agent log lines, and says which identity needs which grant.

    23k GitHub stars~2.5k tokensUpdated 4 days ago
    DevelopmentAuto-check: notes

More from softspark/ai-toolkit

All 112 skills in this repo
  • Prepare Test Env

    softspark/ai-toolkit

    Prepare or verify a project QA environment with source identity, readiness, browser access, evidence paths and owned cleanup.

    179 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check: notes
  • A11y Validate

    softspark/ai-toolkit

    Accessibility validator: WCAG 2.1 AA, EN 301 549, EAA. An agent skill from softspark/ai-toolkit.

    179 GitHub stars~3.8k tokensUpdated yesterday
    Auto-check: notes
  • Analyze

    softspark/ai-toolkit

    Analyzes code quality, complexity, patterns across codebase.

    179 GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • Autonomous Dev

    softspark/ai-toolkit

    Drives a brief, specification, issue or existing PR through implementation, review, tests and QA to a ready PR.

    179 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check: notes
  • Brand Voice

    softspark/ai-toolkit

    Direct technical voice for docs, README, user-facing text. An agent skill from softspark/ai-toolkit.

    179 GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • CI

    softspark/ai-toolkit

    Detect/generate/debug CI pipeline config (GitHub Actions, GitLab CI).

    179 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check: notes

Categories

Questions about Introspect

What does Introspect do?

Agent self-debugging and recovery. An agent skill from softspark/ai-toolkit. Introspect is an agent skill from softspark/ai-toolkit. Agent self-debugging and recovery.

When should I use Introspect?

Introspect fits situations like: making repeated errors; quality degrades.

How do I install Introspect in Claude Code?

Run `npx skills add softspark/ai-toolkit --skill introspect -a claude-code`. Or copy the skill folder (app/skills/introspect in softspark/ai-toolkit) into .claude/skills/introspect in your project. Claude Code loads it when a task matches its description.

How do I install Introspect in Codex?

Run `npx skills add softspark/ai-toolkit --skill introspect -a codex`. Or copy the skill folder (app/skills/introspect in softspark/ai-toolkit) into .agents/skills/introspect in your project. Codex loads it when a task matches its description.

Can I use Introspect in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add softspark/ai-toolkit --skill introspect -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/introspect, .gemini/skills/introspect, .github/skills/introspect and .opencode/skills/introspect in your project.

What does Introspect need to run?

SKILL.md names no scripts, command-line tools or credentials: Introspect is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Grep.

Does Introspect access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Introspect safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Introspect use?

Introspect is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Introspect use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Introspect?

Skills that share tags, products or a category with Introspect: Trellis Session Insight (mindfold-ai/Trellis, 15k stars), Native Data Fetching (CherryHQ/cherry-studio-app, 4k stars), Aoti Debug (pytorch/pytorch, 104k stars) and Herdr Throwaway Reproduction (herdrdev/herdr, 43k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Introspect?

softspark (a GitHub user) maintains it in softspark/ai-toolkit, which has 179 GitHub stars. The repository holds 112 skills in this directory. The repository was last updated on October 7, 2026.

Source: softspark/ai-toolkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.