system-doctor

system-doctor is a skill for Claude Code from majiayu000/spellbook. It costs 35 tokens per session (1,811 once invoked), scanned A, original, MIT.

A system performance diagnosis guide for finding why a computer is slow, overloaded, or short on memory. It checks running processes, CPU, memory, swap, and related system details.

In plain words
What is it for?
Use it to investigate high CPU or memory use, too many processes, zombie processes, swap use, and general computer lag.
Why use it?
It replaces guesswork with a structured check of the main causes of system slowness. It also groups processes from the same application to make the results easier to understand.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: positional $N argument.

Good fit Use it to investigate high CPU or memory use, too many processes, zombie processes, swap use, and general computer lag.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/majiayu000/spellbook/system-doctor
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.

Any agent
npx skills add majiayu000/spellbook --skill system-doctor
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 system-doctor

README.md
[![agentmods](https://agentmods.dev/badge/skills/majiayu000/spellbook/system-doctor/github.svg)](https://agentmods.dev/skills/majiayu000/spellbook/system-doctor)
Your own site
<a href="https://agentmods.dev/skills/majiayu000/spellbook/system-doctor"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/system-doctor/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 system-doctor

Your own site · 80×15
<a href="https://agentmods.dev/skills/majiayu000/spellbook/system-doctor"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/system-doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,811 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00035 $0.01811
Opus 5 $0.00017 $0.00905
Sonnet 5 $0.00007 $0.00362
Haiku 4.5 $0.00003 $0.00181

Measured 8d ago against content hash 49a3d633849c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

system-doctor 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 8d 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/system-doctor/SKILL.md · 202 lines

How it starts

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

系统性能诊断工具

你是一个系统性能诊断专家,帮助用户快速定位电脑卡顿的原因,给出可操作的建议。

诊断流程

严格按以下步骤执行,最大化并行采集,最后生成结构化报告。

第一步:系统概况

并行执行以下所有命令:

  1. 系统负载与运行时间
uptime
  1. 内存压力
memory_pressure 2>/dev/null || vm_stat
  1. 内存概况
sysctl -n hw.memsize | awk '{printf "物理内存: %.0f GB\n", $1/1024/1024/1024}'
  1. 进程总数与 zombie 进程
echo "进程总数: $(ps aux | wc -l | tr -d ' ')"
echo "Zombie 进程: $(ps aux | awk '$8 ~ /Z/ {count++} END {print count+0}')"
  1. CPU 核心数
sysctl -n hw.ncpu
  1. Swap 使用
sysctl vm.swapusage 2>/dev/null || echo "无 swap 信息"

第二步:CPU 大户 Top 20

ps aux --sort=-%cpu | head -21

第三步:内存大户 Top 20

ps aux --sort=-%mem | head -21

第四步:进程分组汇总

将同一应用的多个子进程合并统计(Chrome Renderer x N、Claude Helper x N 等)。

ps aux | awk 'NR>1 {
  cmd = $11
  # 提取应用名:去掉路径,取 basename
  n = split(cmd, parts, "/")
  name = parts[n]
  # 对 .app 内的进程,提取 .app 名称
  if (cmd ~ /\.app\//) {
    match(cmd, /([^\/]+)\.app/, arr)
    if (arr[1] != "") name = arr[1]
  }
  # 跳过内核进程
  if (name == "" || name == "-") next
  cpu[name] += $3
  mem[name] += $4
  rss[name] += $6
  count[name]++
}
END {
  printf "%-35s %8s %8s %10s %6s\n", "应用", "CPU%", "MEM%", "RSS(MB)", "进程数"
  printf "%-35s %8s %8s %10s %6s\n", "---", "---", "---", "---", "---"
  for (name in cpu) {
    printf "%-35s %8.1f %8.1f %10.0f %6d\n", name, cpu[name], mem[name], rss[name]/1024, count[name]
  }
}' | sort -t' ' -k2 -rn | head -30

第五步:异常检测

并行执行以下检测:

  1. CPU 占用 > 50% 的进程
echo "=== CPU > 50% 的进程 ==="
ps aux | awk 'NR>1 && $3 > 50 {printf "PID=%-8s CPU=%-6s MEM=%-6s CMD=%s\n", $2, $3, $4, $11}'
  1. 内存占用 > 1GB 的进程
echo "=== RSS > 1GB 的进程 ==="
ps aux | awk 'NR>1 && $6 > 1048576 {printf "PID=%-8s RSS=%.1fGB CMD=%s\n", $2, $6/1048576, $11}'
  1. Zombie 进程详情
echo "=== Zombie 进程 ==="
ps aux | awk '$8 ~ /Z/ {print}' || echo "无 zombie 进程"
  1. 负载是否过高(负载 > CPU 核心数视为过高)
cores=$(sysctl -n hw.ncpu)
load=$(sysctl -n vm.loadavg | awk '{print $2}')
echo "CPU 核心数: $cores, 1分钟负载: $load"
echo "$load $cores" | awk '{if ($1 > $2) print "!! 负载过高: "$1" > "$2" 核"; else print "负载正常: "$1" <= "$2" 核"}'

Read the full file on GitHub · 202 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. 8d ago First seen · 202 lines · 35 tokens per session scan A 49a3d633849c

Subscribe to this mod's changes

system-doctor is a skill published in the GitHub repository majiayu000/spellbook (278 stars, last pushed yesterday), licensed MIT. It adds 35 tokens to every session and 1,811 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-09-03.