/modelopt:modelopt-monitorfrom ModelOpt
Monitors SLURM cluster jobs (PTQ, evaluation, deployment) by tracking active jobs in a per-session registry and polling until completion.
Ships in ModelOpt. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Monitor jobs submitted to SLURM clusters — PTQ quantization, NEL evaluation, model deployment, or raw SLURM jobs.
Active jobs are tracked in per-session registries under .claude/agents/.
This avoids multiple agents clobbering one shared registry when they run at
the same time.
Use the current agent session id as <session_id>:
$CLAUDE_CODE_SESSION_ID, or the session_id field from hook input$CODEX_THREAD_IDRegistry layout:
.claude/agents/
<session_id>/
active_jobs.json
Each session's active_jobs.json is a JSON array:
[
{
"type": "nel",
"id": "<invocation_id or slurm_job_id>",
"host": "<cluster_hostname>",
"user": "<ssh_user>",
"submitted": "YYYY-MM-DD HH:MM",
"description": "<what this job does>",
"last_status": "<last known status>",
"owner": {
"agent": "claude-code|codex|manual",
"session_id": "<session_id>"
}
}
]
type is one of: nel, slurm, launcher.
Every time a job is submitted (by any skill or manually):
.claude/agents/<session_id>/active_jobs.json. Create the session directory and file if they don't exist.Monitor tool when it is available: write a small watcher that reads .claude/agents/<session_id>/active_jobs.json, checks every job with the appropriate method below, prints state-change events, updates last_status, removes terminal jobs from the session registry, and exits when no active jobs remain for this session.The monitor should terminate naturally when every registered job has reached a terminal state. If the Monitor tool is not available in the current harness, run an equivalent background process that implements the same loop and lets the agent resume/restart when the process exits.
Always do both steps. Don't try to predict job duration.
Whether triggered by monitor output or by the user asking "check status":
.claude/agents/<session_id>/active_jobs.jsonlast_status in registrylast_status in the session registryEach check method has its own status vocabulary. A watcher that mixes them
(e.g. uses SLURM's COMPLETED terminal-state regex against nel status output)
will silently never fire terminal transitions. Always match against the
vocabulary of the source you're polling.
type: nel)nel status <id>.extract_nel_state() {
local jid="$1" nel_bin="${NEL:-nel}" output state_col
output=$("$nel_bin" status "$jid" 2>&1)
state_col=$(echo "$output" \
| awk -F'|' -v prefix="$jid." 'index($1, prefix) == 1 { print $2; exit }')
[ -z "$state_col" ] && state_col="$output"
echo "$state_col" \
| LC_ALL=C tr '[:lower:]' '[:upper:]' \
| awk 'match($0, /(PENDING|RUNNING|SUCCESS|FAILED|KILLED|ERROR|NOT[[:space:]]+FOUND)/) { print substr($0, RSTART, RLENGTH); exit }' \
| sed 's/[[:space:]][[:space:]]*/ /g'
}
is_nel_terminal() {
case "$(extract_nel_state "$1")" in
SUCCESS|FAILED|KILLED|ERROR|"NOT FOUND") return 0 ;;
*) return 1 ;;
esac
}
nel info <id> to fetch results.nel info <id> --logs then inspect server/client/SLURM logs via SSH.type: launcher)Traceback, Error, or FAILED in the output.type: slurm)sacct; use sacct for the termination check because squeue
can lag in COMPLETING after sacct reports a terminal state.extract_slurm_state() {
local jid="$1" host="$2"
ssh "$host" "sacct -j $jid -X --format=State --noheader -P 2>/dev/null | head -1" \
| sed 's/^[[:space:]]*//;s/[[:space:]]*$//' \
| sed 's/^CANCELLED by .*/CANCELLED/'
}
is_slurm_terminal() {
case "$(extract_slurm_state "$1" "$2")" in
COMPLETED|FAILED|CANCELLED|TIMEOUT|NODE_FAIL|OUT_OF_MEMORY|PREEMPTED|BOOT_FAIL|DEADLINE) return 0 ;;
*) return 1 ;;
esac
}
ssh <host> "sacct -j <id> --format=State,ExitCode,Elapsed -n".When the user asks about a job without specifying an ID, check in order:
.claude/agents/<current_session_id>/active_jobs.json — current agent's jobsnel ls runs --since 1d — recent NEL runsssh <host> "squeue -u <user>" — active SLURM jobsls -lt tools/launcher/experiments/cicd/ | head -10 — recent launcher experimentsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub nvidia/model-optimizer --plugin modelopt32 skills in this plugin
/accessing-mlflowCompatibility name for modelopt-accessing-mlflow. Browse ModelOpt evaluation runs and artifacts in MLflow./benchmark-model-kernelsCompatibility name for modelopt-benchmark-model-kernels. Inspect model shapes and benchmark GEMM or fused-MoE kernels./commonShared ModelOpt support files. Use only when another ModelOpt skill directs you here./compare-resultsCompatibility name for modelopt-compare-results. Compare baseline and quantized evaluation results./day0-releaseCompatibility name for modelopt-day0-release. Run the full ModelOpt day-0 quantization and validation workflow./debugCompatibility name for modelopt-debug. Run commands through the remote Docker debugger relay.Other plugins' skills for the same job