Run Claude Code in VS Code for Free with a One‑Time Proxy Setup
This guide shows how to bypass Claude Code's paid Anthropic API by installing a local proxy that forwards requests to free models such as DeepSeek, Ollama, or NVIDIA NIM, covering all required tools, configuration steps, and troubleshooting tips.
A developer who loves freebies notes that Claude Code is the strongest AI coding tool but its Anthropic API calls are costly. This open‑source project forwards Claude Code’s API requests to free or low‑price models, allowing you to use Claude Code without paying.
Why use Free Claude Code?
Claude Code charges per token for every conversation, which can become expensive for a moderately complex project.
The solution is simple: run a local proxy server that intercepts Claude Code’s API calls and forwards them to free or cheap models (e.g., DeepSeek, Ollama local models, NVIDIA NIM free quota). Claude Code remains unaware of the change.
你的 Claude Code
↓
Free Claude Code 代理(本地 :8082)
↓
DeepSeek / Ollama / NVIDIA NIM(免费)Prerequisites
VS Code (editor)
Claude Code VS Code extension (AI coding assistant)
Python 3.14 (runs the proxy server)
uv (fast Python package manager)
Git (clone the project)
Step 1: Install the Claude Code VS Code extension
Step 2: Install uv and Python 3.14
uv is a very fast Python package manager used by Free Claude Code to manage dependencies.
macOS / Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv self update
uv python install 3.14Windows PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
uv self update
uv python install 3.14Verify the installation:
uv --version
python --versionStep 3: Clone the Free Claude Code project
git clone https://github.com/Alishahryar1/free-claude-code.git
cd free-claude-codeProject structure:
free-claude-code/
├── server.py # proxy server entry point
├── api/ # API routes
├── providers/ # model backends
├── .env.example # configuration template
└── pyproject.toml # dependency configurationStep 4: Choose a free model backend
This is the most critical step. Select a free model to replace Claude.
Option A: DeepSeek (recommended for beginners)
DeepSeek offers a free quota, stable access in China.
Get API Key:
Configure .env:
cp .env.example .envEdit .env and add:
DEEPSEEK_API_KEY="sk-你的DeepSeek API Key"
MODEL="deepseek/deepseek-chat"
ANTHROPIC_AUTH_TOKEN="freecc"Option B: Ollama local model (completely free, data stays on your computer)
Install Ollama:
# macOS
brew install ollama
# Linux
curl -fsSL https://ollama.ai/install.sh | shDownload a model:
ollama pull qwen2.5-coder:7bConfigure .env:
MODEL="ollama/qwen2.5-coder:7b"
ANTHROPIC_AUTH_TOKEN="freecc"
OLLAMA_BASE_URL="http://localhost:11434"Option C: NVIDIA NIM (free quota, higher quality)
Obtain an API key from the NVIDIA Build portal.
NVIDIA_NIM_API_KEY="nvapi-你的Key"
MODEL="nvidia_nim/z-ai/glm4.7"
ANTHROPIC_AUTH_TOKEN="freecc"Step 5: Start the proxy server
After configuring .env, run:
uv run uvicorn server:app --host 0.0.0.0 --port 8082Step 6: Configure the VS Code extension to use the proxy
Open VS Code settings and edit settings.json to add:
{
"claudeCode.environmentVariables": [
{
"name": "ANTHROPIC_BASE_URL",
"value": "http://localhost:8082"
},
{
"name": "ANTHROPIC_AUTH_TOKEN",
"value": "freecc"
}
]
}Reload the extension (Ctrl+Shift+P or Cmd+Shift+P → "Developer: Reload Window").
After reload, click the Claude Code icon, open the chat window, and ask a simple question such as:
帮我写一个 Python 的 Hello WorldCommon Issues
Issue 1: Extension still shows login screen
This is normal. Log in once via "Anthropic Console"; after the environment variables take effect, actual API calls go through the local proxy.
Issue 2: Proxy error – malformed response
Ensure ANTHROPIC_BASE_URL is exactly http://localhost:8082, not http://localhost:8082/v1.
Make sure the proxy is up‑to‑date by running git pull in the project directory.
Issue 3: Ollama model response is slow
7B models run slowly on CPU. Use a GPU for acceleration or switch to the faster DeepSeek API.
Issue 4: DeepSeek free quota exhausted
DeepSeek also offers a pay‑as‑you‑go mode at a very low price (≈1 RMB per 1 M tokens), which is negligible for most use cases.
Advanced Usage – Model Routing
Free Claude Code can route different request types to different models to save costs:
# Complex tasks use DeepSeek
MODEL_OPUS="deepseek/deepseek-reasoner"
# Ordinary tasks use local Ollama
MODEL_SONNET="ollama/qwen2.5-coder:7b"
MODEL_HAIKU="ollama/qwen2.5-coder:7b"Conclusion
The core problem solved by Free Claude Code is simple: enjoy Claude Code’s experience without paying Anthropic.
Configuration recap:
Install Claude Code VS Code extension
Install uv and Python 3.14
Clone the free‑claude‑code repository
Select a free backend (recommended DeepSeek)
Configure the .env file
Start the proxy server
Set VS Code environment variables
Reload the extension and start using Claude Code
Project address: https://github.com/Alishahryar1/free-claude-code
Leave a comment with the backend you used and any issues you encounter; the author will reply.
Java Web Project
Focused on Java backend technologies, trending internet tech, and the latest industry developments. The platform serves over 200,000 Java developers, inviting you to learn and exchange ideas together. Check the menu for Java learning resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
