Skip to content

Claude Code Manual Setup

Connect Claude Code to Tianshu by editing settings.json.

Prerequisite: you've completed Environment Check and Install and claude runs properly.

Open the config directory

text
Press Win + R, type the path below and press Enter:
%userprofile%\.claude
If there's no settings.json in the directory, create one manually.
text
In Finder press Command + Shift + G, enter the path and press Enter:
~/.claude
If there's no settings.json, create one manually.

Write the configuration

Write the following into settings.json, replacing xxx with your Tianshu token:

json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://tian-shu.org",
    "ANTHROPIC_AUTH_TOKEN": "xxx",
    "CLAUDE_CODE_ATTRIBUTION_HEADER": "0",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "CLAUDE_CODE_DISABLE_TERMINAL_TITLE": "1"
  }
}

Token group

  • Only using Claude Code on the CLI → use a token in the claude-cconly group (best value).
  • Want to use it in other clients too → use the claude-max / claude-kiro group.

Test

Run claude in a terminal; when the chat interface appears and replies normally, the configuration succeeded:

bash
claude

Can't connect / asked to log in?

If running claude for the first time reports Unable to connect to Anthropic services, or it keeps asking you to log in, initialization usually didn't complete. For the fix, see FAQ · Claude Code.