Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Safely diagnose and improve local network speed, latency, jitter, DNS, Wi-Fi, Ethernet, macOS network services, and bufferbloat. Use this skill whenever the user asks to optimize internet/network speed, make the network faster, diagnose slow Wi-Fi, latency, packet loss, DNS delay, unstable Codex/AI tool connectivity, or asks about the viral Codex network optimization workflow. Always protect VPN/proxy tools such as Clash Verge, Mihomo, Shadowrocket, Tailscale, V2Ray, Surge, and corporate VPNs; d
.claude/skills/majiayu000-optimize-network/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-12 | ✗→✓ | ▲ Improved | 147% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 120% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 115% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 103% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 104% | 0% |
Use this skill to run a safe, evidence-first network optimization workflow. The default posture is read-only diagnosis, then small reversible experiments, then before/after verification. Never treat VPN, proxy, TUN, or routing tools as junk processes.
Follow these rules before any command that could affect connectivity:
sudo, interface down/up, DHCP reset, route change, or network service disable must be confirmed by the user first.Choose one mode and state it briefly:
execute_direct: read-only diagnosis, report generation, or a user-approved reversible command.plan_first: multi-step optimization, DNS change, service-order change, AWDL/AirDrop test, or anything that may affect connectivity.clarify_first: OS is unknown, user is remote over the network, proxy/VPN ownership is unclear, or the requested change would modify VPN/proxy/TUN state.Use these handoff fields in the report: goal, context, constraints, actions, evidence, decision, rollback, next step.
Prefer fresh local measurements over assumptions:
scutil --nwi, scutil --dns, scutil --proxy, route -n get default.networkQuality -v and, when available, speedtest-cli.dig +tries=1 +time=2 +stats against relevant domains.nettop, lsof, Mihomo read-only connections API when present.Do not claim improvement from a single noisy datapoint. Call out variance when results are mixed.
Identify the operating system and active path:
bashuname -a sw_vers 2>/dev/null || true command -v networkQuality || true command -v speedtest-cli || true command -v speedtest || true scutil --nwi 2>/dev/null || true scutil --proxy 2>/dev/null || true
If macOS is detected, prefer the bundled read-only snapshot helper:
bash~/.claude/skills/optimize-network/scripts/macos_network_snapshot.sh
Run the bandwidth/responsiveness portion only when the user is ready for a bandwidth-consuming test:
bashRUN_NETWORKQUALITY=1 ~/.claude/skills/optimize-network/scripts/macos_network_snapshot.sh
If testing from a local Codex skill copy instead of an installed Spellbook copy, use the equivalent path under ~/.agents/skills/optimize-network/scripts/.
Record:
networkQuality -v or speedtest-cli download/upload/latency.dig timing for user-relevant domains.Limit the finding list to the most likely 3-4 bottlenecks. Common categories:
networkQuality.Separate confirmed facts from hypotheses.
Only apply a change after explaining risk and rollback.
DNS A/B test
Use when DNS lookup is repeatedly slow or inconsistent. Save current DNS first:
bashnetworksetup -getdnsservers Wi-Fi
Candidate examples for China mainland networks: 223.5.5.5, 119.29.29.29, 114.114.114.114. Test by setting, flushing cache, repeating dig and curl -w, then keep only if it clearly improves results. Roll back with the saved DNS:
bashnetworksetup -setdnsservers Wi-Fi <saved-dns...> dscacheutil -flushcache
Network service order
Use when inactive adapters are above the real interface and route evidence suggests confusion. First show the current order:
bashnetworksetup -listnetworkserviceorder
Propose the exact new order. Preserve VPN/proxy services and do not remove them. Apply only after confirmation:
bashnetworksetup -ordernetworkservices "<primary>" "<secondary>" "<other-services...>"
Unused service disable
Use only for clearly unused physical/virtual adapters, and prefer disable over delete. Never disable VPN/proxy/TUN services by default. Show:
bashnetworksetup -listallnetworkservices
Apply only after confirmation:
bashnetworksetup -setnetworkserviceenabled "<service-name>" off
Rollback:
bashnetworksetup -setnetworkserviceenabled "<service-name>" on
AWDL/AirDrop A/B test
Use when Wi-Fi signal is strong but gateway ping has periodic spikes. This may affect AirDrop, AirPlay, Handoff, Universal Control, and Apple Watch unlock. It usually requires sudo, so confirm first.
Test window:
bashsudo ifconfig awdl0 down ping -c 30 <gateway> sudo ifconfig awdl0 up
Do not leave awdl0 down unless the user explicitly wants that tradeoff.
mDNS/DNS cache refresh
Use when local name resolution or stale DNS is suspected. dscacheutil -flushcache is low risk. mDNSResponder restart needs confirmation if sudo is required:
bashdscacheutil -flushcache sudo killall -HUP mDNSResponder
Background traffic
Report top talkers from nettop or lsof. Do not kill processes. Suggest the user pause sync/download/remote desktop apps or ask for confirmation before closing anything.
Bufferbloat / SQM
If loaded latency is high while bandwidth is adequate, local macOS tweaks are unlikely to fix the root cause. Recommend router-side SQM/CAKE/FQ-CoDel if available, with upload/download shaping at roughly 85-90% of measured stable throughput. Treat this as manual router work unless the user explicitly asks for router configuration.
Proxy path optimization
If Clash/Mihomo is active, inspect read-only state before proposing changes:
bashcurl -s --max-time 2 --unix-socket /tmp/verge/verge-mihomo.sock http://localhost/connections curl -s --max-time 2 --unix-socket /tmp/verge/verge-mihomo.sock http://localhost/configs
Summarize only the fields needed for diagnosis. Do not paste raw /configs, full proxy definitions, provider URLs, auth material, or full connection host lists into a public report. Do not change proxy groups, TUN, rules, DNS hijack, or route exclusions from this skill unless the user explicitly asks. If a proxy-specific fix is needed and a clash-doctor or clash-routes skill exists, use that skill or hand off to it.
Repeat the baseline commands after each accepted change. Compare:
chatgpt.com, api.openai.com, GitHub, package registries, or the user's work domains.If results are mixed, revert the change unless the user prefers the tradeoff.
Use this structure:
markdown**Routing** Mode: execute_direct | plan_first | clarify_first Goal: Constraints: **Baseline** - Path: direct | system proxy | TUN | unknown - Download/upload: - Idle latency: - Loaded latency/responsiveness: - Gateway ping: - DNS: - Wi-Fi/Ethernet: **Findings** 1. [Evidence-backed bottleneck] 2. [Evidence-backed bottleneck] 3. [Evidence-backed bottleneck] **Actions** - Done: - Skipped: - Proposed: - Rollback: **After** - Same metrics as baseline. - Delta: **Decision** - Keep/revert/no change: - Remaining risks: - Next step:
Before finalizing, ensure:
Use these prompts when evaluating the skill manually:
Structured eval cases live in evals/evals.json; use them when checking that proxy-safe routing, rollback language, and before/after evidence stay intact.
v1.0 - 2026-05-24 - Initial proxy-safe Codex network optimization workflow based on the viral Codex network optimization pattern and local macOS/Clash diagnostic lessons.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-12 | fail→pass | 10,750 | 8,185 | -24% | 1 | 1 | 0% | 1,520 | 3,759 | +147% | 0 | 0 | — |
case-13 | fail→pass | 10,722 | 7,785 | -27% | 1 | 1 | 0% | 1,818 | 4,004 | +120% | 0 | 0 | — |
case-01 | fail→fail | 16,618 | 15,690 | -6% | 1 | 1 | 0% | 2,803 | 3,154 | +13% | 0 | 0 | — |
case-02 | fail→fail | 21,628 | 9,772 | -55% | 1 | 1 | 0% | 3,817 | 3,531 | -7% | 0 | 0 | — |
case-03 | fail→fail | 24,298 | 9,850 | -59% | 1 | 1 | 0% | 4,353 | 3,330 | -24% | 0 | 0 | — |
case-04 | fail→fail | 15,254 | 8,771 | -43% | 1 | 1 | 0% | 2,479 | 3,208 | +29% | 0 | 0 | — |
case-05 | fail→fail | 10,555 | 7,449 | -29% | 1 | 1 | 0% | 1,653 | 3,147 | +90% | 0 | 0 | — |
case-06 | fail→pass | 13,203 | 9,496 | -28% | 1 | 1 | 0% | 1,899 | 4,083 | +115% | 0 | 0 | — |
case-07 | fail→fail | 14,672 | 8,735 | -40% | 1 | 1 | 0% | 2,247 | 3,199 | +42% | 0 | 0 | — |
case-08 | fail→fail | 9,177 | 9,423 | +3% | 1 | 1 | 0% | 1,358 | 3,167 | +133% | 0 | 0 | — |
case-09 | pass→fail | 14,571 | 11,752 | -19% | 1 | 1 | 0% | 2,256 | 3,326 | +47% | 0 | 0 | — |
case-10 | fail→pass | 14,437 | 12,903 | -11% | 1 | 1 | 0% | 2,262 | 4,603 | +103% | 0 | 0 | — |
case-11 | fail→pass | 10,168 | 4,346 | -57% | 1 | 1 | 0% | 1,633 | 3,336 | +104% | 0 | 0 | — |
case-14 | fail→fail | 11,155 | 10,694 | -4% | 1 | 1 | 0% | 1,851 | 3,251 | +76% | 0 | 0 | — |
case-15 | fail→pass | 16,737 | 11,075 | -34% | 1 | 1 | 0% | 2,136 | 4,434 | +108% | 0 | 0 | — |
case-16 | fail→fail | 4,227 | 12,586 | +198% | 1 | 1 | 0% | 574 | 3,655 | +537% | 0 | 0 | — |
case-17 | fail→pass | 9,774 | 4,199 | -57% | 1 | 1 | 0% | 1,247 | 3,297 | +164% | 0 | 0 | — |
case-18 | fail→pass | 14,439 | 4,791 | -67% | 1 | 1 | 0% | 1,943 | 3,433 | +77% | 0 | 0 | — |
case-19 | fail→pass | 14,708 | 6,057 | -59% | 1 | 1 | 0% | 2,306 | 3,619 | +57% | 0 | 0 | — |
case-20 | fail→pass | 12,180 | 12,308 | +1% | 1 | 1 | 0% | 1,804 | 3,393 | +88% | 0 | 0 | — |
case-21 | pass→pass | 9,344 | 8,652 | -7% | 1 | 1 | 0% | 1,593 | 4,079 | +156% | 0 | 0 | — |
case-22 | pass→pass | 13,187 | 13,933 | +6% | 1 | 1 | 0% | 2,127 | 4,835 | +127% | 0 | 0 | — |
case-23 | pass→pass | 11,768 | 8,024 | -32% | 1 | 1 | 0% | 1,633 | 3,983 | +144% | 0 | 0 | — |
case-24 | pass→pass | 10,218 | 9,336 | -9% | 1 | 1 | 0% | 1,645 | 4,047 | +146% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted, and 14 counted toward the lift figure. The other 10 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +38 percentage points is the difference between those two pass rates over the 14 comparable cases. 9 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.