running-stata

running-stata is a skill for Claude Code from yale-som-hpc/claude-code-marketplace. It costs 63 tokens per session (1,065 once invoked), scanned C, original, Unlicense.

Guidance for running Stata, a statistics program, as batch jobs on Yale SOM's shared computing cluster. It covers Slurm scripts, logs, temporary files, CPU requests, and Stata's shared license.

In plain words
What is it for?
Submitting Stata do-files through Slurm, selecting Stata/MP processors, storing temporary data on scratch space, and troubleshooting batch jobs or license problems.
Why use it?
It helps jobs run unattended with the right resources, leaves useful error records, and avoids using more CPUs or license capacity than needed.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the hpc plugin — 23 skills, 3 commands shipped together

Good fit Submitting Stata do-files through Slurm, selecting Stata/MP processors, storing temporary data on scratch space, and troubleshooting batch jobs or license problems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yale-som-hpc/claude-code-marketplace/running-stata
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.

Any agent
npx skills add yale-som-hpc/claude-code-marketplace --skill running-stata
Clone the repo
git clone --depth 1 https://github.com/yale-som-hpc/claude-code-marketplace

Made for: Claude Code.

Or install hpc, the plugin that ships this one along with the rest of its 23 skills, 3 commands.

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 running-stata

README.md
[![agentmods](https://agentmods.dev/badge/skills/yale-som-hpc/claude-code-marketplace/running-stata/github.svg)](https://agentmods.dev/skills/yale-som-hpc/claude-code-marketplace/running-stata)
Your own site
<a href="https://agentmods.dev/skills/yale-som-hpc/claude-code-marketplace/running-stata"><img src="https://agentmods.dev/badge/skills/yale-som-hpc/claude-code-marketplace/running-stata/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 running-stata

Your own site · 80×15
<a href="https://agentmods.dev/skills/yale-som-hpc/claude-code-marketplace/running-stata"><img src="https://agentmods.dev/badge/skills/yale-som-hpc/claude-code-marketplace/running-stata.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,065 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00063 $0.01065
Opus 5 $0.00032 $0.00532
Sonnet 5 $0.00013 $0.00213
Haiku 4.5 $0.00006 $0.00106

Measured 11d ago against content hash 3a46b8c9dbab, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade C, and why

running-stata scanned grade C with 1 finding 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 11d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

trap 'rm -rf "$STATATMP"' EXIT
plugins/hpc/skills/running-stata/SKILL.md · 112 lines

How it starts

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

Running Stata

Rule: run Stata in batch jobs, write logs, put temp files on scratch, and request only the cores Stata will use.

What you get: the stata module is a complete MP install — no package-bootstrap step (unlike R, whose base module ships nothing). ssc install packages land in your personal ado directory.

Slurm template

#!/bin/bash
#SBATCH --job-name=stata-job
# default_queue caps at 4h; for long/large work use cpunormal or gpunormal (see managing-jobs)
#SBATCH --partition=default_queue
#SBATCH --time=01:00:00
#SBATCH --cpus-per-task=4
#SBATCH --mem=16G
#SBATCH --output=logs/%x_%j.out

set -euo pipefail

module purge
module load stata

# These only affect external BLAS calls; native Stata/MP threading is controlled
# by `set processors` (below), not by these. Harmless to keep for portability.
export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK:-1}
export OPENBLAS_NUM_THREADS=${SLURM_CPUS_PER_TASK:-1}
# The stata/19 module defaults STATATMP=/gpfs/scratch60; override for per-job isolation:
export STATATMP=/gpfs/scratch60/$USER/stata-tmp/${SLURM_JOB_ID}

mkdir -p "$STATATMP" logs
trap 'rm -rf "$STATATMP"' EXIT

cd /gpfs/project/myproject/code
stata-mp -b do src/main.do

Two log gotchas, both verified on the cluster:

  • Read the .log, not the .out. Under stata-mp -b, Stata sends all output to its own log file; the Slurm --output .out file ends up empty. The log using inside your do-file (below) is what you read.
  • stata-mp -b do src/main.do also writes main.log in the working directory (named after the do-file), in addition to your log using. Either expect/clean up that stray file or name your log using differently.
  • Check the log for errors — batch mode can exit 0 on a Stata error. Grep the .log for an r(###) return code; set -e will not catch a do-file error on its own.

Do-file preamble

capture log close _all
local jobid : env SLURM_JOB_ID
if "`jobid'" == "" local jobid local
log using "logs/main_`jobid'.log", replace text

local ncpus : env SLURM_CPUS_PER_TASK
if "`ncpus'" == "" local ncpus 1
set processors `ncpus'

local statatmp : env STATATMP
di "STATATMP=`statatmp'"

set more off
version 19

Read the full file on GitHub · 112 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. 11d ago First seen · 112 lines · 63 tokens per session scan C 3a46b8c9dbab

Subscribe to this mod's changes

running-stata is a skill published in the GitHub repository yale-som-hpc/claude-code-marketplace (5 stars, last pushed 2mo ago), licensed Unlicense. It adds 63 tokens to every session and 1,065 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

latchbio-integration

Build, register, debug, and operate bioinformatics workflows on Latch using the Python SDK, CLI, Latch Data and Registry, Nextflow, Snakemake, programmatic execution, and Latch MCP. Use when authoring or deploying Latch workflows, configuring resources or interfaces, moving data, integrating Registry, or launching and…

K-Dense-AI/scientific-agent-skills · 76 tokens

remote-compute-ssh

Evaluate and use SSH Remote Compute before choosing where to run GPU, high-memory, parallel, batch, model-inference, bioinformatics, or other long-running scientific work; supports short remote commands and asynchronous jobs with automatic harvest and analysis.

aipoch/open-science · 53 tokens

modal-compute

Run explicitly chosen research benchmark or replication jobs on Modal's serverless infrastructure. Use when a Feynman research workflow needs burst remote GPU compute and the Modal CLI is available.

companion-inc/feynman · 39 tokens

dnanexus-integration

DNAnexus cloud genomics platform. Build apps/applets, manage data (upload/download), dxpy Python SDK, run workflows, FASTQ/BAM/VCF, for genomics pipeline development and execution.

synthetic-sciences/openscience · 49 tokens

latchbio-integration

Latch platform for bioinformatics workflows. Build pipelines with Latch SDK, @workflow/@task decorators, deploy serverless workflows, LatchFile/LatchDir, Nextflow/Snakemake integration.

synthetic-sciences/openscience · 45 tokens

modal-serverless-gpu

Run approved CPU or GPU work through OpenScience computejob on the user's configured Modal account. Use for isolated scientific scripts, dependency provisioning, durable outputs, logs, status, cancellation, and recovery. Never invoke the Modal SDK or CLI directly.

synthetic-sciences/openscience · 54 tokens