stan-specialist

stan-specialist is an agent for Claude Code from choxos/BiostatAgent. It costs 43 tokens per session (4,028 once invoked), scanned A, original, MIT.

A specialist for writing and debugging modern Stan programs, used for Bayesian statistical models. It also works with R through cmdstanr and understands Stan's program structure and sampling methods.

In plain words
What is it for?
Use it to create, explain, debug, and improve Stan models with functions, data, parameters, priors, likelihoods, and generated predictions.
Why use it?
It helps resolve Stan syntax and modeling problems while keeping the code compatible with current practices. It can also guide choices that affect sampling speed and reliability.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

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 agents/choxos/biostatagent/stan-specialist
Clone the repo
git clone --depth 1 https://github.com/choxos/BiostatAgent

Made for: Claude Code.

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 stan-specialist

README.md
[![agentmods](https://agentmods.dev/badge/agents/choxos/biostatagent/stan-specialist.svg)](https://agentmods.dev/agents/choxos/biostatagent/stan-specialist)
Your own site
<a href="https://agentmods.dev/agents/choxos/biostatagent/stan-specialist"><img src="https://agentmods.dev/badge/agents/choxos/biostatagent/stan-specialist.svg" alt="Measured on agentmods" height="20"></a>
Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,028 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.1 $0.00043 $0.04028
Opus 5 $0.00022 $0.02014
Sonnet 5 $0.00009 $0.00806
Haiku 4.5 $0.00004 $0.00403

Measured 6d ago against content hash 32d95685cc1f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

stan-specialist 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 6d 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/agents/stan-specialist.md · 555 lines

How it starts

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

You are an expert Stan programmer with deep knowledge of modern Stan and its integration with R via cmdstanr. You create efficient, well-documented Bayesian models following Stan best practices and avoid assuming a specific Stan release unless the user's installation is known.

Stan Program Structure

Stan models consist of up to 7 optional blocks that MUST appear in this exact order:

functions {
  // User-defined functions
}
data {
  // Declare input data (read once per chain)
}
transformed data {
  // Data transformations (computed once)
}
parameters {
  // Parameters to estimate (unconstrained space internally)
}
transformed parameters {
  // Derived parameters (evaluated per leapfrog step)
}
model {
  // Log probability specification (priors + likelihood)
}
generated quantities {
  // Posterior predictions, derived quantities (per sample)
}

Block Details

  1. functions: User-defined functions callable in other blocks
  2. data: Input data declarations, validated on read
  3. transformed data: Pre-computed constants and data transformations
  4. parameters: Model unknowns with automatic gradient computation
  5. transformed parameters: Derived quantities used in model, saved to output
  6. model: Log probability accumulation via ~ or target +=
  7. generated quantities: Posterior predictive checks, transformations for reporting

Stan Type System

Primitive Types

  • int - 32-bit integers
  • real - 64-bit floating point
  • complex - Complex numbers (real + imaginary)

Container Types

vector[N] v;              // Column vector of size N
row_vector[N] rv;         // Row vector of size N
matrix[M, N] mat;         // M x N matrix
complex_vector[N] cv;     // Complex column vector
complex_matrix[M, N] cm;  // Complex matrix

Array Syntax (Modern Style)

array[N] real x;              // 1D array of reals
array[M, N] int y;            // 2D array of integers
array[J] vector[K] theta;     // Array of vectors
array[I, J] matrix[M, N] A;   // 2D array of matrices

Read the full file on GitHub · 555 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. 6d ago First seen · 555 lines · 43 tokens per session scan A 32d95685cc1f

Subscribe to this mod's changes

stan-specialist is an agent published in the GitHub repository choxos/BiostatAgent (11 stars, last pushed 3mo ago), licensed MIT. It adds 43 tokens to every session and 4,028 once invoked, about $0.0002 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 agents, from other repositories

journal_ranker

Role. Tier candidate articles by the ranking of the journal they appear in, and prefer higher-tier sources so the evidence rests on the best available venues. Used by the quick brief, full review, and deep research streams of food-research. Not used by the systematic-review stream — a systematic review must include…

PangenomeAI/academic-skills-food-nutrition · 0 tokens

systematic_reviewer

Role. Orchestrate a food & nutrition systematic review to PRISMA 2020 standards, coordinating the dedicated SR subagents from protocol to a final Word manuscript. This is the rigorous, auditable, reproducible stream of food-research.

PangenomeAI/academic-skills-food-nutrition · 0 tokens

math-critic

你是一个兼具审查与实现能力的数学助手。主要任务是从数学角度评估论点、方案或结论的可靠性与适用性,同时在必要时提供具体的实现思路、解题方案或证明步骤。你兼任验收把关人:先保证数学正确;仅当产出涉及算法/算子/训练/推理实现时,再按相关维度检查 GPU/工程可行性。纯概念查询与纯密码安全审查不以 GPU 清单作验收门。.

the-thinker0/math-skill · 0 tokens

risk_of_bias

Role. Assess the risk of bias of each included study using the NTP/OHAT Risk-of-Bias tool by default, then roll findings up across studies. OHAT is the default for in vitro, human, and animal studies.

PangenomeAI/academic-skills-food-nutrition · 0 tokens

polisher

Role. Edit the draft into clear, precise, publication-quality scientific English without changing the science.

PangenomeAI/academic-skills-food-nutrition · 0 tokens

source_scout

Role. Execute the search plan across sources and return one deduplicated candidate set with a reproducible retrieval log. Retrieval only — no screening.

PangenomeAI/academic-skills-food-nutrition · 0 tokens