pisama-diagnose

pisama-diagnose is a skill for Claude Code, Codex from Pisama-AI/pisama-claude-code. It costs 150 tokens per session (1,751 once invoked), scanned B, original, MIT.

A diagnostic skill that examines a failed AI-agent trace and produces a root-cause report. It identifies the failing step, lists detected problems with confidence levels, and can prepare a guardrail for agent instructions when a key is connected.

In plain words
What is it for?
Use it with an ATIF or other supported agent trace to locate failures, explain their causes, generate verification commands, and optionally apply a guardrail for supported cases.
Why use it?
It helps turn a confusing agent failure, loop, or early exit into a specific explanation and a fix that can be checked.

Skill for Claude CodeCodex

Written for Claude Code and Codex: allowed-tools in frontmatter, but also reads ~/.codex or $CODEX_HOME. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Codex.

Good fit Use it with an ATIF or other supported agent trace to locate failures, explain their causes, generate verification commands, and optionally apply a guardrail for supported cases.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pisama-ai/pisama-claude-code/pisama-diagnose
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 Pisama-AI/pisama-claude-code --skill pisama-diagnose
Clone the repo
git clone --depth 1 https://github.com/Pisama-AI/pisama-claude-code

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 pisama-diagnose

README.md
[![agentmods](https://agentmods.dev/badge/skills/pisama-ai/pisama-claude-code/pisama-diagnose/github.svg)](https://agentmods.dev/skills/pisama-ai/pisama-claude-code/pisama-diagnose)
Your own site
<a href="https://agentmods.dev/skills/pisama-ai/pisama-claude-code/pisama-diagnose"><img src="https://agentmods.dev/badge/skills/pisama-ai/pisama-claude-code/pisama-diagnose/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pisama-diagnose

Your own site · 80×15
<a href="https://agentmods.dev/skills/pisama-ai/pisama-claude-code/pisama-diagnose"><img src="https://agentmods.dev/badge/skills/pisama-ai/pisama-claude-code/pisama-diagnose.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 150 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,751 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00150 $0.01751
Opus 5 $0.00075 $0.00875
Sonnet 5 $0.00030 $0.00350
Haiku 4.5 $0.00015 $0.00175

Measured 11d ago against content hash 50f63584a4e7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade B, and why

pisama-diagnose scanned grade B with 1 finding 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 11d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (diagnose.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Enumerates other installed skillsmediumAgent snooping

Other skills' SKILL.md files reveal prompts, capabilities and secrets that should be invisible to peers.

SKILL_DIR="$(dirname "$(find . ~/.claude/skills ~/.codex/skills -name diagnose.py -path '*pisama-diagnose*' 2>/dev/null | head -1)")"
src/pisama_claude_code/skills/pisama-diagnose/SKILL.md · 138 lines

How it starts

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

Pisama Diagnose

You are diagnosing a failing AI agent run using the live Pisama backend. Pisama runs failure detectors over the trace, localizes the primary failure, explains the root cause, and returns a fix. With a connected key it also returns an apply-ready CLAUDE.md/.cursorrules guardrail and (for n8n) can apply the fix directly. Your job is to run the bundled engine, read the report back to the user clearly, and offer to apply the guardrail.

The engine is a self-contained, standard-library Python script next to this file: diagnose.py. It needs Python 3.8+ and network access to api.pisama.ai. The diagnosis call is public, so no API key is required to diagnose. A key unlocks the apply-ready patch and stored-detection lookups.

When to use

  • The user has an agent trace, trajectory, or eval that failed or looks wrong.
  • The user asks "why did my agent fail / loop / give up / hallucinate here?"
  • The user wants a root-cause report or a fix they can apply.

Inputs the engine accepts

  1. An ATIF / trajectory JSON file (the common case). ATIF is Pisama's trace interchange format; exporters exist for LangGraph, n8n, Dify, OpenClaw, and raw OTEL. If the user has a different trace shape, ask them to export ATIF or point you at the trajectory JSON.
  2. A pasted trace on stdin (-).
  3. A Pisama detection id (--detection-id), which fetches a stored detection. This path needs a connected key (pisama-cc connect).

Flow

  1. Find the script. It sits beside this SKILL.md. Resolve its path, for example:

    SKILL_DIR="$(dirname "$(find . ~/.claude/skills ~/.codex/skills -name diagnose.py -path '*pisama-diagnose*' 2>/dev/null | head -1)")"
    

    If the user installed via pisama-cc install, it is at ~/.claude/skills/pisama-diagnose/diagnose.py.

  2. Run the diagnosis and write a report file the user can keep:

    python3 "$SKILL_DIR/diagnose.py" path/to/trace.json --out diagnosis.md
    

    To diagnose a pasted trace: pbpaste | python3 "$SKILL_DIR/diagnose.py" - --out diagnosis.md

Read the full file on GitHub · 138 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 11d ago First seen · 138 lines · 150 tokens per session scan B 50f63584a4e7

Subscribe to this mod's changes

pisama-diagnose is a skill published in the GitHub repository Pisama-AI/pisama-claude-code (2 stars, last pushed 7d ago), licensed MIT. It adds 150 tokens to every session and 1,751 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it B with 1 finding (enumerates other installed skills). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.