gpu-use

gpu-use is a skill for Claude Code from majiayu000/spellbook. It costs 49 tokens per session (1,346 once invoked), scanned A, original, MIT.

A tool that connects to a remote server over SSH to show GPU usage, running processes, and the containers they belong to. A GPU is a processor often used for machine-learning and other heavy calculations.

In plain words
What is it for?
Use it to inspect remote GPU memory, identify GPU-running processes, and link those processes to Docker containers.
Why use it?
It replaces several manual server checks with one view of which GPUs and memory are being used and by what.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

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 skills/majiayu000/spellbook/gpu-use
Any agent
npx skills add majiayu000/spellbook --skill gpu-use
Clone the repo
git clone --depth 1 https://github.com/majiayu000/spellbook

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 gpu-use

README.md
[![agentmods](https://agentmods.dev/badge/skills/majiayu000/spellbook/gpu-use.svg)](https://agentmods.dev/skills/majiayu000/spellbook/gpu-use)
Your own site
<a href="https://agentmods.dev/skills/majiayu000/spellbook/gpu-use"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/gpu-use.svg" alt="Measured on agentmods" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,346 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.1 $0.00049 $0.01346
Opus 5 $0.00024 $0.00673
Sonnet 5 $0.00010 $0.00269
Haiku 4.5 $0.00005 $0.00135

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

Security

Grade A, and why

gpu-use scanned grade A with 0 findings 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 6d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/gpu-use/SKILL.md · 120 lines

How it starts

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

GPU 使用情况诊断

你是一个 GPU 资源管理专家,帮助用户快速了解远程服务器上的 GPU 使用情况。

服务器列表

别名 SSH 命令
默认 ssh [email protected] -p 10022

用户可以传入自定义 SSH 地址,格式:user@host -p port。无参数时使用默认服务器。

诊断流程

第一步:采集数据

并行执行以下命令(通过 SSH):

  1. GPU 卡概况
ssh {SSH_TARGET} "nvidia-smi --query-gpu=index,name,memory.total,memory.used,memory.free,utilization.gpu --format=csv,noheader,nounits"
  1. GPU 上运行的进程
ssh {SSH_TARGET} "nvidia-smi --query-compute-apps=pid,gpu_uuid,used_memory,name --format=csv,noheader,nounits"
  1. GPU UUID 到 index 的映射
ssh {SSH_TARGET} "nvidia-smi --query-gpu=index,gpu_uuid --format=csv,noheader"
  1. Docker 容器列表
ssh {SSH_TARGET} "docker ps --format '{{.ID}} {{.Names}}' 2>/dev/null"
  1. 进程 PID 到容器的映射(用采集到的 PID 列表)
ssh {SSH_TARGET} "for cid in \$(docker ps -q); do name=\$(docker inspect --format '{{.Name}}' \$cid | sed 's/^\///'); pids=\$(docker top \$cid -o pid 2>/dev/null | tail -n +2); for p in \$pids; do echo \"\$p \$name\"; done; done 2>/dev/null"
  1. 容器内多实例 http_server 检测(识别单容器多终端部署)
ssh {SSH_TARGET} "for cid in \$(docker ps -q); do name=\$(docker inspect --format '{{.Name}}' \$cid | sed 's/^\///'); servers=\$(docker exec \$cid ps aux 2>/dev/null | grep 'http_server -p' | grep -v grep | awk '{for(i=1;i<=NF;i++) if(\$i==\"-p\") print \$(i+1)}'); if [ -n \"\$servers\" ]; then echo \"\$name: \$servers\"; fi; done 2>/dev/null"

第二步:生成报告

将 GPU UUID 映射回 index,将 PID 映射回容器名,按以下格式输出:

## GPU 使用概况

| GPU | 型号 | 显存占用 | 空闲 | GPU 利用率 | 状态 |
|-----|------|----------|------|------------|------|
| 0 | H200 | 107 / 141 GB | 34 GB | 85% | 🔴 繁忙 |
| 1 | H200 | 12 / 141 GB | 129 GB | 10% | 🟢 空闲 |
| 2 | H200 | 0 / 141 GB | 141 GB | 0% | ⚪ 无任务 |

## 进程详情

| GPU | 显存占用 | 容器 | 进程 |
|-----|----------|------|------|
| 0 | 107 GB | vllm_qwen35 | VLLM::EngineCore |
| 0 | 2 GB | truetranslate-api-bin | truetranslate_api.bin |
| 1 | 12 GB | atlas_video | python |

## 多实例服务(单容器多终端部署)

如果检测到容器内运行多个 http_server 实例,单独列出:

| 容器 | 端口 | GPU | 状态 |
|------|------|-----|------|
| atlas_video | :5001 | GPU 2 | 运行中 |
| atlas_video | :5002 | GPU 3 | 运行中 |

## 空闲资源

可用于新服务部署的 GPU:
- GPU 4: 141 GB 完全空闲
- GPU 5: 141 GB 完全空闲

Read the full file on GitHub · 120 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. 6d ago First seen · 120 lines · 49 tokens per session scan A f02b6d40b8ab

Subscribe to this mod's changes

gpu-use is a skill published in the GitHub repository majiayu000/spellbook (265 stars, last pushed yesterday), licensed MIT. It adds 49 tokens to every session and 1,346 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

cao-session-management

Interact with CAO (CLI Agent Orchestrator) — launch multi-agent sessions, check status, send follow-up instructions, unblock stuck terminals, or shut down sessions. Use when working with CAO sessions in any capacity.

awslabs/cli-agent-orchestrator · 49 tokens

workflow

Skill "workflow" from zhinkgit/embeddedskills, covering workflow 编排层, 命令, 配置说明, 配置结构 and 参数解析顺序.

zhinkgit/embeddedskills · 88 tokens

pneuma-session

Rewrite the active Pneuma session's UI title + one-line summary so the launcher and ProjectPanel rows reflect what the session is actually about. Use this skill whenever the user asks to "整理 / 概括 / refresh / re-title / summarize this session", whenever the conversation has produced substantive work and the default…

pandazki/pneuma-skills · 127 tokens

fast-resume

Search local coding-agent session history and identify safe resume commands. Use when the user asks to find, inspect, continue, or recover previous work from Claude Code, Codex, Pi, or another agent indexed by fast-resume.

angristan/fast-resume · 50 tokens

lov-finder-action

Generate Mac Finder right-click menu actions. Two modes: (A) Automator Quick Action for file/folder context menus, (B) Finder Sync Extension (Swift + xcodegen) for blank-space context menus. Automatically selects mode based on user intent. Trigger when user mentions "Finder右键", "右键菜单", "Quick Action", "Finder…

lovstudio/skills · 104 tokens

lov-personal-vocabulary

维护一份可跨语音输入法复用的个人词汇表:统一管理、去重、并同步到 Typeless、OpenLess 等 App。Trigger: 帮我维护词汇表、同步词汇、把词汇表填到 OpenLess、manage my personal vocabulary, sync dictation terms across apps.

lovstudio/skills · 75 tokens