# Claude Code CLI + DeepSeek — basic setup

This installs **Claude Code** on your computer and points it at **your own DeepSeek API key**. No other configuration, no plugins, no hooks.

## What you need

1. A computer running Windows 10/11, macOS 13+, or Linux.
2. A **DeepSeek account with credits** and a **separate API key**. These are two different things:
   - **Credits (money):** add at https://platform.deepseek.com/top_up — PayPal, bank card (Visa/Mastercard), Alipay, WeChat Pay. International cards are sometimes declined; try PayPal if a card fails.
   - **API key (password):** create separately at https://platform.deepseek.com/api_keys, then copy it once and keep it private.
   - **Adding credits does not create a key.** Do both: add a few dollars, then create the key. A few dollars goes a long way on V4 Flash.
   - Use the same DeepSeek account/email for the credits and the key. Either order works; the balance belongs to the account, not to the key.
3. Internet access.

## Windows — one click

1. Download and extract the ZIP.
2. Double-click **`INSTALL - Windows (double-click).bat`**.
3. Paste your DeepSeek key when asked. The input is hidden.
4. The installer:
   - installs Claude Code if it is missing (official Anthropic installer),
   - checks your key against DeepSeek,
   - writes the six settings Claude Code needs,
   - puts **Claude Code (DeepSeek)** on your Desktop.
5. Open **Claude Code (DeepSeek)** on the Desktop, or open a new terminal, `cd` into a project folder, and run `claude`.

If Windows warns about the file, choose **More info → Run anyway**. The installer is plain text; you can open it in Notepad and read every line.

## macOS / Linux

```bash
bash "INSTALL - Mac or Linux.sh"
```

It installs Claude Code if needed, asks for your key, tests it, and writes the same six settings. Then run `claude` in any project folder.

## The six settings it writes

In `~/.claude/settings.json` (Windows: `%USERPROFILE%\.claude\settings.json`):

| Setting | Value |
|---|---|
| `ANTHROPIC_BASE_URL` | `https://api.deepseek.com/anthropic` |
| `ANTHROPIC_AUTH_TOKEN` | your DeepSeek API key |
| `ANTHROPIC_MODEL` | `deepseek-v4-flash` |
| `ANTHROPIC_DEFAULT_SONNET_MODEL` | `deepseek-v4-flash` |
| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | `deepseek-v4-flash` |
| `CLAUDE_CODE_MAX_CONTEXT_TOKENS` | `1000000` |

The installer backs up any existing `settings.json` as `settings.json.bak-deepseek-<date>`.

## Optional extras — take what you need, skip the rest

The installer asks about the first two. Everything else can be added later; nothing here is required.

| Extra | What it does | How to add it |
|---|---|---|
| **Recommended DeepSeek extras** | Effort `max`, keep subagents on V4 Flash, map the Opus alias to V4 Flash, turn off non-essential traffic | Answer **y** in the installer, or add the four keys below |
| **Starter `CLAUDE.md`** | A short "be concise, ask before deleting" instruction file for every project | Answer **y** in the installer |
| **Git for Windows** | Gives Claude Code the Bash tool instead of PowerShell | Install from https://git-scm.com/downloads/win, or `winget install --id Git.Git -e` |
| **Plugins** | Add focus/ADHD, minimal-coding, memory, or other community plugins | Inside Claude Code, run `/plugin`, pick a marketplace, install only what you want |
| **MCP servers** | Connect extra tools (browser, database, issue tracker, and so on) | Inside Claude Code, run `/mcp` and follow the server's setup |
| **Permissions** | Pre-approve trusted commands, or keep the default "ask me" behavior | Run `/permissions`; start with the default |
| **Stable updates** | Less churn than the default latest channel | Add `"autoUpdatesChannel": "stable"` at the top level of `settings.json` |
| **A model per job** | Use a different DeepSeek model for a specific task | Set `ANTHROPIC_MODEL` / `ANTHROPIC_DEFAULT_*_MODEL` to another DeepSeek model ID |

The four recommended extras, if you add them by hand:

```json
{
  "env": {
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-v4-flash",
    "CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-v4-flash",
    "CLAUDE_CODE_EFFORT_LEVEL": "max",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}
```

`CLAUDE_CODE_EFFORT_LEVEL=max` makes Claude Code more thorough, slower, and more expensive per task. Set it to `medium` or `high` if you want to spend less.

## Manual setup (if you prefer)

1. Install Claude Code:
   - Windows PowerShell: `irm https://claude.ai/install.ps1 | iex`
   - macOS/Linux: `curl -fsSL https://claude.ai/install.sh | bash`
   - or npm (Node 22+): `npm install -g @anthropic-ai/claude-code`
2. Create or edit `~/.claude/settings.json` and add:

```json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "sk-your-key-here",
    "ANTHROPIC_MODEL": "deepseek-v4-flash",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-v4-flash",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4-flash",
    "CLAUDE_CODE_MAX_CONTEXT_TOKENS": "1000000"
  }
}
```

3. Open a new terminal, `cd` to a project, run `claude`.

## Troubleshooting

- **`claude` is not recognized**: close the terminal and open a new one. The installer adds Claude Code to your PATH; a new terminal is required.
- **401 / invalid key**: regenerate the key at platform.deepseek.com and rerun the installer.
- **402 / insufficient balance**: add credit to your DeepSeek account.
- **Claude Code asks you to log in**: the settings were not picked up. Confirm the file path and that the `env` block is present.
- **Wrong model**: run `claude` and check `/status`; it should say `deepseek-v4-flash`.

## To undo

Restore the backup created next to the settings file:

- Windows: `%USERPROFILE%\.claude\settings.json.bak-deepseek-*`
- macOS/Linux: `~/.claude/settings.json.bak-deepseek-*`

Or delete the `env` block from `settings.json`.

## Cost

You pay DeepSeek directly for tokens. This package contains no API key and sends nothing anywhere except the one test message to DeepSeek when you run the installer.
