Clash 控制器

Clash 控制器 is a skill for Claude Code, Codex from OpenMinis/MinisSkills. It costs 93 tokens per session (2,024 once invoked), scanned A, original, MIT.

A command-line controller for Clash and mihomo, tools that route network traffic through proxies. It connects to their local REST API to inspect status, connections, rules, traffic, and proxy choices.

In plain words
What is it for?
It helps view active connections and traffic, inspect DNS and rules, switch proxy nodes or policy groups, test nodes, and reload configuration.
Why use it?
It avoids manually editing or inspecting a running proxy configuration when you need to check traffic or change the active route.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps view active connections and traffic, inspect DNS and rules, switch proxy nodes or policy groups, test nodes, and reload configuration.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/openminis/minisskills/clash-controller
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 OpenMinis/MinisSkills --skill clash-controller
Clone the repo
git clone --depth 1 https://github.com/OpenMinis/MinisSkills

Made for: Claude Code, Codex.

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 Clash 控制器

README.md
[![agentmods](https://agentmods.dev/badge/skills/openminis/minisskills/clash-controller/github.svg)](https://agentmods.dev/skills/openminis/minisskills/clash-controller)
Your own site
<a href="https://agentmods.dev/skills/openminis/minisskills/clash-controller"><img src="https://agentmods.dev/badge/skills/openminis/minisskills/clash-controller/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 Clash 控制器

Your own site · 80×15
<a href="https://agentmods.dev/skills/openminis/minisskills/clash-controller"><img src="https://agentmods.dev/badge/skills/openminis/minisskills/clash-controller.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,024 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.
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.00093 $0.02024
Opus 5.5 $0.00037 $0.00810
Sonnet 5.5 $0.00019 $0.00405
Haiku 4.5 $0.00009 $0.00202

Measured 14d ago against content hash 92d8d1357d81, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

Clash 控制器 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 14d 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.

clash-controller/SKILL.md · 132 lines

How it starts

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

Clash 控制器(Clash / mihomo RESTful API)

通过 clash-cli(封装 Clash RESTful API)在 Minis 内实时监控和控制 Clash / Mihomo。Clash 配置语法请参考官方文档,本文档只管运行态操作。

1. 入口授权(前提检查)

  • Clash 必须正在运行(VPN / 代理开启),external-controller 才会监听端口。未启动时 clash-cli 报「连接失败」。
  • 默认 API 地址 http://127.0.0.1:9090(本机 localhost)。
  • secret 从环境变量 CLASH_SECRET 读取;未设置则免认证直接访问。
  • 入口检查:clash-cli status 能返回版本、模式、内存、策略组即通过。
clash-cli status
# mihomo 1.19.32  meta=True
# mode=rule  mixed-port=7890  tun=True stack=gVisor
# 内存 31MB  inuse=0KB
# 策略组 13 个:
#   PROXY → AUTO

2. 状态检查

命令 说明
clash-cli status 版本/模式/内存 + 所有策略组当前选择
clash-cli proxies 列全部代理条目(含叶子节点与策略组)
clash-cli proxies <组> 查看某策略组当前选择、类型、成员列表
clash-cli traffic [秒] 实时流量 SSE(默认 3 秒,显示瞬时速率+累计)
clash-cli connections [N] 活跃连接列表(host→策略组→命中规则→上下行),默认前 20
clash-cli configs 当前运行配置(端口/tun/dns 等)
clash-cli rules [N] 规则列表(默认前 10)

3. 常用任务

  • 查当前选中节点:clash-cli proxy get <组>(如 PROXY)
  • 切换节点/策略:clash-cli proxy set <组> <节点>(组内任意成员名,含 DIRECT)
    clash-cli proxy set PROXY DIRECT    # 直连
    clash-cli proxy set PROXY AUTO      # 切回自动测速组
    
  • 节点测速:clash-cli test <节点名> [url] [timeout_ms];对组内全部节点测速 clash-cli grouptest <组名> [url] [timeout_ms]
  • DNS 查询:clash-cli dns query <域名> [type](走 mihomo 内部 DNS,返回 Answer 数组)
  • 日志:clash-cli logs [秒数] [level](SSE,默认 3 秒)
  • 规则命中分析:mihomo 无 rule match 端点,看每连接命中规则用 clash-cli connections(最后一列显示匹配的规则名)

4. 影响边界(写操作)

  • 写操作:proxy set、conn close <id|all>、reload、PATCH /configs 会改变运行状态,执行前先确认目标名存在(proxy get)。
  • conn close all 会断开全部连接(SSH/下载会被打断)。
  • reload 重载配置可能导致短暂断线,配置改动应先备份再 reload。
  • 若配置文件含节点订阅密码等敏感信息,务必只备份到私有仓库,绝不推公共仓库。

5. 环境与安全注意事项

  • external-controller 默认绑定 127.0.0.1 即可本地访问。
  • 勿改 0.0.0.0 绑定(allow-lan: true 且无 secret 时,局域网内可被访问,有风险)。如确需远程访问,务必设置 secret。
  • 环境变量:CLASH_API(默认 http://127.0.0.1:9090)、CLASH_SECRET、CLASH_TIMEOUT(默认 8 秒)。
  • 切换节点时节点名必须与策略组成员精确匹配(含空格/emoji/特殊字符,如「🇭🇰香港trojan1」)。
  • 实测确认:mihomo 的 /traffic、/memory 是裸 JSON 流(无 data: 前缀),/logs 为标准 SSE,解析需兼容两种格式。

Read the full file on GitHub · 132 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 14d ago First seen · 132 lines · 93 tokens per session scan A 92d8d1357d81

Subscribe to this mod's changes

Clash 控制器 is a skill published in the GitHub repository OpenMinis/MinisSkills (502 stars, last pushed 2d ago), licensed MIT. It adds 93 tokens to every session and 2,024 once invoked, about $0.0004 per session on Opus 5.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-10-06.

Related

Other skills, from other repositories

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Optimize the meaningful UI available immediately from a Next.js route on an initial load (hard navigation) or named client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route and entry point at a time; the shipped test then guards…

vercel/next.js · 123 tokens