Rule-Based Routing Engine
The rule section matches every connection from top to bottom: domain suffixes, full domain names, destination IP ranges, process names, and other conditions can all serve as matching criteria. A match triggers the corresponding policy, and unmatched connections fall through to the MATCH rule at the end. Rule sets (RULE-SET) support external file references with scheduled updates, so common geo and domain lists don't need manual upkeep.
The routing outcome decides whether a connection goes through a proxy group or a direct connection. Combined with automatic latency testing and failover within proxy groups, this keeps the link usable without manual intervention. Custom rule syntax and priority rules are covered in this site's guides and technical notes.
The core problem it solves is letting different traffic take different paths: internal company domains go direct, streaming services stick to a specific regional node, and ad domains get rejected outright. Such fine-grained policies only need a few custom entries inserted at the top of the rule section, leaving the rest of the subscription untouched. Rule matching overhead is tiny — even thousands of rules won't become a bottleneck — which is the clearest difference between Clash-family clients and proxy tools that offer nothing but a simple on/off switch.