[Mac] Configuring VS Code to Use the Clash Proxy
Some VS Code extensions, such as IntelliCode and Claude Dev, may need to connect through a proxy. Here’s how to set up Clash as your proxy. The process is similar for other proxies.
0. System Environment
macOS Sonoma 14.6.1
Clash for Windows 0.20.39
1. System Settings
Clash uses port 7890 by default. If you haven’t changed the default settings, you can edit the system configuration file sudo vim ~/.zshrc and add the following:
export http_proxy=http://127.0.0.1:7890 export https_proxy=$http_proxy echo -e "Http Proxy is on."
Then restart the terminal window or run the following command to apply the changes:
source ~/.zshrc
If you’ve changed the port, update the configuration to match the port you’re using.
You can now use the Clash proxy from the command line. To test it, run:
curl -I "www.apple.com"
2. VS Code Configuration
macOS often doesn’t apply the default settings above correctly. If that happens, configure the proxy directly in VS Code.
2.1 Clash Settings
Enable both the TUN and allow WLAN options:

2.2 VS Code Settings
Go to Code -> Settings -> Settings and search for http_proxy:
Enter http://127.0.0.1:7890 as the value:
If everything went smoothly, your VS Code extensions should now be able to connect through the Clash proxy.
