Windows vscode Claude Code + DeepSeek V4

安装claude code

bat 复制代码
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 是否安装成功

bat 复制代码
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

bat 复制代码
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

bat 复制代码
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  }
bat 复制代码
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...
bat 复制代码
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 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

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

bat 复制代码
╭─── 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配置

json 复制代码
{
            "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

相关推荐
码哥字节2 小时前
被Skill/MCP/Hook搞晕三周,我画了张决策图
claude code·agent skills
骇客野人3 小时前
VSCode 安装 Trae(Trae AI: Coding Assistant)完整教程
ide·vscode·编辑器
骇客野人3 小时前
IDEA 安装 Trae(TRAE AI: Coding Assistant)完整步骤
java·ide·intellij-idea
趣味科技3 小时前
记录修复EAGET忆捷移动硬盘损坏
windows·数据分析·硬件工程
2501_915921433 小时前
SwiftUI开发框架入门指南:从基础到实战
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
骇客野人4 小时前
IntelliJ IDEA 使用技巧
java·ide·intellij-idea
senmuleishi5 小时前
持续发力嵌入式AI IDE,攻坚大科学装置电源解决方案
ide·人工智能
我命由我123455 小时前
Java 开发 - List subList 方法
java·windows·操作系统·list·intellij-idea·idea·intellij idea
吃辣我第一5 小时前
监听SHP目录自动注册SuperMap iServer地图服务(Windows版)
windows·iserver·shapefile
骇客野人5 小时前
VSCode 高效使用技巧
ide·vscode·编辑器