Skip to content

Instantly share code, notes, and snippets.

@SoKnight
Last active February 19, 2026 15:05
Show Gist options
  • Select an option

  • Save SoKnight/a1d13152118530ff6718d348dc018fe1 to your computer and use it in GitHub Desktop.

Select an option

Save SoKnight/a1d13152118530ff6718d348dc018fe1 to your computer and use it in GitHub Desktop.
Script for Claude Code binary to run it under configured proxy

Installation steps

  1. Setup Claude Code using Native Install
  2. Configure environment variables to make claude binary available from the terminal
  3. Locate claude binary (e.g. C:\Users\<user>\.local\bin or /Users/<user>/.local/bin)
  4. Create claude-proxied script using a snippet below suitable for your OS
  5. Place it into the same directory near the claude executable file
  6. Use claude-proxied in the terminal instead of claude

JetBrains IDE setup

  1. Install Claude Code [Beta] plugin from the Marketplace
  2. Go to Settings -> Tools -> Claude Code [Beta] -> General -> Claude command
  3. Change it to claude-proxied
  4. Re-run Claude Code session in the embedded terminal and connect it to IDE via /ide
#!/bin/bash
# for Linux Bash (remove .bash extension & make it executable via chmod +x)
proxy="http://127.0.0.1:1080" # change it to your proxy address
no_proxy="localhost,127.0.0.1,::1" # required to connect to JetBrains IDE
export HTTP_PROXY=$proxy
export HTTPS_PROXY=$proxy
export NO_PROXY=$no_proxy
claude
# for Windows Powershell (DO NOT remove .ps1 extension)
$proxy = "http://127.0.0.1:1080" # change it to your proxy address
$no_proxy = "localhost,127.0.0.1,::1" # required to connect to JetBrains IDE
$env:HTTP_PROXY = $proxy
$env:HTTPS_PROXY = $proxy
$env:NO_PROXY = $no_proxy
# fallback lowercase variable names
$env:http_proxy = $proxy
$env:https_proxy = $proxy
$env:no_proxy = $no_proxy
claude
#!/bin/zsh
# for macOS zsh (remove .zsh extension & make it executable via chmod +x)
proxy="http://127.0.0.1:1080" # change it to your proxy address
no_proxy="localhost,127.0.0.1,::1" # required to connect to JetBrains IDE
export HTTP_PROXY=$proxy
export HTTPS_PROXY=$proxy
export NO_PROXY=$no_proxy
claude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment