diagnose

diagnose is a skill for Claude Code, Codex from microsoft/AutoSaddler. It costs 25 tokens per session (948 once invoked), scanned A, original, MIT.

A method for finding the root cause of a failed software-agent scenario by examining its evaluation, execution trace, and code. An execution trace is the record of the agent's actions, tool calls, responses, and reasoning.

In plain words
What is it for?
Use it to investigate failing scenarios, compare expected and actual behavior, trace incorrect tool use, and identify which prompts, tools, hooks, or code need changing.
Why use it?
It prevents fixes based only on guesses about the visible failure. Understanding why the agent behaved incorrectly makes later patches more likely to address the real problem.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/microsoft/autosaddler/diagnose
Any agent
npx skills add microsoft/AutoSaddler --skill diagnose
Clone the repo
git clone --depth 1 https://github.com/microsoft/AutoSaddler

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 diagnose

README.md
[![agentmods](https://agentmods.dev/badge/skills/microsoft/autosaddler/diagnose.svg)](https://agentmods.dev/skills/microsoft/autosaddler/diagnose)
Your own site
<a href="https://agentmods.dev/skills/microsoft/autosaddler/diagnose"><img src="https://agentmods.dev/badge/skills/microsoft/autosaddler/diagnose.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 948 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00025 $0.00948
Opus 5 $0.00013 $0.00474
Sonnet 5 $0.00005 $0.00190
Haiku 4.5 $0.00003 $0.00095

Measured 4d ago against content hash d9fdee3af2ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

diagnose 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 4d 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.

src/autosaddler/v1/proposer/autosaddler/skills/diagnose/SKILL.md · 97 lines

How it starts

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

Diagnosis Methodology

Overview

Diagnosis identifies the root cause of scenario failures by tracing the agent's execution step-by-step and reading the agent codebase to understand why the code produces the observed behavior. A correct diagnosis is the foundation for an effective patch — without understanding WHY the agent fails, patches are shots in the dark.

When to Use

Before applying any patch. Every patch should be preceded by diagnosis of at least the target failing scenarios.

Diagnosis Workflow

1. Read Evaluation Output

Start with the evaluation output for the scenario to get the score and rationale. The rationale provides a high-level summary of why the scenario failed. Refer to the session prompt or CLAUDE.md for the exact file paths.

2. Read Agent Execution Trace

Read the full agent trace file for the scenario to see:

  • Every tool call the agent made
  • Every tool response
  • The agent's reasoning at each step
  • Where the agent deviated from expected behavior

3. Read the Agent Codebase

Read the relevant source files to understand why the code caused the observed behavior:

  • System prompt: What instructions did the agent receive?
  • Tool docstrings: What did the agent see about the tool's API?
  • Tool implementation: What does the tool actually do? Is there a mismatch between the docstring and the implementation?
  • Hook configurations: Are there PreToolUse hooks that should have guided the agent but didn't?
  • Agent loop logic: Are there infrastructure constraints (budget, timeouts) that prevented completion?

Trace the code path: what the agent saw (docstring/prompt) → what it decided (trace reasoning) → what happened (tool implementation).

4. Identify the Failure Point

Pinpoint the exact step where the agent's behavior diverged from what was needed. Compare what the agent did (from the trace) against what it should have done (from the evaluation rationale and oracle expectations).

Key questions:

  • At which step did the agent first make a wrong decision?
  • What information was available to the agent at that point?
  • What did the agent see (prompt, docstring, tool response) that led to the wrong decision?
  • Was the root cause in the code (what the tool does), in the text (what the agent reads about the tool), or in the agent's reasoning?

Read the full file on GitHub · 97 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. 4d ago First seen · 97 lines · 25 tokens per session scan A d9fdee3af2ba

Subscribe to this mod's changes

diagnose is a skill published in the GitHub repository microsoft/AutoSaddler (172 stars, last pushed 9d ago), licensed MIT. It adds 25 tokens to every session and 948 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-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens