How to Switch Between Stable and Alpha Clash.Meta Kernels in Clash Verge Rev
You can switch between the stable verge-mihomo and alpha verge-mihomo-alpha kernels in Clash Verge Rev by clicking the core selector chips in the settings, which triggers the changeClashCore command to restart the backend with the chosen binary.
Clash Verge Rev ships with two Clash.Meta sidecar binaries, allowing users to toggle between the officially released stable kernel and the bleeding-edge alpha build. This switching mechanism is controlled through the clash_core configuration key and implemented via a React UI component that communicates with the Rust backend.
Understanding the Kernel Variants
Clash Verge Rev packages both kernels as external binaries in the Tauri bundle. The application validates selections against a whitelist and manages the lifecycle of each core process.
Stable Kernel (verge-mihomo)
The stable variant uses the binary named verge-mihomo. This is the officially released Clash.Meta core that has passed standard release testing. In src-tauri/src/config/verge.rs, this value is defined as the default fallback when no core is specified or when an invalid core name is provided.
Alpha Kernel (verge-mihomo-alpha)
The alpha variant uses verge-mihomo-alpha. This build contains the newest features and fixes from the Clash.Meta development branch. According to the source code in src-tauri/src/config/verge.rs, the valid cores are strictly whitelisted:
pub const VALID_CLASH_CORES: &[&str] = &["verge-mihomo", "verge-mihomo-alpha"];
How Kernel Switching Works in Clash Verge Rev
The switching mechanism spans the React frontend, TypeScript service layer, and Rust backend. When you select a different kernel in the UI, the application validates the choice, updates the configuration, and restarts the core process with the new binary.
UI Component: clash-core-viewer.tsx
The core selector is implemented in src/components/setting/mods/clash-core-viewer.tsx. This component renders two Material-UI Chip elements representing the stable and alpha options:
{/* release (stable) */}
<Chip
label={t("settings.modals.clashCore.variants.release")}
variant={clash_core === "verge-mihomo" ? "filled" : "outlined"}
onClick={() => setClashCore("verge-mihomo")}
key="release"
/>
{/* alpha */}
<Chip
label={t("settings.modals.clashCore.variants.alpha")}
variant={clash_core === "verge-mihomo-alpha" ? "filled" : "outlined"}
onClick={() => setClashCore("verge-mihomo-alpha")}
key="alpha"
/>
The component reads the current clash_core value from the application configuration and calls setClashCore (which wraps the backend command) when a user clicks a chip.
Frontend Command: changeClashCore
The TypeScript service layer in src/services/cmds.ts exposes the changeClashCore function that invokes the Rust command:
export async function changeClashCore(clashCore: string) {
return invoke<string | null>("change_clash_core", { clashCore });
}
This function passes the selected core string to the Tauri backend, where the actual validation and process management occur.
Backend Validation in verge.rs
The Rust backend in src-tauri/src/config/verge.rs handles the core switching logic. When change_clash_core is invoked, the backend validates the input against VALID_CLASH_CORES:
if !VALID_CLASH_CORES.contains(&clash_core.as_str()) {
// fallback to stable core
config.clash_core = Some("verge-mihomo".into());
}
If the provided value is not in the whitelist, the system defaults to the stable verge-mihomo core. After validation, the configuration is updated and the core process is restarted using the selected binary.
Sidecar Binary Configuration
Both kernels are declared as external binaries in src-tauri/tauri.conf.json, ensuring they are packaged with the application:
{
"tauri": {
"bundle": {
"externalBin": ["sidecar/verge-mihomo", "sidecar/verge-mihomo-alpha"]
}
}
}
This configuration allows the Rust backend to spawn either verge-mihomo or verge-mihomo-alpha as a sidecar process depending on the clash_core setting.
Step-by-Step Guide to Switch Kernels
Follow these steps to switch between stable and alpha kernels in Clash Verge Rev:
- Open Settings: Launch Clash Verge Rev and navigate to the Settings page.
- Locate Core Selector: Find the "Clash Core" section showing two chip options: "Release" (stable) and "Alpha".
- Select Kernel: Click the chip corresponding to your desired kernel:
- Release: Selects
verge-mihomo(stable) - Alpha: Selects
verge-mihomo-alpha(latest features)
- Release: Selects
- Automatic Restart: The application automatically validates your selection against the whitelist in
verge.rs, updates theclash_coreconfiguration, and restarts the core process with the new binary.
Summary
- Clash Verge Rev bundles two Clash.Meta kernels: the stable
verge-mihomoand the alphaverge-mihomo-alpha. - The
clash_coreconfiguration key controls which binary is launched, validated againstVALID_CLASH_CORESinsrc-tauri/src/config/verge.rs. - The UI in
src/components/setting/mods/clash-core-viewer.tsxprovides a one-click chip selector to toggle between kernels. - The frontend command
changeClashCoreinsrc/services/cmds.tsbridges the React UI to the Rust backend, which handles process restart and binary selection.
Frequently Asked Questions
What is the difference between the stable and alpha Clash.Meta kernels in Clash Verge Rev?
The stable kernel (verge-mihomo) is the officially released Clash.Meta core that has undergone standard release testing and is recommended for production use. The alpha kernel (verge-mihomo-alpha) contains the latest development features, experimental fixes, and cutting-edge protocol support, but may contain bugs or unstable behavior. According to the source code in src-tauri/src/config/verge.rs, both are whitelisted in VALID_CLASH_CORES.
How does Clash Verge Rev validate the kernel selection?
The application validates kernel selections in the Rust backend at src-tauri/src/config/verge.rs. When you select a kernel in the UI, the frontend calls changeClashCore, which invokes the change_clash_core Tauri command. The backend checks the provided string against the VALID_CLASH_CORES array containing "verge-mihomo" and "verge-mihomo-alpha". If the value is not in the whitelist, the system automatically falls back to the stable verge-mihomo core.
Will switching kernels cause connection interruptions?
Yes, switching kernels triggers a restart of the core process. When you click a different kernel chip in src/components/setting/mods/clash-core-viewer.tsx, the backend updates the clash_core configuration and restarts the sidecar process using the selected binary (verge-mihomo or verge-mihomo-alpha). This restart will temporarily interrupt active connections, though the application typically restores the proxy state automatically once the new kernel initializes.
Where are the kernel binaries located in the Clash Verge Rev installation?
The kernel binaries are packaged as external sidecar executables defined in src-tauri/tauri.conf.json under the externalBin array. The configuration specifies sidecar/verge-mihomo and sidecar/verge-mihomo-alpha, which means the binaries are located in the sidecar directory relative to the application bundle. On Windows, these appear as verge-mihomo.exe and verge-mihomo-alpha.exe, while on Linux and macOS they follow the standard binary naming without extensions.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →