smart-routing

smart-routing is a skill for Claude Code, Codex from pyworkload/3x-ui-mcp. It costs 90 tokens per session (1,326 once invoked), scanned A, original, MIT.

A routing tool for a 3x-ui panel, which manages Xray proxy connections. It sends traffic to different paths based on domains or geographic labels, blocks selected destinations, and checks that the router applied each rule.

In plain words
What is it for?
Use it to route selected sites through Warp, NordVPN, or PIA, leave local traffic outside the proxy, block unwanted destinations, and verify the resulting rules.
Why use it?
It removes the need to edit routing configuration blindly. It also helps avoid missed domain rules, unsafe rule order, and changes being overwritten by another configuration update.

Skill for Claude CodeCodex

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

Good fit Use it to route selected sites through Warp, NordVPN, or PIA, leave local traffic outside the proxy, block unwanted destinations, and verify the resulting rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pyworkload/3x-ui-mcp/smart-routing
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 pyworkload/3x-ui-mcp --skill smart-routing
Clone the repo
git clone --depth 1 https://github.com/pyworkload/3x-ui-mcp

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 smart-routing

README.md
[![agentmods](https://agentmods.dev/badge/skills/pyworkload/3x-ui-mcp/smart-routing/github.svg)](https://agentmods.dev/skills/pyworkload/3x-ui-mcp/smart-routing)
Your own site
<a href="https://agentmods.dev/skills/pyworkload/3x-ui-mcp/smart-routing"><img src="https://agentmods.dev/badge/skills/pyworkload/3x-ui-mcp/smart-routing/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 smart-routing

Your own site · 80×15
<a href="https://agentmods.dev/skills/pyworkload/3x-ui-mcp/smart-routing"><img src="https://agentmods.dev/badge/skills/pyworkload/3x-ui-mcp/smart-routing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,326 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.00090 $0.01326
Opus 5.5 $0.00036 $0.00530
Sonnet 5.5 $0.00018 $0.00265
Haiku 4.5 $0.00009 $0.00133

Measured 1mo ago against content hash 4c381c89b8fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

smart-routing 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 1mo 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/smart-routing/SKILL.md · 134 lines

How it starts

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

Routing

Routing rules live in the saved Xray template, and every rule tool (add_routing_rule, update_routing_rule, remove_routing_rule) rewrites that whole template read-modify-write. Two consequences: back up before a session of edits, and do not interleave rule edits with update_xray_template, which replaces the document outright and will discard rules added in between.

Before anything else

Sniffing must be enabled on the inbound. Without it the router sees only IP addresses and every domain rule misses — silently, with no error anywhere. The default sniffing this server sends on create_inbound has it on; an inbound created elsewhere may not. Check get_inbound first when domain rules "do nothing".

Rule order is the whole game

get_routing_rules

Rules are evaluated top to bottom and the first match wins. The classic failure is a broad rule above a narrow one — geosite:category-ads above a specific domain:ads.example.com exception means the exception never runs. add_routing_rule appends by default; pass index to place a rule where it will actually be reached.

get_routing_rules also returns the balancer definitions, because a rule's balancerTag is meaningless without them.

Validate geo tokens before saving

geosite: and geoip: tokens that do not exist do not error — they just never match:

validate_geodata_tokens tokens="geosite:category-ads-all,geoip:private" kind="domain"

list_geodata_files, list_geodata_categories and list_geodata_entries browse what the server's databases actually contain, which is the reliable way to find the right category name rather than guessing from a blog post. update_geofile refreshes the databases; stale geo data is a common cause of rules that used to work.

Common shapes

Direct for local traffic, so it never leaves through the proxy:

add_routing_rule rule={"type":"field","outboundTag":"direct","ip":["geoip:private"]} index=0

Block a category:

Read the full file on GitHub · 134 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. 1mo ago First seen · 134 lines · 90 tokens per session scan A 4c381c89b8fd

Subscribe to this mod's changes

smart-routing is a skill published in the GitHub repository pyworkload/3x-ui-mcp (5 stars, last pushed 4d ago), licensed MIT. It adds 90 tokens to every session and 1,326 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-09-05.

Related

Other skills, from other repositories

opik-test

Turn a failing Opik trace (or a described failure) into a repeatable regression check — a test-suite item with the trace's input and one or two binary assertions — so a fix can be verified by the compare skill. Works over the SDK; uses the MCP write tool when connected. Returns the suite, the item, and the assertion.…

comet-ml/opik-mcp · 141 tokens

qmclaw-workbench

A local simulator for superconducting quantum-bit experiments, including measurements used to study and tune a qubit. It produces bounded synthetic results without connecting to laboratory hardware or quantum cloud services.

xi-zhao/OpenQuantum · 124 tokens

cortex-explore-memory

Explore the memory system's state, find gaps in knowledge, assess coverage, and get diagnostic information. Use when the user asks 'what does my memory look like', 'show me memory stats', 'what am I missing', 'how good is my knowledge', 'memory health', 'show coverage', 'find gaps', 'what topics are weak', or when you…

cdeust/Cortex · 91 tokens

quantum-fermi-hubbard-vqe

A variational quantum simulation of the open-boundary Fermi–Hubbard chain, a model of particles hopping between sites and interacting when they occupy the same system. It maps the model to qubits with the Jordan–Wigner transformation and searches for a low-energy state.

xi-zhao/OpenQuantum · 67 tokens

quantum-grover

A Qiskit implementation of Grover's algorithm, a quantum search method that increases the chance of finding a marked item. It can explain the method, build an explicit quantum circuit, or run it with chosen inputs.

xi-zhao/OpenQuantum · 62 tokens

quantum-algorithms

A routing workflow for choosing an open-source quantum-computing algorithm and loading the matching local workflow. Quantum computing uses circuits and quantum states to represent and process information.

xi-zhao/OpenQuantum · 34 tokens