一文理解在 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.

🚀 完结,撒花 💐


相关推荐
数据知道10 小时前
claw-code 源码分析:爆款开源之后——Star 曲线与长期维护之间,工程上该建立哪些「反幻觉」机制?
ai·开源·claude code·claw code
月亮给我抄代码11 小时前
Superpowers —— 让 AI 编程代理具备工程化开发能力
驱动开发·ai编程·codex·claude code·opencode·superpowers
zhangfeng113311 小时前
vscode 之类的编辑器 ,跳转到某一个函数 方法 是什么快捷键 this->getEbayReturns($shop);
ide·vscode·编辑器
ShawnLiaoking12 小时前
vscode 配置环境
ide·vscode·编辑器
弈风千秋万古愁12 小时前
vscode使用markdown+plantuml
vscode·markdown·plantuml
日更嵌入式的打工仔13 小时前
Visual Studio 与 Visual Studio Code 区别
ide·vscode
数据知道1 天前
claw-code 源码分析:成本追踪(Cost)与 Hook——企业落地时,计量与策略注入该挂在哪一层?
ai·claude code·claw code
数据知道1 天前
claw-code 源码分析:OmX `$team` / `$ralph`——把 AI 辅助开发从偶发灵感变成可重复流水线
数据库·人工智能·mysql·ai·claude code·claw code
IT 行者1 天前
Claude Code 源码解读 06:权限系统与 Hooks——安全与自动化的基石
ai编程·源码解读·claude code
数据知道1 天前
claw-code 源码分析:大型移植的测试哲学——如何用 unittest 门禁守住「诚实未完成」的口碑?
开发语言·python·ai·claude code·claw code