User Guide / Rules & Routing

Appending rules to a subscription with Mixin (without editing it)

Rules & Routing · Updated 2026-01-26 · ~2 min read

Editing the subscription-generated YAML is the classic beginner trap — the next auto-update wipes your changes. Clash for Windows' Mixin is a patch layered over every profile: the subscription updates freely, the patch persists.

Steps

  1. Open Settings, find Profile Mixin, click Edit next to YAML;
  2. Write what you want to add or override — e.g. two high-priority rules:
mixin:
  rules:
    - DOMAIN-SUFFIX,example-bank.com,DIRECT
    - DOMAIN-KEYWORD,tracker,REJECT
  1. Save, then flip the Mixin enable switch on (the step everyone forgets);
  2. Re-select the active profile on the Profiles page to reload, then verify on the Connections page.

Caveat

In YAML mode the rules field replaces the original wholesale — write two rules and two rules is all you have. To "insert before the originals" you need JavaScript mode, which can concatenate with the existing rules; templates and syntax in "Mixin basics: YAML vs JavaScript". For anything rule-related, most people go straight to the JS template once and are done.