Where Is the Clash Config File?
Clash reads config.yaml from a .config/clash folder at home, overridable with the -d flag.
Last updated
Classic Clash keeps one file: config.yaml inside ~/.config/clash on macOS and Linux (%USERPROFILE%\.config\clash on Windows). Proxies, groups, rules, DNS, and TUN settings all live there. The -d flag points the binary at any other directory, and Country.mmdb sits beside the config for GEOIP rules.
GUI forks (Verge, Clash for Windows, Meta/Mihomo cores) layer their own profile management on top. They may store effective configs elsewhere and regenerate this file. When hand edits vanish, the GUI profile is the author. Note the core project itself is archived; forks keep the paths.
Where Clash stores this, by platform
~/.config/clash/config.yaml
config.yaml plus Country.mmdb. -d relocates. GUI clients may manage this file; check profiles when edits vanish.
~/.config/clash/config.yaml
Same file and -d behavior. Systemd service setups conventionally use /etc/clash instead.
%USERPROFILE%\.config\clash\config.yaml
Same role under your profile. Clash for Windows exposes it via Open Clash Home Folder on the General page.
Frequently asked questions
How do I run Clash with a different config directory?
Pass -d with a directory, or point your GUI client at a managed profile instead. Service installs commonly use /etc/clash with a systemd unit starting the binary with -d /etc/clash.
My GUI client keeps overwriting config.yaml. Why?
Use the managed-profile features of Verge or similar clients rather than hand-editing the core file. GUI profiles overlay subscriptions and selections atop config.yaml, so manual edits underneath get clobbered.
Notice an outdated path? Let us know.