DEV Community

Cover image for How to use Claude in vscode?
Pandas
Pandas

Posted on

How to use Claude in vscode?

I. Installing the Claude Plugin in VSCode

II. Create a new configuration file

  1. Add a config.json file to the ~/.claude directory

  1. The content of config.json is as follows: Replace config.json with the API key you applied for yourself at Zhipu:

{
"primaryApiKey": "sk-test"

}

  1. Restart VS Code. You no longer need to log in, but it still won't work.

III. Modify the configuration file
Claude Code -> Settings -> Edit in settings.json

Add the following field:

"claudeCode.environmentVariables": [

{
"name": "ANTHROPIC_BASE_URL",

"value": "https://open.bigmodel.cn/api/anthropic"

},

{
"name": "ANTHROPIC_AUTH_TOKEN",

"value": "Replace with the API key you applied for yourself at Zhipu"

}
] Close and reopen VS Code.

IV. Claude Code Usage Tips

parse the project and generate or update the CLAUDE.md documentation.

/init

Clear the conversation and restart

/clear

Compact the context

/compact

Exit the session

/exit

Deep Thinking

ultrathink+query

Top comments (0)