ai4science-studio: Command for Claude Code

.claude/commands/init-cluster.md

init-cluster is a command for Claude Code from AMDResearch/ai4science-studio. It costs 0 tokens per session (2,236 once invoked), scanned A, original, MIT.

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

Written for Claude Code: $ARGUMENTS substitution. Also seen: names the AskUserQuestion tool; positional $N argument.

This is AMDResearch/ai4science-studio's own configuration. It tells Claude Code how to work on ai4science-studio itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ai4science-studio configures →

Reuse

Borrowing it

Nothing to install: this file belongs to AMDResearch/ai4science-studio. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/AMDResearch/ai4science-studio/main/.claude/commands/init-cluster.md
Clone the repo
git clone --depth 1 https://github.com/AMDResearch/ai4science-studio

Made for: Claude Code.

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 init-cluster

README.md
[![agentmods](https://agentmods.dev/badge/commands/amdresearch/ai4science-studio/init-cluster/github.svg)](https://agentmods.dev/commands/amdresearch/ai4science-studio/init-cluster)
Your own site
<a href="https://agentmods.dev/commands/amdresearch/ai4science-studio/init-cluster"><img src="https://agentmods.dev/badge/commands/amdresearch/ai4science-studio/init-cluster/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 init-cluster

Your own site · 80×15
<a href="https://agentmods.dev/commands/amdresearch/ai4science-studio/init-cluster"><img src="https://agentmods.dev/badge/commands/amdresearch/ai4science-studio/init-cluster.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. 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.00000 $0.02236
Opus 5.5 $0.00000 $0.00894
Sonnet 5.5 $0.00000 $0.00447
Haiku 4.5 $0.00000 $0.00224

Measured 2mo ago against content hash 6a110cc49a3d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

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. 2mo 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 yesterday), 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.

Related

init-cluster compared with commands from other repositories

init-cluster next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
init-clusterAMDResearch/ai4science-studioCommand4yesterdayMITA0Claude Code
cost-optimizewshobson/agentsCommand42kyesterdayMITA26Claude Code
deploybutterbase-ai/butterbase-skillsCommand5356d agoMITA20Claude Code
firebase-publishPierry/harness-kitCommand41mo agoMITA20Claude Code
scanprajapatimehul/claude-aws-cost-saverCommand244mo agoMITA6Claude Code
migrationdatabayt/hogwartsCommand183d agononeA4Claude Code
workersFandhe-AI/agent-reference-skillsCommand42d agononeA0Claude Code