Claude Code Configuration
getting-started / Claude Code Configuration
Claude Code Configuration
Configure Required Environment Variables
Before starting Claude Code CLI or the VS Code extension, you need to prepare several environment variables. It is recommended to configure them once in your shell/system settings, and then reopen the terminal or editor after modification, so that every new session inherits them automatically.
macOS or Linux
Add the following content to ~/.zshrc (zsh) or ~/.bashrc (bash):
1 # Claude Code2 export ANTHROPIC_BASE_URL="https://www.codebyai.net/api/agent"3 export ANTHROPIC_AUTH_TOKEN="sk-proj-xxxx" # Replace with the API Key you just copied4 export API_TIMEOUT_MS=6000005 export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
Run source ~/.zshrc after saving the file to make the configuration take effect immediately.
If you prefer to append them one by one, you can run (bash users change ~/.zshrc to ~/.bashrc), remember to replace the auth token with your API Key just copied:
1 echo 'export ANTHROPIC_BASE_URL="https://www.codebyai.net/api/agent"' >> ~/.zshrc2 echo 'export ANTHROPIC_AUTH_TOKEN="sk-proj-xxxx"' >> ~/.zshrc3 echo 'export API_TIMEOUT_MS=600000' >> ~/.zshrc4 echo 'export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1' >> ~/.zshrc5 6 source ~/.zshrc
Windows
You can use any of the following methods to complete the same configuration:
Method 1 · GUI (Recommended, Permanent)
- Press
Win + R, typesysdm.cpland hit Enter. - Open Advanced → Environment Variables.
- Under User variables, click New, and add them one by one:
ANTHROPIC_BASE_URL→https://www.codebyai.net/api/agentANTHROPIC_AUTH_TOKEN→sk-proj-xxxxAPI_TIMEOUT_MS→600000CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC→1
- Close all windows and restart your computer.
Method 2 · Command Prompt (Permanent)
1 setx ANTHROPIC_BASE_URL "https://www.codebyai.net/api/agent"2 setx ANTHROPIC_AUTH_TOKEN "sk-proj-xxxx"3 setx API_TIMEOUT_MS "600000"4 setx CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC "1"
Method 3 · PowerShell (Permanent)
1 [System.Environment]::SetEnvironmentVariable('ANTHROPIC_BASE_URL', 'https://www.codebyai.net/api/agent', 'User')2 [System.Environment]::SetEnvironmentVariable('ANTHROPIC_AUTH_TOKEN', 'sk-proj-xxxx', 'User')3 [System.Environment]::SetEnvironmentVariable('API_TIMEOUT_MS', '600000', 'User')4 [System.Environment]::SetEnvironmentVariable('CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC', '1', 'User')
Method 4 · Temporary Session (Valid only for current CMD window)
1 set ANTHROPIC_BASE_URL=https://www.codebyai.net/api/agent2 set ANTHROPIC_AUTH_TOKEN=sk-proj-xxxx3 set API_TIMEOUT_MS=6000004 set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
Start Claude Coding Environment
Run in any project directory:
1 cd your-project2 claude
After successful startup, you will see an interface similar to this:

If using VS Code (or other IDE) extensions, these environment variables are also required. If you see the following prompt:

It means the extension did not set up the configuration correctly, and you need to recheck. You can also hardcode these values directly in the configuration file:
-
Claude Global Settings
- macOS/Linux:
~/.claude/settings.json - Windows:
C:/Users/<UserName>/.claude/settings.jsonExample content:
1 {2 "env": {3 "ANTHROPIC_AUTH_TOKEN": "sk-proj-xxxx",4 "ANTHROPIC_BASE_URL": "https://www.codebyai.net/api/agent",5 "API_TIMEOUT_MS": "600000",6 "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"7 }8 } - macOS/Linux:
-
VS Code settings.json – Add:
1 "claudeCode.environmentVariables": [2 { "name": "ANTHROPIC_BASE_URL", "value": "https://www.codebyai.net/api/agent" },3 { "name": "ANTHROPIC_AUTH_TOKEN", "value": "sk-proj-xxxx" }4 ],
After modification, please reload VS Code or restart the terminal.