init-cluster

A command that detects the current computing-cluster environment and saves its settings in a local configuration file. A cluster is a group of connected computers used for large jobs.

In plain words
What is it for?
Use it to create or update the local cluster configuration, including detected GPUs, software versions, storage paths, and scheduling settings.
Why use it?
It prevents each scientific workflow from asking for the same machine, GPU, storage, and job-scheduler details repeatedly.

Command for Claude Code

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/amdresearch/ai4science-studio/init-cluster
Clone the repo
git clone --depth 1 https://github.com/AMDResearch/ai4science-studio

Made for: Claude Code.

Per session 0 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,236 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00000 $0.02236
Opus 5 $0.00000 $0.01118
Sonnet 5 $0.00000 $0.00447
Haiku 4.5 $0.00000 $0.00224

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

Security

Grade A, and why

init-cluster scanned grade A 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 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s --connect-timeout 5 -o /dev/null -w "%{http_code}" https://huggingface.co 2>/dev/null
.claude/commands/init-cluster.md · 200 lines

How it starts

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

Initialize local cluster configuration

Detect the current cluster environment and create a .cluster-config.yaml file with site-specific settings. This file is gitignored and never committed.

Step 0 — Check if config already exists

Check both locations in order:

  1. .cluster-config.yaml (repo root)
  2. ~/.config/ai4science-studio/cluster.yaml

If either exists, read it, show the user the current settings, and ask:

  • Update — re-run discovery and update the file
  • Keep — leave it as-is and exit

If neither exists, proceed to Step 1.

Step 1 — Auto-discover cluster environment

Run ALL of the following discovery commands silently (do not show raw output). Parse and store results for the questionnaire in Step 2.

# 1. Home directory (may not be /home/...)
echo "$HOME"

# 2. GPU architecture and count
rocminfo 2>/dev/null | grep -oP 'gfx\d+' | sort -u
rocm-smi --showproductname 2>/dev/null | head -20
ls /dev/dri/renderD* 2>/dev/null | wc -l

# 3. VRAM per GPU (MB → GB)
rocm-smi --showmeminfo vram 2>/dev/null | grep "Total" | head -1

# 4. ROCm version
cat /opt/rocm/.info/version 2>/dev/null || rocminfo 2>/dev/null | grep -oP 'HSA Runtime Version:\s*\K.*'

# 5. SLURM: available GPU partitions
sinfo -h -o "%P %l %G %D" 2>/dev/null | grep -i gpu

# 6. SLURM: user's accounts and associations
sacctmgr show associations where user=$USER format=account%30,partition%30,qos%30 -n 2>/dev/null

# 7. Container runtimes available
which apptainer 2>/dev/null && apptainer --version
which docker 2>/dev/null && docker --version 2>/dev/null
docker info 2>/dev/null | grep -i "amd\|runtime"

# 8. Common scratch / project directories (shared storage)
for d in /scratch/$USER /scratch /lustre /gpfs /tmp/$USER; do
    [[ -d "$d" ]] && echo "scratch: $d"
done

# 9. Node-local fast storage (for MIOpen cache, tmp writes during training)
for d in /scratch /local /nvme /tmp; do
    [[ -d "$d" && -w "$d" ]] && echo "scratch_local: $d" && break
done

# 10. RCCL / network interface discovery (for multi-node)
ip -o link show up 2>/dev/null | awk -F': ' '{print $2}' | grep -v lo
ibstat 2>/dev/null | grep "CA '" | awk -F"'" '{print $2}'

# 11. Internet connectivity from this node
curl -s --connect-timeout 5 -o /dev/null -w "%{http_code}" https://huggingface.co 2>/dev/null

# 12. Proxy settings
echo "HTTP_PROXY=${HTTP_PROXY:-<unset>}"
echo "HTTPS_PROXY=${HTTPS_PROXY:-<unset>}"

# 13. Existing SIF files
find "$HOME" /scratch /projects /opt -maxdepth 4 -name "*.sif" 2>/dev/null | head -20

# 14. Performance tooling (perf-analysis / perf-optimizer-loop recipes — optional)
# Look for an existing shared perf-tools dir (omnistat + TraceLens venv "perf-inspect/").
for d in /shared/*/tools /shared/perf-tools "$HOME/perf-tools"; do
    [[ -d "$d/perf-inspect" || -d "$d/omnistat-src" ]] && echo "perf_tools: $d"
done

Read the full file on GitHub · 200 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 · 200 lines · 0 tokens per session scan A 6a110cc49a3d

Subscribe to this mod's changes

init-cluster is a command published in the GitHub repository AMDResearch/ai4science-studio (4 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,236 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.