一文理解在 VSCode 中成功使用 Claude Code 插件

🍉 CSDN 叶庭云:https://yetingyun.blog.csdn.net/


VSCode 集成开发环境(Integrated Development Environment,IDE)中,点进 扩展 (Ctrl + Shift + X)进去,检索并找到 Claude Code 插件,如下图所示:

点击开始安装 Claude Code for VSCode 这个插件,安装好之后,开始配置,如下图所示:

实际有三种登录方式,本质就是要通过认证你才能使用,点击选项卡会提示你跳转到对应的说明文档,如下图所示:

我们其实可以直接配置 API KEY、BASE URL 和使用的 Model ,比如接入智谱的模型https://www.bigmodel.cn/invite?icode=WIOY4POOgV6VZ365Bqf66bC%2Fk7jQAKmT1mpEiZXXnFw%3D。点这个插件的设置 (齿轮)进去,然后找到 在 settings.json 中编辑 点进去,如下图所示:

首次打开 settings.json,里面的原始内容如下图所示:

添加如下内容,保存 settings.json 后,先退出 VSCode,再重新进入。

bash 复制代码
{
    "workbench.colorTheme": "Monokai",
    "editor.fontSize": 19,
    "explorer.confirmDelete": false,
    "debug.console.fontSize": 17,
    "terminal.integrated.fontSize": 17,
    "Codegeex.Privacy": true,
    "Codegeex.License": "",
    "notebook.output.textLineLimit": 1024,
    "editor.renderWhitespace": "all",
    "security.workspace.trust.untrustedFiles": "open",
    "claudeCode.preferredLocation": "panel",
    "claudeCode.environmentVariables": [
        {
            "name": "ANTHROPIC_AUTH_TOKEN",
            "value": "your_api_key......."
        },
        {
            "name": "ANTHROPIC_BASE_URL",
            "value": "https://open.bigmodel.cn/api/anthropic"
        },
        {
            "name": "ANTHROPIC_MODEL",
            "value": "glm-4.7"
        },
        {
            "name": "ANTHROPIC_DEFAULT_HAIKU_MODEL",
            "value": "glm-4.7"
        }
    ]
}

最后,测试在 VSCode 中成功使用 Claude Code 插件,如下图所示:

输入 Prompt:Write a quicksort algorithm using the Python programming language that is the most accurate, efficient, and concise. The specific requirement is to first clearly explain the specific algorithm ideas, then analyze the time and space complexity, and finally write complete Python code.

🚀 完结,撒花 💐


相关推荐
Joseph Cooper5 分钟前
AI Agent 工具选型:OpenClaw、Hermes、Claude Code、Codex、Cursor、Copilot 怎么选
ai·copilot·cursor·codex·claude code·openclaw·hermes
key_3_feng9 分钟前
【无标题】
vibe coding
叫我王员外就行18 小时前
Claude Code之三大模式
ai编程·claude code
维元码簿19 小时前
Claude Code 深度拆解:多 Agent 协作 3 — Task 状态机、SendMessage 与消息邮箱
ai·agent·claude code·ai coding
Slow菜鸟19 小时前
Claude Code教程(九)| MCP 之 Playwright
claude code
Robot_Nav20 小时前
AI 编程助手 Skill 完全指南:VS Code · Trae CN · Claude Code
人工智能·vscode·skill·trae·claude code
Slow菜鸟21 小时前
Claude Code教程(八)| MCP 之 Context7
claude code
倔强的石头1061 天前
Claude Code + GLM-5.1 全能保姆级攻略:零门槛打造你的私人终端 AI 程序员
人工智能·claude code
捧 花1 天前
Claude Code 使用指南
人工智能·claude·claude code·superpower
生而为虫1 天前
在VScode中使用Claude Code agent并配置模型(仅mac电脑实际操作,windows电脑未实际操作如有问题可留言)
windows·vscode·macos