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

🚀 完结,撒花 💐


相关推荐
roamingcode20 小时前
超越 Context Window:为何文件系统是 AI Agent 的终极记忆体
人工智能·agent·cursor·claude code·上下文工程·skill 技能
zhaqonianzhu20 小时前
【vsc】cpptools占用内存过大
vscode
智慧地球(AI·Earth)1 天前
Codex配置问题解析:wire_api格式不匹配导致的“Reconnecting...”循环
开发语言·人工智能·vscode·codex·claude code
markvivv1 天前
在 Kylin Linux Advanced Server for Kunpeng V10 上构建 VSCode 1.106
linux·vscode·kylin
zhangfeng11331 天前
Kiro python环境的设置 中文语言包设置,通用vscode ,因为kiro是vscode基础上做的
开发语言·vscode·python
微醺的老虎1 天前
【工具】vscode格式化json文件
ide·vscode·编辑器
老吴学AI1 天前
系列报告十:(Menlo)《2025: The State of Generative AI in the Enterprise》
人工智能·vibe coding
乔宕一1 天前
vscode 设置每次调试 powershell 脚本都使用临时的 powershell 终端
ide·vscode·编辑器
唐装鼠1 天前
linux vscode解压版 AI账号无法登陆问题(浏览器无法打开vscode)
linux·运维·vscode