Cover image for ClaudeCode

ClaudeCode

Words 1.1k
Views
Visitors

Timeline

Timeline

2026-05-24

init

This article introduces the download, installation, and editor integration methods for Claude Code, detailing how to configure and use it with the DeepSeek API in VSCode and Emacs. Additionally, the article discusses Claude Code's Skill extension mechanism, the MCP (Model Context Protocol), and the installation of related Skills along with recommended plugins.

ClaudeCode

To download Claude Code, you need Node.js.

1
2
3
4
5
6
7
8
# It's best to switch the package source.
npm config set registry https://registry.npmmirror.com
npm install -g @anthropic-ai/claude-code

claude --version

# Restore the session for the current directory.
claude -c

DeepSeek

Here we choose DeepSeek because its tokens are relatively inexpensive and it doesn’t require connecting to external networks. Click the link below to apply for an API key.

Editor Integration

Vscode

Download the plugin:Claude Code for VS CodeAnthropic anthropic.com, then find it in the settings@ext:Anthropic.claude-codeunderClaudeCode: Environment VariablesClickEdit in settings.json

Refer to the official documentation to set environment variables.

As follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"claudeCode.environmentVariables": [
{
"name": "ANTHROPIC_BASE_URL",
"value": "https://api.deepseek.com/anthropic"
},
{
"name": "ANTHROPIC_AUTH_TOKEN",
"value": "<你的 DeepSeek API Key>"
},
{
"name": "ANTHROPIC_MODEL",
"value": "deepseek-v4-pro[1m]"
},
{
"name": "ANTHROPIC_DEFAULT_OPUS_MODEL",
"value": "deepseek-v4-pro[1m]"
},
{
"name": "ANTHROPIC_DEFAULT_SONNET_MODEL",
"value": "deepseek-v4-pro[1m]"
},
{
"name": "ANTHROPIC_DEFAULT_HAIKU_MODEL",
"value": "deepseek-v4-flash"
},
{
"name": "CLAUDE_CODE_SUBAGENT_MODEL",
"value": "deepseek-v4-flash"
},
{
"name": "CLAUDE_CODE_EFFORT_LEVEL",
"value": "max"
}
],

After that, open the Claude Code plugin in VSCode and you’re ready to use it.

You can also set environment variables in Windows PowerShell. First, open PowerShell with administrator privileges, then

1
code $PROFILE

Then write the environment variables from the official documentation, so that they are loaded every time PowerShell is opened.

1
2
3
4
5
6
7
8
$env:ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
$env:ANTHROPIC_AUTH_TOKEN="<你的 DeepSeek API Key>"
$env:ANTHROPIC_MODEL="deepseek-v4-pro[1m]"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-v4-pro[1m]"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4-pro[1m]"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4-flash"
$env:CLAUDE_CODE_SUBAGENT_MODEL="deepseek-v4-flash"
$env:CLAUDE_CODE_EFFORT_LEVEL="max"

Emacs

Emacs is generally used in Linux environments; the Windows version of Emacs has too many bugs. Therefore, the following configurations are all for Linux environments. First, still install Claude Code, then set the environment variables,$HOME/.bashrcor$HOME/.zshrc

1
2
3
4
5
6
7
8
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=<你的 DeepSeek API Key>
export ANTHROPIC_MODEL=deepseek-v4-pro[1m]
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-v4-pro[1m]
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-v4-pro[1m]
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-v4-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-v4-flash
export CLAUDE_CODE_EFFORT_LEVEL=max

Then enable the environment variables.

1
2
3
4
# bash
source ~/.bashrc
# zsh
source ~/.zshrc

The main package used is claude-code.el:

The configuration is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
;; claude code
;; install required inheritenv dependency:
(use-package inheritenv
:vc (:url "https://github.com/purcell/inheritenv" :rev :newest))

(use-package monet
:vc (:url "https://github.com/stevemolitor/monet" :rev :newest))

;; for vterm terminal backend:
(use-package vterm :ensure t)

;; install claude-code.el
(use-package claude-code :ensure t
:vc (:url "https://github.com/stevemolitor/claude-code.el" :rev :newest)
:config
;; optional IDE integration with Monet
(add-hook 'claude-code-process-environment-functions #'monet-start-server-function)
(monet-mode 1)
(setq claude-code-terminal-backend 'vterm)
(claude-code-mode)
:bind-keymap ("C-c c" . claude-code-command-map)
;; Optionally define a repeat map so that "M" will cycle thru Claude auto-accept/plan/confirm modes after invoking claude-code-cycle-mode / C-c M.
:bind
(:repeat-map my-claude-code-map ("M" . claude-code-cycle-mode)))

InputC-c c cThis will launch the Claude Code window. Other commands can be viewed through claude-code-transient (C-c c m).

Skill

Skill is an extension mechanism for Claude Code launched by Anthropic in October 2025. You can think of it as a skill pack for Claude Code, which is essentially a Markdown fileSKILL.mdthat contains the purpose, prompts, rules, and workflow of the Skill. Its storage locations are:

  • Project-level directory, which is under your project’s root directory${workspaceFolder}/.claude/skills/. Skills placed here only take effect within the current project, making them suitable for project-specific skills, such as project-specific coding standards, deployment workflows, and the like.
  • User-level directory, which is under your home directory$HOME/.claude/skills/Skills placed here can be used across all projects, suitable for general skills like making PPTs, writing documents, and formatting WeChat public accounts that are not tied to specific projects.

Another concept is MCP (Model Context Protocol). MCP is a standard protocol that allows AI assistants to safely interact with the external world. For example, it enables AI to read local files on your computer, operate GitHub repositories, query databases, send Slack messages, control browsers, etc.

To install a Skill:

  1. Manually copySKILL.mdto the project-level directory or user-level directory
  2. Install plugin

Reference:

The official Anthropic marketplace (claude-plugins-official) is automatically available when starting Claude Code. Run /plugin and go to the Discover tab to browse available content, or check the directory atclaude.com/pluginsView the directory.

1
2
3
/plugin install github@claude-plugins-official

# After that, you can manage plugins via /plugin

Recommended Skills to install
Karpathy-Inspired Claude Code Guidelines:

codegraph:

draw.io

CC-Switch

A very useful AI aggregation tool that allows easy switching between different Agents and Models

With CC-Switch, you don’t need to set environment variables

Reference