rustdesk-doctor

rustdesk-doctor is a skill for Claude Code from majiayu000/spellbook. It costs 32 tokens per session (3,053 once invoked), scanned C, original, MIT.

A troubleshooting procedure for RustDesk, a remote-desktop application, when connections fail or the client cannot register or show an ID.

In plain words
What is it for?
It checks running processes, network connections, configuration files, logs, and possible Clash or TUN proxy interference.
Why use it?
It narrows down whether the problem comes from the client, proxy settings, server configuration, or network security rules.

Skill for Claude Code

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

Good fit It checks running processes, network connections, configuration files, logs, and possible Clash or TUN proxy interference.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/majiayu000/spellbook/rustdesk-doctor"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/rustdesk-doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,053 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. 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.00032 $0.03053
Opus 5 $0.00016 $0.01527
Sonnet 5 $0.00006 $0.00611
Haiku 4.5 $0.00003 $0.00305

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

Security

Grade C, and why

rustdesk-doctor scanned grade C with 2 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -s --unix-socket "$SOCKET" http://localhost/connections 2>/dev/null | python3 -c "

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s --unix-socket "$SOCKET" http://localhost/connections 2>/dev/null | python3 -c "
skills/rustdesk-doctor/SKILL.md · 288 lines

How it starts

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

RustDesk 连接诊断工具

诊断 RustDesk 客户端无法连接服务器的问题,覆盖 Clash/TUN 代理干扰、服务器端配置、云安全组等常见根因。

用户传入的参数(如有):$ARGUMENTS

诊断流程

严格按以下步骤执行,每一步都要执行并记录结果,最后给出综合诊断。

第一步:采集客户端状态

并行执行以下检查:

  1. RustDesk 进程和网络连接
ps aux | grep -i rustdesk | grep -v grep
echo "=== 网络连接 ==="
lsof -i -P -n 2>/dev/null | grep -i rustdesk
  1. RustDesk 配置文件
CONFIG_DIR="$HOME/Library/Preferences/com.carriez.RustDesk"
echo "=== RustDesk2.toml ==="
cat "$CONFIG_DIR/RustDesk2.toml" 2>/dev/null || echo "文件不存在"
echo "=== RustDesk_local.toml ==="
cat "$CONFIG_DIR/RustDesk_local.toml" 2>/dev/null || echo "文件不存在"
  1. RustDesk 最新日志(关键行)
LOG="$HOME/Library/Logs/RustDesk/RustDesk_rCURRENT.log"
cat "$LOG" 2>/dev/null || echo "日志不存在"

第二步:检查 Clash/代理干扰

并行执行以下检查:

  1. Mihomo 中 RustDesk 的连接和规则匹配
SOCKET="/var/tmp/verge/verge-mihomo.sock"
if [ -S "$SOCKET" ]; then
  curl -s --unix-socket "$SOCKET" http://localhost/connections 2>/dev/null | python3 -c "
import sys,json
data=json.load(sys.stdin)
conns=data.get('connections',[])
found=False
for c in conns:
    meta=c.get('metadata',{})
    proc=meta.get('process','').lower()
    host=meta.get('host','').lower()
    dst=meta.get('destinationIP','')
    if 'rustdesk' in proc or 'rustdesk' in host or '21116' in meta.get('destinationPort','') or '21115' in meta.get('destinationPort',''):
        chains=c.get('chains',[])
        rule=c.get('rule','')
        rp=c.get('rulePayload','')
        net=meta.get('network','')
        dp=meta.get('destinationPort','')
        print(f'{meta.get(\"process\",\"\")} | {net} | {host or dst}:{dp} | rule={rule} {rp} | chains={chains}')
        found=True
if not found:
    print('Mihomo 中没有 RustDesk 相关连接')
"
else
  echo "Mihomo unix socket 不存在,Clash 可能未运行"
fi
  1. Mihomo 中 RustDesk 相关规则
SOCKET="/var/tmp/verge/verge-mihomo.sock"
if [ -S "$SOCKET" ]; then
  curl -s --unix-socket "$SOCKET" http://localhost/rules 2>/dev/null | python3 -c "
import sys,json
rules=json.load(sys.stdin).get('rules',[])
for r in rules:
    p=str(r.get('payload','')).lower()
    if 'rustdesk' in p:
        print(f\"{r.get('type')},{r.get('payload')},{r.get('proxy')}\")
" || echo "无法获取规则"
  echo "=== TUN 配置 ==="
  curl -s --unix-socket "$SOCKET" http://localhost/configs 2>/dev/null | python3 -c "
import sys,json
c=json.load(sys.stdin)
tun=c.get('tun',{})
print('TUN enabled:', tun.get('enable'))
rea=tun.get('route-exclude-address',[])
if rea:
    print('route-exclude-address:', rea)
"
fi

Read the full file on GitHub · 288 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 · 288 lines · 32 tokens per session scan C 46af9382fc32

Subscribe to this mod's changes

rustdesk-doctor is a skill published in the GitHub repository majiayu000/spellbook (278 stars, last pushed today), licensed MIT. It adds 32 tokens to every session and 3,053 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.