run-diagnostics

run-diagnostics is a command for coding agents from choxos/BiostatAgent. It costs 14 tokens per session (1,578 once invoked), scanned A, original, MIT.

A command for running Bayesian models with test or user-provided data and reporting sampling diagnostics. It supports Stan, JAGS, WinBUGS, and PyMC workflows.

In plain words
What is it for?
Use it to identify the model language, generate regression or hierarchical test data, compile and run short chains, and inspect convergence and related diagnostics.
Why use it?
It gives you a repeatable way to check whether a model runs and whether its sampling results are trustworthy. When needed, it creates suitable synthetic data for the test.

Command

Part of the bayesian-modeling plugin — 9 skills, 3 commands, 6 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/choxos/biostatagent/run-diagnostics
Clone the repo
git clone --depth 1 https://github.com/choxos/BiostatAgent

Or install bayesian-modeling, the plugin that ships this one along with the rest of its 9 skills, 3 commands, 6 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-diagnostics

README.md
[![agentmods](https://agentmods.dev/badge/commands/choxos/biostatagent/run-diagnostics.svg)](https://agentmods.dev/commands/choxos/biostatagent/run-diagnostics)
Your own site
<a href="https://agentmods.dev/commands/choxos/biostatagent/run-diagnostics"><img src="https://agentmods.dev/badge/commands/choxos/biostatagent/run-diagnostics.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,578 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.00014 $0.01578
Opus 5 $0.00007 $0.00789
Sonnet 5 $0.00003 $0.00316
Haiku 4.5 $0.00001 $0.00158

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

Security

Grade A, and why

run-diagnostics 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.

plugins/bayesian-modeling/commands/run-diagnostics.md · 247 lines

How it starts

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

Model Execution and Diagnostics Workflow

You are helping the user run and diagnose their Bayesian model.

Step 1: Identify Model and Data

Determine:

  1. Model language: Stan / JAGS / WinBUGS / PyMC
  2. Data source:
    • User-provided data
    • Generate synthetic test data

Step 2: Generate Test Data (if needed)

Use @test-runner to create appropriate synthetic data:

For Regression Models

set.seed(42)
N <- 100
K <- 3
X <- matrix(rnorm(N * K), N, K)
true_beta <- c(0.5, -0.3, 0.8)
true_sigma <- 1
y <- X %*% true_beta + rnorm(N, 0, true_sigma)

stan_data <- list(N = N, K = K, X = X, y = as.vector(y))

For Hierarchical Models

set.seed(42)
J <- 8
N_per_group <- 20
true_mu <- 5
true_tau <- 3
true_theta <- rnorm(J, true_mu, true_tau)

y <- unlist(lapply(1:J, function(j) rnorm(N_per_group, true_theta[j], 2)))
group <- rep(1:J, each = N_per_group)

stan_data <- list(N = J * N_per_group, J = J, group = group, y = y)

Step 3: Execute Model

Stan (cmdstanr)

library(cmdstanr)

# Compile
mod <- cmdstan_model("model.stan")

# Short test run
fit <- mod$sample(
  data = stan_data,
  seed = 12345,
  chains = 2,
  parallel_chains = 2,
  iter_warmup = 500,
  iter_sampling = 500,
  refresh = 100
)

JAGS (R2jags)

library(R2jags)

fit <- jags(
  data = jags_data,
  parameters.to.save = c("mu", "sigma", "theta"),
  model.file = "model.txt",
  n.chains = 2,
  n.iter = 2000,
  n.burnin = 1000,
  progress.bar = "text"
)

PyMC (Python)

import pymc as pm
import arviz as az
import numpy as np

# Define model
with pm.Model() as model:
    # Priors
    mu = pm.Normal("mu", mu=0, sigma=10)
    sigma = pm.HalfNormal("sigma", sigma=1)

    # Likelihood
    y_obs = pm.Normal("y_obs", mu=mu, sigma=sigma, observed=y_data)

    # Sample
    trace = pm.sample(
        draws=1000,
        tune=1000,
        chains=2,
        cores=2,
        random_seed=12345,
        return_inferencedata=True
    )

# Diagnostics
print(az.summary(trace))
az.plot_trace(trace)

Read the full file on GitHub · 247 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 · 247 lines · 14 tokens per session scan A 128095f11e06

Subscribe to this mod's changes

run-diagnostics is a command published in the GitHub repository choxos/BiostatAgent (11 stars, last pushed 3mo ago), licensed MIT. It adds 14 tokens to every session and 1,578 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.