Free/public Clash subscriptions rot fast: the file updates every few hours, but half the nodes are already dead. Downloading the subscription proves nothing — the only question that matters is which nodes actually work right now, from here?
So I built clash-sub-tester: a single-file, stdlib-only Python CLI that
- fetches one or more Clash/Mihomo subscription URLs (or local files) and merges/dedupes nodes by
type + server + port - performs a real HTTP/SOCKS5 handshake plus an actual HTTP request through every node
- ranks nodes by measured latency
- optionally writes a cleaned
clash.yamlcontaining only the nodes that passed, ready to import
Usage:
python3 clash_sub_tester.py "https://example.com/clash.yaml" -o cleaned.yaml Exit code is 0 when at least one node passes, 1 otherwise — handy for cron health checks. Currently supports http and socks5 nodes (with auth); other types are reported as unsupported instead of silently skipped.
Repo: https://github.com/museagent001/clash-sub-tester
It's the first of a weekly series of small tools I'm releasing. Feedback and issues welcome — bug reports with a repro get fixed first.

