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

🚀 完结,撒花 💐


相关推荐
Luoxi_84 小时前
Anaconda超详细的安装教程+VScode的使用
ide·vscode·编辑器
无糖冰可乐217 小时前
安装wsl2,并链接Windows上的vscode运行项目
pytorch·vscode·python·pip
最后一支迷迭香8 小时前
十分钟 Vibe Coding 了一个个人网站,腾讯 UI 风格,经验分享
java·ai·个人博客·vibe coding
流量猎手10 小时前
Vscode登陆服务器
服务器·ide·vscode
月走乂山20 小时前
Anything Analyzer MCP 401 Unauthorized 故障排查
electron·故障排查·mcp·claude code·anything analyzer
码哥字节1 天前
为什么AI生成的单测,覆盖率看起来很高但上线还是出Bug?
测试覆盖率·claude code·ai单元测试
huy1n91 天前
Ubuntu 22.04部署Claude Code并接入DeepSeek-V4模型完整教程
linux·ubuntu·deepseek·claude code
巴渝小禹1 天前
【VSCODE】使用技巧
vscode
仙逆GPT1 天前
Claude Code上下文满了怎么办?compact、clear和resume怎么用
大语言模型·ai编程·上下文·claude code·compact