3x-ui-setup

3x-ui-setup is a skill for Claude Code from AndyShaman/3x-ui-skill. It costs 134 tokens per session (5,125 once invoked), scanned D, original, MIT.

A procedure for turning a fresh VPS, meaning a rented internet server, into a 3x-ui Xray VPN server. It sets up two VLESS+Reality connection profiles, combines them in one subscription link, and connects them through the Happ client.

In plain words
What is it for?
Use it to configure SSH protection, firewall and kernel settings, fail2ban, BBR, two VPN connection types, the subscription server, and Happ client access.
Why use it?
It covers server hardening and client setup in one workflow, while explaining limits such as networks where a foreign VPS cannot bypass restrictions.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code.

Not installable on its own: it runs a file from its repository that does not travel with it. Clone the repository, or install whatever ships that file. The line is ssh root@{SERVER_IP} "curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh -o /tmp/3x-ui-install.sh && echo 'n' | bash /tmp/3x-ui-install.

Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

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 3x-ui-setup

README.md
[![agentmods](https://agentmods.dev/badge/skills/andyshaman/3x-ui-skill/skill.svg)](https://agentmods.dev/skills/andyshaman/3x-ui-skill/skill)
Your own site
<a href="https://agentmods.dev/skills/andyshaman/3x-ui-skill/skill"><img src="https://agentmods.dev/badge/skills/andyshaman/3x-ui-skill/skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 134 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,125 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 5 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.00134 $0.05125
Opus 5 $0.00067 $0.02563
Sonnet 5 $0.00027 $0.01025
Haiku 4.5 $0.00013 $0.00513

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

Security

Grade D, and why

3x-ui-setup scanned grade D with 5 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.

Enumerates the file system for secretsmediumData exfiltration

Searching home directories for .env, .ssh, .aws or credential files is reconnaissance for credential theft.

ls -la /home/{username}/.ssh/ && cat /home/{username}/.ssh/authorized_keys

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Asks for rootlowPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

→ create non-root user + sudo → install key (user AND root)

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Reaches for credential filesmediumPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

echo "{PUBLIC_KEY_CONTENT}" > /home/{username}/.ssh/authorized_keys

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Downloads and executes remote codemediumSupply chain

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

ssh root@{SERVER_IP} "curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh -o /tmp/3x-ui-install.sh && echo 'n' | bash /tmp/3x-ui-install.sh"

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

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

**Local mode — ask for:** username, nickname, domain (recommend "no"). Get the IP automatically: `curl -4 -s ifconfig.me`.
skill/SKILL.md · 378 lines

How it starts

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

VPN Server Setup (3x-ui)

Fresh VPS from a provider → hardened server → working VPN (two VLESS+Reality profiles in one subscription) → Happ client. Built and tuned for the RU 2026 DPI landscape.

What this builds

  • Primary inbound: VLESS + XHTTP + Reality on port 443 — best DPI resistance (hides both the TLS handshake and post-handshake behaviour).
  • Fallback inbound: VLESS + TCP + Reality + Vision + padding on port 8443 — required for iOS (XHTTP+Reality is broken on Happ iOS) and adds detection diversity.
  • One subscription link serving both, imported once into Happ.
  • Server hardened: non-root user, key-only SSH, UFW, kernel sysctl, fail2ban, BBR, no ICMP.

Read references/whitelist-and-fallbacks.md early to set honest expectations — on mobile networks in whitelist regions a foreign VPS cannot help, and that must be communicated up front.

Reference map (progressive disclosure)

File When
references/reality-inbound.md Part 2 — create both Reality inbounds
references/subscription.md Part 2 — subscription server + LE cert on IP + panel tunnel
references/client-happ.md Part 2 — install Happ, import, connect, troubleshoot
references/finalize-hardening.md Final step — fail2ban + SSH lockdown (key-verify gate)
references/guide-template.md Final step — the personal guide file + secrets policy
references/whitelist-and-fallbacks.md Expectations + fallback ladder + SNI pool + Hysteria2 next step
references/local-mode.md If Claude Code runs ON the VPS
references/vless-tls.md Optional: domain-based VLESS+TLS instead of Reality
references/fallback-nginx.md Optional: benign stub site behind VLESS+TLS

Workflow overview

PART 1 — Server hardening
  Fresh VPS (IP + root password)
    → mode (remote/local) → SSH key → connect as root → update
    → create non-root user + sudo → install key (user AND root)
    → TEST key login (critical) → UFW → kernel sysctl → packages
    → local ~/.ssh/config → ✅ server secured
PART 2 — VPN
    → install 3x-ui → detect panel scheme → BBR → disable ICMP
    → two Reality inbounds (reality-inbound.md)
    → subscription + cert (subscription.md)
    → Happ (client-happ.md) → verify
    → guide file (guide-template.md)
    → fail2ban + SSH lockdown LAST, after key verified (finalize-hardening.md)
    → ✅ VPN working

Read the full file on GitHub · 378 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 · 378 lines · 134 tokens per session scan D c5e4d3e4c21a

Subscribe to this mod's changes

3x-ui-setup is a skill published in the GitHub repository AndyShaman/3x-ui-skill (52 stars, last pushed 1mo ago), licensed MIT. It adds 134 tokens to every session and 5,125 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it D with 5 findings (enumerates the file system for secrets, asks for root, reaches for credential files). 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

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

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

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 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

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