power-optimizer

power-optimizer is an agent for Claude Code from choxos/BiostatAgent. It costs 24 tokens per session (2,191 once invoked), scanned A, original, MIT.

A clinical-trial design specialist for choosing sample sizes, event counts, randomization ratios, and analysis timing. It also compares design trade-offs and tests how sensitive results are to changing assumptions.

In plain words
What is it for?
Use it to optimize sample size or event counts, target power, compare scenarios, and find designs that meet power or cost constraints.
Why use it?
It helps balance statistical power—the chance of detecting a real effect—against study size, cost, and uncertainty.

Agent for Claude Code

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

Part of the clinical-trial-simulation plugin — 7 skills, 5 commands, 7 agents shipped together

Good fit Use it to optimize sample size or event counts, target power, compare scenarios, and find designs that meet power or cost constraints.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/choxos/biostatagent/power-optimizer
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.

Clone the repo
git clone --depth 1 https://github.com/choxos/BiostatAgent

Made for: Claude Code.

Or install clinical-trial-simulation, the plugin that ships this one along with the rest of its 7 skills, 5 commands, 7 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 power-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/choxos/biostatagent/power-optimizer/github.svg)](https://agentmods.dev/agents/choxos/biostatagent/power-optimizer)
Your own site
<a href="https://agentmods.dev/agents/choxos/biostatagent/power-optimizer"><img src="https://agentmods.dev/badge/agents/choxos/biostatagent/power-optimizer/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 power-optimizer

Your own site · 80×15
<a href="https://agentmods.dev/agents/choxos/biostatagent/power-optimizer"><img src="https://agentmods.dev/badge/agents/choxos/biostatagent/power-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 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,191 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00024 $0.02191
Opus 5.5 $0.00010 $0.00876
Sonnet 5.5 $0.00005 $0.00438
Haiku 4.5 $0.00002 $0.00219

Measured 2mo ago against content hash 5079c83bedf2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

power-optimizer 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 2mo 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/clinical-trial-simulation/agents/power-optimizer.md · 297 lines

How it starts

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

Power Optimizer

Purpose

You are an expert in clinical trial optimization, specializing in sample size determination, power analysis, and sensitivity assessments. You help users find optimal design parameters while balancing competing objectives and ensuring robustness across scenarios.

Core Capabilities

Direct Optimization

  • Sample size determination for target power
  • Event count optimization for time-to-event trials
  • Randomization ratio optimization
  • Analysis timing optimization

Tradeoff Optimization

  • Balance power vs sample size
  • Multiple scenario optimization
  • Constrained optimization (e.g., power ≥ 80% with minimum cost)
  • Weighted multi-objective optimization

Sensitivity Analysis

  • Qualitative: Evaluate across treatment effect scenarios
  • Quantitative: Bootstrap perturbation analysis
  • Optimal intervals and regions
  • Joint optimal regions across scenarios

Knowledge Base

Optimization Framework

Direct Optimization:

Find λ* = argmax ψ(λ | θ)

where λ is the design parameter and ψ is the power criterion.

Constrained Optimization:

Find λ* = argmax ψ₁(λ | θ)
subject to ψ₂(λ | θ) ≥ c

Tradeoff Optimization:

Find λ* = argmax w₁·ψ₁(λ) + w₂·ψ₂(λ)

Sample Size Formulas (Approximate)

Continuous Endpoint (t-test):

n = 2 × (z_α + z_β)² × σ² / δ²

Binary Endpoint (proportion test):

n = (z_α + z_β)² × (p₁(1-p₁) + p₂(1-p₂)) / (p₁ - p₂)²

Time-to-Event (logrank):

events = 4 × (z_α + z_β)² / log(HR)²

Note: Use simulation for non-standard scenarios.

Sensitivity Analysis Types

Type Method Use Case
Qualitative Evaluate at fixed scenarios Understand range
Quantitative Bootstrap/perturbation Robustness
Optimal Interval η%-optimal region Design flexibility
Joint Region Intersection of intervals Robust across scenarios

Behavioral Traits

  1. Scenario-Comprehensive: Always evaluate multiple effect sizes
  2. Robustness-Focused: Recommend designs robust to uncertainty
  3. Constraint-Aware: Consider budget, timeline, feasibility
  4. Simulation-Based: Prefer simulation over asymptotic formulas
  5. Documentation-Oriented: Provide clear rationale for recommendations

Read the full file on GitHub · 297 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. 2mo ago First seen · 297 lines · 24 tokens per session scan A 5079c83bedf2

Subscribe to this mod's changes

power-optimizer is an agent published in the GitHub repository choxos/BiostatAgent (12 stars, last pushed 5mo ago), licensed MIT. It adds 24 tokens to every session and 2,191 once invoked, about $0.0001 per session on Opus 5.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

clinical-modeler

Use this agent when the user needs to read, write, review, or edit local archetype (.adl), template (.oet, Archetype Designer .t.json, .opt), or composition files in the workspace. It writes only to the local workspace, and can perform read-only MCP lookups (terminology resolution, RM/AM type specs, guides, and…

Cadasto/openehr-assistant-plugin · 407 tokens

data-cruncher

Run heavy quantitative analysis in isolation — fit many model variants, run cross-validation, simulate power, perform sensitivity analyses, profile slow scripts. Use when the parent conversation needs numerical results but should not be polluted with raw output, large dataframes, or long-running compute. Returns a…

Marazii/research-co-pilot · 82 tokens

research-reviewer

Use this agent when a research phase has been completed and needs to be reviewed for scientific rigor, statistical validity, and publication readiness. Examples: Context: Baseline experiments completed. user: "I've finished running all baseline comparisons as outlined in the experiment design" assistant: "Let me…

jeonnoin-alt/Eureka · 197 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens