by zemul
AI agent skill for deep Wi-Fi troubleshooting on macOS/Windows: read-only diagnostics, root-cause channel/width/AWDL/VPN issues, minimal fixes with before/after retest. Wi-Fi 深度排查与优化 Skill
Available after the catalog security scan passes.
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM lists this project for discovery and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
# Add to your Claude Code skills
git clone https://github.com/zemul/wifi-optimizerGuides for using ai agents skills like wifi-optimizer.
你是一名网络排障工程师。目标:用可复现的数据找出 Wi-Fi 卡顿/延迟尖峰/丢包的根因,给出最小改动的优化方案,并用同口径复测证明效果。
sudo、改路由器设置、改网卡高级属性、关闭接口),都必须先向用户说明「做什么、为什么、副作用、怎么回滚」,得到明确同意后才执行,或交给用户自己操作。max、stddev、p95 和 >30ms 尖峰次数。avg 3ms、max 300ms 的网络打游戏一样卡。诊断必须在「连着有问题的那个 Wi-Fi」时进行,否则数据全是错的。先检查:
system_profiler SPAirPortDataType 里有 Current Network Information,说明已连接;再用 route -n get default 看默认路由的 interface 是不是 Wi-Fi 网卡(通常是 en0)。netsh wlan show interfaces 里的 State 要是 connected;再用 Get-NetRoute -DestinationPrefix 0.0.0.0/0 看默认路由是不是走 WLAN 网卡。遇到下面几种情况先处理,再继续:
直接在用户的终端里运行下面的只读命令(都是查询类命令和 ping,不需要 sudo / 管理员)。<网关> 先用路由表查出来(macOS:route -n get default;Windows:ipconfig 里的默认网关)。网关屏蔽 ICMP 时,换成同网段另一台常在线的设备。
macOS
system_profiler SPHardwareDataType # 机型 / 芯片(只看 Model、Chip,不要外发序列号和 UUID)
system_profiler SPAirPortDataType # PHY Mode、Channel(频段+频宽)、Country Code、Signal/Noise、Transmit Rate、MCS;Supported Channels;Other Local Wi-Fi Networks = 周边频谱
ifconfig awdl0 # status: active 表示 AirDrop / 接力 / 隔空播放在工作
ifconfig llw0
ping -c 40 -i 0.1 <网关> # 高频网关 ping:看 max、stddev、尖峰 icmp_seq
ping -c 10 -D -s 1472 -i 0.2 <网关> # 1472B 不分片大包
netstat -rn # 默认路由是否走 utun*(VPN / TUN 代理)
scutil --dns # DNS 是否被代理接管
Windows(PowerShell)
netsh wlan show interfaces # 无线电类型、频段、信道、信号、收发速率
netsh wlan show networks mode=bssid # 周边 BSSID 与信道(Win11 新版可能要开定位权限)
netsh wlan show drivers # 支持的无线电类型
Get-NetAdapter -Physical # 网卡型号与链路速率
ping -n 40 <网关> # 间隔 1s,尖峰会被稀释,必要时多跑几轮
ping -n 10 -f -l 1472 <网关> # 1472B 不分片大包
需要更多信息时再补充只读命令:scutil --proxy、route print -4、Get-DnsClientServerAddress、Get-NetAdapterAdvancedProperty -Name "WLAN"(频宽、首选频段、漫游积极性)。
隐私: 输出里含真实 SSID、MAC/BSSID、IP。你在回复中引用时一律打码(SSID → <SSID-1>,MAC → xx:xx:xx:xx:xx:xx,网关 → 192.168.x.1),并提醒用户:分享或贴到公开场合前,先把 MAC 和 SSID 打码。
逐条对照,写出「证据 → 结论」:
ifconfig awdl0 显示 active 即在工作。社交信道 CN 区常为 149,其它地区常见 6 / 44 / 149;主网络本身在 149 时冲突明显减轻。Get-NetAdapter -IncludeHidden | Where-Object InterfaceDescription -like '*Wi-Fi Direct*',看 Microsoft Wi-Fi Direct Virtual Adapter 是否 Up。system_profiler SPAirPortDataType、netsh wlan show networks)会让网卡短暂离开信道。ping 测试时不要同时跑扫描命令,也别同时开 Wi-Fi 扫描类 App。有路由器权限时
没有路由器权限时(校园网 / 合租 / 公司)—— 只能在本机兜底
需要用户确认的操作(务必先解释副作用)
sudo ifconfig awdl0 down:
sudo ifconfig awdl0 up 或重启。同口径 = 同一台设备、同一位置(别挪动)、同样的命令和次数、相近时段。改动后把第 2 步的命令原样再跑一遍,填下表。没改善就回滚,换下一个假设,不要叠加多个改动。表内不要填真实 SSID / MAC / IP,网关统一写 192.168.x.1。
| 项目 | 测法 | 优化前 | 优化后 | 结论 |
|---|---|---|---|---|
| 信道 / 频宽 | 系统信息 / netsh | |||
| PHY / 速率 | 系统信息 / netsh | |||
| RSSI / 噪声 / SNR | 系统信息 | |||
| 网关 ping avg | 40 次,0.1s 间隔 | |||
| 网关 ping max | 同上 | |||
| 网关 ping stddev | 同上 | |||
| >30ms 尖峰次数 | 同上 | |||
| 丢包 | 同上 | |||
| 1472B 不分片大包 | 10 次,0.2s 间隔 | |||
| 外网(可选) | 例如 ping 一个公共 DNS / 测速站 |
同时写清本次改动(逐条,便于回滚)和回滚方法。
最终回复给用户:
See how wifi-optimizer compares with popular alternatives.
English | 简体中文
Let your AI agent (Claude Code / Codex / OpenClaw, etc.) troubleshoot Wi-Fi like a network engineer: collect data read-only first, then pin down the root cause, then fix it with the smallest change, and prove the result with a like-for-like retest.
Good for: latency spikes in games or video calls, laggy remote desktop, full signal bars but slow speeds, occasional drops, or not knowing which channel and width to set on your router.
Send this to your AI agent (Claude Code / Codex / OpenClaw, etc.):
Follow https://raw.githubusercontent.com/zemul/wifi-optimizer/main/SKILL.md to troubleshoot and optimize my Wi-Fi
To keep it as a skill, ask the agent to save the file into its skills directory (e.g. ~/.claude/skills/wifi-optimizer/SKILL.md).
One real troubleshooting run (MacBook + Xiaomi router, 5GHz): the router's "auto" mode picked channel 48 at 160MHz, colliding with a strong -52 dBm 160MHz neighbor, while macOS AWDL periodically hopped to channel 149. Gateway ping showed a 50–92 ms spike roughly every 0.5s. After pinning the router to channel 149 · 80MHz, a like-for-like retest (40 gateway pings × 0.1s):
| Metric | Before (auto 48 · 160MHz) | After (fixed 149 · 80MHz) | Change |
|---|---|---|---|
| Gateway ping avg | 22.62 ms | 2.77 ms | ↓ 87.8% |
| Gateway ping max | 92.47 ms | 4.02 ms | ↓ 95.7% |
| Jitter (stddev) | 31.26 ms | 0.50 ms | ↓ 98.4% |
| Noise / SNR | -87 dBm / SNR 30 dB | -92 dBm / SNR 38 dB | SNR +8 dB |
Before: spectrum conflict and periodic latency spikes

Before vs. after

Your network will differ; this is a single real measurement, for reference only.
<SSID-n>, MAC → xx:xx:xx:xx:xx:xx, gateway → 192.168.x.1).sudo ifconfig awdl0 down, etc.) the skill requires the agent to explain the impact and how to roll back, and get your explicit consent; we suggest you run anything needing sudo or the router admin page yourself.If this saved you some debugging time, you can optionally buy me a coffee on Ko-fi.
wifi-optimizer is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by zemul. AI agent skill for deep Wi-Fi troubleshooting on macOS/Windows: read-only diagnostics, root-cause channel/width/AWDL/VPN issues, minimal fixes with before/after retest. Wi-Fi 深度排查与优化 Skill. It has 59 GitHub stars.
wifi-optimizer's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/zemul/wifi-optimizer" and add it to your Claude Code skills directory (see the Installation section above). wifi-optimizer ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh wifi-optimizer against similar tools.
No comments yet. Be the first to share your thoughts!