platformx-students/sprc-plugins/tree/main/plugins/sprc-slurm-mods
sprc-slurm-mods
供 sprc Slurm 叢集使用的 Claude Code mod:即時叢集/工作儀表板面板、狀態列、工作生命週期工具、完成通知和提交防護。
關於這個 mod
一個 Claude Code mod,將 sprc 叢集的即時狀態和工作追蹤顯示在 Claude Code 介面中。它提供狀態列、顯示節點/工作/預算資訊的 /sprc 面板、供模型使用的工作工具(sprc_status、sprc_job、sprc_wait、sprc_follow)、sbatch 工作完成時的自動通知、提交防護,以及單列即時上下文摘要。需要支援 mod(function hook)的較新 Claude Code,而且只有 Slurm 回報 ClusterName = sprc 時才會啟用。在加入市集後,透過 /plugin install sprc-slurm-mods@sprc-plugins 安裝。
安裝
請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。
claude plugin marketplace add platformx-students/sprc-plugins claude plugin install sprc-slurm-mods
原文 / README
sprc-slurm-mods — Claude Code only
A Claude Code mod: live cluster state and job tracking inside the Claude Code interface,
for sessions running on the sprc cluster. It is not an Agent Skill and does nothing in codex,
opencode or oh-my-pi. Those harnesses (and Claude Code) get the generic
slurm skill, which works on its own; this mod is an
optional extra on top of it.
| You get | What it is |
|---|---|
| Status line | sprc ▸ 2/8 GPU free (+2 stranded) · you 1R 3PD · queue 31 |
| /sprc pane | Nodes (GPUs, CPU and memory bars), your jobs (walltime bar or pending reason + estimated start), other users as counts only, recently finished jobs with right-sizing advice, course budget. Click a job id for its detail view: times, queue wait, resources, log tail, efficiency, follow and scancel (asks first). |
| Job tools for the model | sprc_status, sprc_job, sprc_wait (blocks up to 10 min instead of a sleep/squeue loop), sprc_follow (wake=true starts a new turn when the job ends) |
| Finish notices | Jobs submitted with sbatch in the session are followed automatically; when one ends you get a toast and Claude gets its result and efficiency |
| Guardrails | Blocks what the cluster would reject anyway: interactive scavenger, sbatch from node-local /tmp, GPU launchers (torchrun, vllm serve, …) on the login node, sleep-and-squeue polling loops |
| Live context | A one-line cluster summary on prompts that mention Slurm, GPUs or the cluster, re-sent only when it changes |
"Free" GPUs are the ones a default GPU job could actually get: an idle GPU plus the 32 CPUs and 375G of memory that come with it by default. Idle GPUs on a node full of CPU jobs show as stranded.
When it is active
Only when the session runs on the sprc cluster (Slurm reports ClusterName = sprc), normally on
sprlab005. Anywhere else, including another site's Slurm cluster and Claude Code on the web, it
registers nothing and stays silent.
Install
Needs a recent Claude Code with mod (function hook) support. Add the marketplace as in the main README, then:
/plugin install sprc-slurm-mods@sprc-plugins
/reload-plugins
Install sprc-slurm too: the mod shows state and tracks jobs, and the skill tells Claude how to
submit them well.
Settings
/config → sprc-slurm-mods:
| Setting | Default | |
|---|---|---|
| pollSeconds | 30 | How often to read sinfo + squeue (minimum 10). With no jobs of yours and nothing followed, it polls at a quarter of that rate. |
| autoOpen | on | Open the pane beside the chat once per session (wide terminals only). |
| guards | enforce | enforce blocks; warn lets the command run and tells Claude; off disables the checks (submitted jobs are still followed). |
| liveContext | on | The one-line summary on cluster-related prompts. |
Privacy
The pane and tools show other users' jobs only as counts: no names, users or job names.
Developing it
Load the working copy on sprlab005 with claude --plugin-dir plugins/sprc-slurm-mods (disable
the installed plugin first); edits hot-reload. Before committing, run claude plugin validate .
and claude plugin test . in this directory.
