安装claude code

npm install -g @anthropic-ai/claude-code

added 2 packages in 39s
npm notice
npm notice New major version of npm available! 10.9.4 -> 11.16.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.16.0
npm notice To update run: npm install -g npm@11.16.0
npm notice

查看claude 是否安装成功

claude
Welcome to Claude Code v2.1.161
..........................................................

     *                                       █████▓▓░
                                 *         ███▓░     ░░
            ░░░░░░                        ███▓░
    ░░░   ░░░░░░░░░░                      ███▓░
   ░░░░░░░░░░░░░░░░░░░    *                ██▓░░      ▓
                                             ░▓▓███▓▓░
 *                                 ░░░░
                                 ░░░░░░░░
                               ░░░░░░░░░░░░░░░░
       █████████                                        *
      ██▄█████▄██                        *
       █████████      *
.......█ █   █ █..........................................

 Unable to connect to Anthropic services

 Failed to connect to api.anthropic.com: ERR_BAD_REQUEST

 Please check your internet connection and network settings.

 Note: Claude Code might not be available in your country. Check supported countries at
 https://anthropic.com/supported-countries

第一步安装已经成功

powershell中配置使用claude code

10_UserManual> $env:ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
10_UserManual> $env:ANTHROPIC_AUTH_TOKEN="你的DeepSeek_API_Key"
10_UserManual> $env:ANTHROPIC_MODEL="deepseek-v4-pro"
10_UserManual> $env:ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-v4-pro"
10_UserManual> $env:ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4-pro"
10_UserManual> $env:ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4-flash"
10_UserManual> $env:CLAUDE_CODE_SUBAGENT_MODEL="deepseek-v4-flash"

再次运行claude code

Welcome to Claude Code v2.1.161
..........................................................

     *                                       █████▓▓░
                                 *         ███▓░     ░░
            ░░░░░░                        ███▓░
    ░░░   ░░░░░░░░░░                      ███▓░
   ░░░░░░░░░░░░░░░░░░░    *                ██▓░░      ▓
                                             ░▓▓███▓▓░
 *                                 ░░░░
                                 ░░░░░░░░
                               ░░░░░░░░░░░░░░░░
       █████████                                        *
      ██▄█████▄██                        *
       █████████      *
.......█ █   █ █..........................................

 Let's get started.

 Choose the text style that looks best with your terminal
 To change this later, run /theme

   1. Auto (match terminal)
 ❯ 2. Dark mode ✔
   3. Light mode
   4. Dark mode (colorblind-friendly)
   5. Light mode (colorblind-friendly)
   6. Dark mode (ANSI colors only)
   7. Light mode (ANSI colors only)

 ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
  1  function greet() {
  2 -  console.log("Hello, World!");
  2 +  console.log("Hello, Claude!");
  3  }
Welcome to Claude Code v2.1.161
..........................................................

     *                                       █████▓▓░
                                 *         ███▓░     ░░
            ░░░░░░                        ███▓░
    ░░░   ░░░░░░░░░░                      ███▓░
   ░░░░░░░░░░░░░░░░░░░    *                ██▓░░      ▓
                                             ░▓▓███▓▓░
 *                                 ░░░░
                                 ░░░░░░░░
                               ░░░░░░░░░░░░░░░░
       █████████                                        *
      ██▄█████▄██                        *
       █████████      *
.......█ █   █ █..........................................

 Security notes:

 1. Claude can make mistakes.
    You're responsible for Claude's actions and should always
    review them, especially when running code.

 2. Due to prompt injection risks, only use it with code you trust
    Learn more: https://code.claude.com/docs/en/security

 Press Enter to continue…
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 Accessing workspace:

 Y:\10_UserManual

 Quick safety check: Is this a project you created or one you trust? (Like your own code, a well-known open source project, or work from your team). If not, take a moment to review what's in this folder first.

 Claude Code'll be able to read, edit, and execute files here.

 Security guide

 ❯ 1. Yes, I trust this folder
   2. No, exit

 Enter to confirm · Esc to cancel

测试是否与大模型连接成功

╭─── Claude Code v2.1.161 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                         │ Tips for getting started                                                                                                                                 │
│              Welcome back!              │ Run /init to create a CLAUDE.md file with instructions for Claude                                                                                        │
│                                         │ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── │
│                 ▐▛███▜▌                 │ What's new                                                                                                                                               │
│                ▝▜█████▛▘                │ `OTEL_RESOURCE_ATTRIBUTES` values are now included as labels on metric datapoints, so you can slice usage metrics by custom dimensions like team or repo │
│                  ▘▘ ▝▝                  │ `claude agents` rows now show `done/total` before the detail when work is fanned out; peek shows the longest-running item                                │
│                                         │ `/mcp` now collapses claude.ai connectors you've never signed in to behind a "Show unused connectors" row                                                │
│   deepseek-v4-pro · API Usage Billing   │ /release-notes for more                                                                                                                                  │
│    Y:\01_项目文档\广核\10_UserManual    │                                                                                                                                                          │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

   Opus 4.8 is now available! · /model to switch

❯ hello, 你是deepseek吗?

  Thought for 1s (ctrl+o to expand)

● 你好!不是的,我是 Claude Code,由 Anthropic 开发的 AI 编程助手。虽然当前会话的运行模型是 deepseek-v4-pro,但我本身是 Claude——Anthropic 的官方 CLI 工具。

  简单来说:
  - Claude Code 是工具/框架(由 Anthropic 构建)
  - deepseek-v4-pro 是本次会话底层使用的模型

  有什么我可以帮你的吗?

✻ Cooked for 3s

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ 
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ? for shortcuts · ← for agents

vscode 中配置claude code

下载Claude Code for VS Code

在这里插入图片描述
这里先不管,不用登录
在这里插入图片描述

在这里插入图片描述

打开vscode配置

在这里插入图片描述

{
            "name": "ANTHROPIC_BASE_URL",
            "value": "https://api.deepseek.com/anthropic"
        },
        {
            "name": "ANTHROPIC_AUTH_TOKEN",
            "value": "你的DeepSeek Key"
        },
        {
            "name": "ANTHROPIC_API_KEY",
            "value": "sk-128ffba23fda40198b33b5d75bf60d01"
        },
        {
            "name": "ANTHROPIC_MODEL",
            "value": "deepseek-v4-pro"
        },
        {
            "name": "CLAUDE_CODE_SUBAGENT_MODEL",
            "value": "deepseek-v4-flash"
        }

重启vscode

在这里插入图片描述

更多推荐