Skip to content
Last verified:

macOS 27.0.1 (arm64); Claude Code 2.1.289; manual settings.json configuration, ANTHROPIC_AUTH_TOKEN authentication, claude-sonnet-4-6 chat.

Claude Code Guide ​

Claude Code is an AI coding assistant from Anthropic that supports code generation, modification, and review.

Installation ​

Choose an installation method based on your workflow.

macOS / Linux

bash
curl -fsSL https://claude.ai/install.sh | bash

Windows PowerShell

powershell
irm https://claude.ai/install.ps1 | iex

Windows CMD

Install Git for Windows first, then run:

cmd
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Connect to TokenFlux ​

After installation, choose one of the following methods to connect Claude Code to TokenFlux.

Using CC-Switch is recommended for centralized configuration.

Steps:

  1. Follow Create API Key to generate an API key.
  2. In the key list, click "More" on that key and choose "Import to CCS", then confirm the import in the CC-Switch window. See CC-Switch for details.
  3. Enable the imported TokenFlux provider on the Claude Code page in CC-Switch.
  4. Restart Claude Code after configuration is complete.

Verify the Setup ​

After configuration, run a request:

bash
claude --version
claude -p "Reply with OK only" --model claude-sonnet-5-5 --tools "" --no-session-persistence

Your key must support the example model. You can also set --model to claude-opus-5-5 if your group supports it. This command makes a real, billed request; after receiving a reply, confirm it in the usage logs.

If the client reports an authentication error, read the server message that follows. For example, insufficient balance can appear under Failed to authenticate. Check the balance, subscription, or key according to the specific error; see Error Codes.

The Claude Max Group ​

The Claude Max group accepts only Claude Code clients and cannot be used in the Claude app. Other clients receive 403 this group only allows Claude Code clients; see Error Codes.

On the Claude Max group you can additionally enable ENABLE_PROMPT_CACHING_1H=1 after finishing the basic configuration above. This option enables a 1-hour prompt cache, which is useful for Claude Code sessions that repeatedly carry long context. Other Claude groups do not need it.

Upstream cache writes cost more with a 1-hour TTL than with the default 5-minute TTL. TokenFlux billing follows the cache prices in the model marketplace. See the official Claude Code documentation for other cache TTL settings.

If you manage Claude Code through CC-Switch, see the CC-Switch Claude Max environment variable notes.

Terminal Launch ​

Set the environment variable once per system, then start Claude Code.

macOS / Linux

bash
export ENABLE_PROMPT_CACHING_1H=1

Windows PowerShell

powershell
$env:ENABLE_PROMPT_CACHING_1H=1

Windows CMD

cmd
set ENABLE_PROMPT_CACHING_1H=1

VSCode / Zed ​

If you launch Claude Code through VSCode or Zed, add the following to the env in ~/.claude/settings.json or %userprofile%\.claude\settings.json:

json
{
  "env": {
    "ENABLE_PROMPT_CACHING_1H": "1"
  }
}

If the file already has an env, merge the ENABLE_PROMPT_CACHING_1H line into it instead of creating a second env.

TokenFlux Documentation