agentleFS
OnourImpramOnourImpram/claude-code-for-social-scientists/.claude/skills/agentic-session-debugger/SKILL.md

agentic-session-debugger

Skill2 starsChanged 5 months agoApache-2.0View on GitHub

Use when a Claude Code session loops, drifts from scope, claims a fix that CI rejects, hits context, PATH, or permission walls, or fails in a way another retry will not solve and a root cause diagnosis is needed instead.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check scope drift, repeated loops, hidden state, stale context, and conflicting instructions.

    line 27
  2. Distinctive:

    Check environment issues, including PATH, shell, dependency version, working directory, and permissions.

    line 28
  3. Distinctive:

    Before closing: the fix has been verified with a concrete pass/fail check, and if the failure pattern involves cross-tool or …

    line 54
  4. Distinctive:

    Do not run destructive commands unless the user explicitly requested them and the target path is verified.

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agentic Session Debugger

When to use

Use this skill when a Claude Code or agentic coding session behaves unreliably and the user needs root cause diagnosis rather than another attempt at the same command. It applies at any lifecycle stage, and the lesson it records belongs in the project's standing instructions. It is not for evaluating whether an agent's outputs are portable across tool environments, that is agent-portability-matrix, and it is not for getting an independent second diagnosis on a difficult failure, that is cross-agent-second-opinion.

Inputs

  • User goal.
  • Recent commands or actions.
  • Error messages.
  • Files or tools involved.
  • Current working directory.
  • Permission and environment constraints.
  • What changed just before the failure.

Workflow

  1. Restate the intended outcome.
  2. Identify the failure class, tool, knowledge, communication, permission, environment, or context.
  3. Capture exact evidence from logs, errors, tests, or terminal output.
  4. Check scope drift, repeated loops, hidden state, stale context, and conflicting instructions.
  5. Check environment issues, including PATH, shell, dependency version, working directory, and permissions.
  6. Reduce the problem to the smallest reproducible step.
  7. Propose the smallest correction and a verification command.
  8. Record the lesson if the failure pattern should not recur.

Output

Return:

  • Intended outcome.
  • Failure class.
  • Evidence.
  • Root cause hypothesis.
  • Minimal reproduction.
  • Fix plan.
  • Verification step.
  • Residual risk.
  • What to record at session end: the failure class, the root cause hypothesis, the fix applied, and the reusable rule added to the project's standing instructions.

Verification

  • The diagnosis cites actual evidence, not only model intuition.
  • The smallest reproducible case is identified or the reason it cannot be reproduced is stated.
  • Permission failures are not solved by destructive commands.
  • The fix has a clear pass or fail check.
  • Repeated session errors are converted into a reusable rule.
  • Before closing: the fix has been verified with a concrete pass/fail check, and if the failure pattern involves cross-tool or cross-environment behavior, agent-portability-matrix or cross-agent-second-opinion has been noted as the next step.

Safety

Do not run destructive commands unless the user explicitly requested them and the target path is verified. Do not print secrets from logs. Redact tokens, passwords, private paths, and personal identifiers.

Example prompt

"Claude Code keeps looping on a failing validator and says the file is fixed, but CI still fails. Diagnose the session."

Expected smoke output:

  • Failure class, evidence, minimal reproduction, likely hidden-state or stale-assumption issue.
  • A concrete verification command and a smaller next fix.

Türkçe kullanım notu

Bu beceri, aksayan bir Claude Code oturumunu aynı komutu yeniden denemek yerine kök nedenden teşhis eder. Bozulma sınıfı belirlenir, kanıt toplanır, sorun en küçük tekrarlanabilir adıma indirilir ve en küçük düzeltme doğrulama komutuyla birlikte önerilir. Tekrarlayan hata kalıcı bir kurala dönüştürülür, yıkıcı komutlar teşhisin parçası olamaz.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.