run

run is a command for coding agents from Not-Diamond/self-care. It costs 19 tokens per session (6,749 once invoked), scanned A, original, MIT.

A command that runs the complete Self-Care triage process on an agent trace file, which records what an AI agent did. It accepts OpenTelemetry JSON and Claude Code JSONL files.

In plain words
What is it for?
Use it to process a trace from start to finish, identify agent problems, create reports and output lists, and optionally record feedback.
Why use it?
It removes the need to run validation, analysis, reporting, review, and summary steps separately. It also checks whether analytics consent has been recorded before continuing.

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/run
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 run

README.md
[![agentmods](https://agentmods.dev/badge/commands/not-diamond/self-care/run.svg)](https://agentmods.dev/commands/not-diamond/self-care/run)
Your own site
<a href="https://agentmods.dev/commands/not-diamond/self-care/run"><img src="https://agentmods.dev/badge/commands/not-diamond/self-care/run.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,749 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.00019 $0.06749
Opus 5 $0.00010 $0.03374
Sonnet 5 $0.00004 $0.01350
Haiku 4.5 $0.00002 $0.00675

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

Security

Grade A, and why

run 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 3d 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/run.md · 729 lines

How it starts

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

Triage Pipeline

Run the full Self-Care triage pipeline on the provided trace file. Supports both OTEL (JSON) and Claude Code (JSONL) formats. This orchestrates 6 stages sequentially: validation, analysis, reporting, finding review, output lists, and feedback (only if you've opted in).

Before running the pipeline, check if the user has consented to analytics collection.

Read the config file at .self-care/config.json using the Read tool.

  • If the file exists and contains valid JSON with analytics.enabled set to true or false: consent is already recorded. Skip to Stage 0b.
  • If the file does not exist, or exists but has no analytics key: prompt for consent.

Prompt for consent using AskUserQuestion:

  • question: "Self-Care can collect anonymous usage analytics to help improve the tool. This includes: command usage frequency, case types detected (not trace content), and error rates. No trace data, file contents, or personally identifiable information is collected. Would you like to enable analytics?"
  • header: "Analytics"
  • options:
    • { "label": "Enable analytics", "description": "Help improve Self-Care with anonymous usage data" }
    • { "label": "Disable analytics", "description": "Opt out of usage analytics" }

Save the config:

  1. Get timestamp: date -u +"%Y-%m-%dT%H:%M:%SZ"
  2. Ensure the config directories exist: mkdir -p .self-care/traces .self-care/reports
  3. Read existing .self-care/config.json to preserve other settings (e.g. source, langsmith). Merge the analytics key into the existing object and write it back:
    {
      "...existing keys preserved...",
      "analytics": {
        "enabled": <true if "Enable analytics", false otherwise>,
        "consentTimestamp": "<timestamp>"
      }
    }
    

Stage 0b: Parse Arguments

Parse $ARGUMENTS to extract:

  • trace_path: The trace file path — the first quoted string (quotes stripped) or the first whitespace-delimited token. May be empty.
  • details: All remaining text after the trace file path (trimmed). May be empty.

Read the full file on GitHub · 729 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. 3d ago First seen · 729 lines · 19 tokens per session scan A 72c69225c250

Subscribe to this mod's changes

run is a command published in the GitHub repository Not-Diamond/self-care (28 stars, last pushed 4mo ago), licensed MIT. It adds 19 tokens to every session and 6,749 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.