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 Code
2
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 copied
4
export API_TIMEOUT_MS=600000
5
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"' >> ~/.zshrc
2
echo 'export ANTHROPIC_AUTH_TOKEN="sk-proj-xxxx"' >> ~/.zshrc
3
echo 'export API_TIMEOUT_MS=600000' >> ~/.zshrc
4
echo 'export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1' >> ~/.zshrc
5
 
6
source ~/.zshrc

Windows

You can use any of the following methods to complete the same configuration:

Method 1 · GUI (Recommended, Permanent)

  1. Press Win + R, type sysdm.cpl and hit Enter.
  2. Open AdvancedEnvironment Variables.
  3. Under User variables, click New, and add them one by one:
    • ANTHROPIC_BASE_URLhttps://www.codebyai.net/api/agent
    • ANTHROPIC_AUTH_TOKENsk-proj-xxxx
    • API_TIMEOUT_MS600000
    • CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC1
  4. 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/agent
2
set ANTHROPIC_AUTH_TOKEN=sk-proj-xxxx
3
set API_TIMEOUT_MS=600000
4
set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1

Start Claude Coding Environment

Run in any project directory:

1
cd your-project
2
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.json Example 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
    }
  • 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.

Claude Code Configuration - Documentation | Code By AI | Unified AI Coding Agents