analyze

analyze is a command for coding agents from Not-Diamond/self-care. It costs 8 tokens per session (2,173 once invoked), scanned A, original, MIT.

A command that checks and examines an agent trace file for specific problems, such as missed actions, repeated steps, unclear instructions, or early stopping. It accepts OpenTelemetry JSON and Claude Code JSONL formats.

In plain words
What is it for?
Use it to analyze a trace file, reuse a supplied file hash when available, and investigate the listed types of agent mistakes.
Why use it?
It provides a consistent way to find problems in an agent run and remember findings across later analyses of the same trace.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the self-care plugin — 12 commands, 2 agents shipped together

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 commands/not-diamond/self-care/analyze
Clone the repo
git clone --depth 1 https://github.com/Not-Diamond/self-care

Or install self-care, the plugin that ships this one along with the rest of its 12 commands, 2 agents.

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 analyze

README.md
[![agentmods](https://agentmods.dev/badge/commands/not-diamond/self-care/analyze.svg)](https://agentmods.dev/commands/not-diamond/self-care/analyze)
Your own site
<a href="https://agentmods.dev/commands/not-diamond/self-care/analyze"><img src="https://agentmods.dev/badge/commands/not-diamond/self-care/analyze.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,173 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.00008 $0.02173
Opus 5 $0.00004 $0.01086
Sonnet 5 $0.00002 $0.00435
Haiku 4.5 $0.00001 $0.00217

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

Security

Grade A, and why

analyze 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.

commands/analyze.md · 224 lines

How it starts

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

Analyze Trace

Validate and analyze the provided trace file for cases (grounding, missed-action, instruction-following, context-utilization, goal-drift, persona-adherence, reasoning-action-mismatch, step-repetition, tool-failure, premature-termination, contradictory-instructions, missing-context, ambiguous-instructions, guardrail-violation). Supports both OTEL (JSON) and Claude Code (JSONL) formats.

Arguments

  • <trace-file>: Path to the trace file (required)
  • --hash <hash>: Pre-computed trace hash (optional). If provided, skip shasum computation and use this hash for memory lookup and output. This is a 16-character hex string.

Parse arguments: Extract the trace file path and optional --hash value from $ARGUMENTS. Example inputs:

  • "/path/to/trace.json" → path="/path/to/trace.json", hash=null
  • "/path/to/trace.json" --hash abc123def456789 → path="/path/to/trace.json", hash="abc123def456789"

Memory Behavior

Sift maintains persistent memory for each trace file to track cases across analysis runs:

  • Memory storage: .self-care/memory/<trace_hash>.jsonl
  • Trace hash: SHA256 of trace file content (first 16 characters), or provided via --hash
  • Persistence: Events are tracked as "new" (first detection) or "recurring" (seen before)
  • Resolution: Previously detected events that no longer appear are marked as "resolved"

Instructions

Stage 0: Parse Arguments

Extract the trace file path and optional flags from $ARGUMENTS:

  1. If $ARGUMENTS contains --hash, extract the hash value:

    • provided_hash: The value after --hash (trimmed)
    • Remove --hash <value> from the argument string
  2. Otherwise: provided_hash = null

  3. If $ARGUMENTS contains --skip-validation:

    • skip_validation = true
    • Remove --skip-validation from the argument string
  4. Otherwise: skip_validation = false

  5. The remaining string is trace_path (trimmed, with quotes removed)

  6. If the prompt (not $ARGUMENTS) contains an <analysis-config> block, extract its JSON content:

    • analysis_config_json: The JSON string inside the <analysis-config> tags
    • This block appears after the command line in the prompt body (appended by the server)
  7. Otherwise: analysis_config_json = null

Read the full file on GitHub · 224 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 · 224 lines · 8 tokens per session scan A 74b445cf206e

Subscribe to this mod's changes

analyze is a command published in the GitHub repository Not-Diamond/self-care (28 stars, last pushed 4mo ago), licensed MIT. It adds 8 tokens to every session and 2,173 once invoked, about $0.0000 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.