Skip to content

General configuration ​

Write global settings at the YAML top level. This fragment enables rule routing and persists policy selections and Fake IP mappings. Combine it with nodes, groups, DNS, and rules.

yaml
mode: rule
log-level: info
ipv6: false
unified-delay: true
tcp-concurrent: true
profile:
  store-selected: true
  store-fake-ip: true

Modes and logging ​

FieldValues or unitsChoosing a value
moderule, global, directRoute by rules, use the global outbound, or connect directly; normally use rule
log-levelsilent, error, warning, info, debugUse info normally and debug temporarily for diagnosis
ipv6BooleanIPv6 use also depends on the app's IP Stack setting
unified-delayBooleanUnified latency testing; enabled by default in this client
tcp-concurrentBooleanTry TCP connections to resolved addresses concurrently
find-process-modestrict, always, offQuery as needed, always attempt, or disable; process rules mainly apply to macOS
keep-alive-idle / keep-alive-intervalSecondsTCP keep-alive idle delay and probe interval; keep defaults without a specific need
disable-keep-aliveBooleanDisable TCP keep-alive

See Inbound for ports, DNS for hosts, and Security for custom trust and controller access.

Platform behavior and field status ​

  • IPv6: ipv6 and dns.ipv6 also depend on the app's IP Stack settings; TUN IPv6 capture is separate.
  • Delay testing: unified-delay defaults to enabled when omitted; an explicit false disables it.
  • Process routing: macOS can query process name, path, and UID. On iOS/tvOS, use destination domains, IPs, ports, or network types. See routing rules.
  • Geodata: Clash manages resources. geo-auto-update stays off, and geo-update-interval does not enable scheduled updates. iOS/tvOS use precompiled resources, so some loader and matcher choices do not apply as written.
  • Fingerprints: legacy global-client-fingerprint has no global effect; use client-fingerprint on supported outbound protocols.

External controllers and dashboards are advanced settings, not required for normal connections. Read access protection guidance before using them.

36 fields shown

FieldTypeiOSmacOStvOSPlatform notes
clash-for-android.append-system-dnsBooleanNot applicableNot applicableNot applicableAndroid-specific; not used on Apple platforms.
clash-for-android.ui-subtitle-patternStringNot applicableNot applicableNot applicableAndroid-specific; not used on Apple platforms.
disable-keep-aliveBooleanSupportedSupportedSupportedControls connection keep-alive behavior; verify changes with new connections.
etag-supportBooleanSupportedSupportedSupportedControls ETag use for relevant HTTP resource requests.
external-controllerStringAdvancedAdvancedAdvancedCreates an HTTP/HTTPS controller. Prefer loopback binding and a secret; some desktop control APIs are unavailable.
external-controller-cors.allow-originsListAdvancedAdvancedAdvancedControls browser cross-origin access; does not replace authentication.
external-controller-cors.allow-private-networkBooleanAdvancedAdvancedAdvancedControls browser cross-origin access; does not replace authentication.
external-controller-pipeStringNot applicableNot applicableNot applicableWindows named-pipe setting; not used on Apple platforms.
external-controller-routing-markIntegerNot applicableNot applicableNot applicableLinux routing mark; not used on Apple platforms.
external-controller-tlsStringAdvancedAdvancedAdvancedCreates an HTTP/HTTPS controller. Prefer loopback binding and a secret; some desktop control APIs are unavailable.
external-controller-unixStringUnsupportedUnsupportedUnsupportedThe user-supplied Unix controller path is not used on any of the three platforms.
external-doh-serverStringAdvancedAdvancedAdvancedSets a DoH path on the controller; controller secret does not protect this path.
external-uiStringAdvancedAdvancedAdvancedSets the dashboard directory, name, or download URL. The name must be a local relative path; static pages are outside secret authentication, while APIs authenticate separately.
external-ui-nameStringAdvancedAdvancedAdvancedSets the dashboard directory, name, or download URL. The name must be a local relative path; static pages are outside secret authentication, while APIs authenticate separately.
external-ui-urlStringAdvancedAdvancedAdvancedSets the dashboard directory, name, or download URL. The name must be a local relative path; static pages are outside secret authentication, while APIs authenticate separately.
find-process-modeStringUnsupportedSupportedUnsupportedmacOS can query process name, path, and UID per connection; always off on iOS/tvOS. Some connections may lack process information.
geo-auto-updateBooleanManaged / limitedManaged / limitedManaged / limitedAlways off at runtime; Clash manages resource preparation.
geo-update-intervalIntegerUnsupportedUnsupportedUnsupportedAutomatic updates are off; this interval does not enable scheduled updates.
geodata-loaderStringManaged / limitedSupportedManaged / limitediOS/tvOS use memconservative; macOS keeps the selection. Precompiled resources bypass source-data loading.
geodata-modeBooleanManaged / limitedManaged / limitedManaged / limitedSelects the GeoIP data mode and requires matching resources; does not bypass platform precompilation requirements.
geosite-matcherStringManaged / limitedManaged / limitedManaged / limitedPrecompiled GeoSite uses a fixed matcher. iOS/tvOS use precompiled resources; macOS may apply this choice when falling back to source data.
geox-url.asnStringManaged / limitedManaged / limitedManaged / limitedDoes not trigger automatic downloads in the tunnel; prepare data through Clash resource management.
geox-url.geoipStringManaged / limitedManaged / limitedManaged / limitedDoes not trigger automatic downloads in the tunnel; prepare data through Clash resource management.
geox-url.geositeStringManaged / limitedManaged / limitedManaged / limitedDoes not trigger automatic downloads in the tunnel; prepare data through Clash resource management.
geox-url.mmdbStringManaged / limitedManaged / limitedManaged / limitedDoes not trigger automatic downloads in the tunnel; prepare data through Clash resource management.
global-client-fingerprintStringUnsupportedUnsupportedUnsupportedNo longer sets a global fingerprint; use client-fingerprint on a supported outbound protocol.
global-uaStringSupportedSupportedSupportedSets the default User-Agent for relevant HTTP requests.
hostsMappingSupportedSupportedSupportedSets static domain-to-address mappings.
ipv6BooleanManaged / limitedManaged / limitedManaged / limitedAffected by the app’s IP Stack settings; DNS IPv6 also requires global IPv6. Tunnel IPv6 capture is a separate setting.
keep-alive-idleIntegerSupportedSupportedSupportedControls connection keep-alive behavior; verify changes with new connections.
keep-alive-intervalIntegerSupportedSupportedSupportedControls connection keep-alive behavior; verify changes with new connections.
log-levelStringSupportedSupportedSupportedSets logging level. debug also enables controller debugging endpoints; restore a normal level after troubleshooting.
modeStringSupportedSupportedSupportedSelects rule, global, or direct outbound mode.
secretStringAdvancedAdvancedAdvancedProtects authenticated controller APIs; an empty value requires no password. Does not protect static UI, External DoH, or independent services.
tcp-concurrentBooleanSupportedSupportedSupportedControls concurrent TCP dialing; verify changes with new connections.
unified-delayBooleanManaged / limitedManaged / limitedManaged / limitedDefaults to true when omitted; an explicit false is preserved.

Saving runtime state ​

profile.store-selected saves core policy selections; profile.store-fake-ip saves Fake IP mappings. Both default to enabled when omitted; explicit false disables the corresponding cache. They do not save Profile configuration files.

Saving also requires persistent storage. tvOS may clear caches, so previous selections and mappings may be lost.

2 fields shown

FieldTypeiOSmacOStvOSPlatform notes
profile.store-fake-ipBooleanSupportedSupportedManaged / limitedControls Fake IP cache persistence; defaults to true, false disables it. Requires persistent storage; tvOS cache loss may discard previous mappings.
profile.store-selectedBooleanSupportedSupportedManaged / limitedControls core policy-selection persistence; defaults to true, false disables it. Does not save Profiles; tvOS cache loss may discard previous selections.

Reference: mihomo.