Files
tech/工程/ClaudeCode.md

7.9 KiB
Raw Blame History

Claude Code

安装

# 安装
cd
npm install -g @anthropic-ai/claude-code
claude --version

# 配置
npx @z_ai/coding-helper
curl -O "https://cdn.bigmodel.cn/install/claude_code_env.sh" && bash ./claude_code_env.sh
bash ./.devcontainer/cache/scripts/claude_code_env.sh

# 创建快捷命令
code ~/.local/bin/runcc.sh
#!/bin/bash
claude --ide --dangerously-skip-permissions --allow-dangerously-skip-permissions

# 在 VS Code 成功进入 Claude Code 扩展 对话框后,在对话框输入 /config 进入设置,勾选 Disable Login Prompt 配置来关闭登录页面。
# 1. 启用遥测
export CLAUDE_CODE_ENABLE_TELEMETRY=1

# 2. 选择导出器(两者都是可选的 - 仅配置您需要的)
export OTEL_METRICS_EXPORTER=otlp       # 选项otlp、prometheus、console
export OTEL_LOGS_EXPORTER=otlp          # 选项otlp、console

# 3. 配置 OTLP 端点(用于 OTLP 导出器)
export OTEL_EXPORTER_OTLP_PROTOCOL=grpc
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
// 增加自定义设置
  "env": {
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.5-air",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5-turbo",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.1",
    "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "200000",
    "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "75"
  },
  • 启用 agent teams
    • Agent teams 默认禁用。
    • 通过将 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS 环境变量设置为 1 来启用它们,可以在你的 shell 环境中或通过 settings.json 进行:
{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}

MCP, Plugin, Skill

# 安装 SpecKit Specify CLI
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git
# initialize in existing project
specify init . --ai claude
# Check installed tools
specify check

# 安装 UI UX Pro Max globally CLI
npm install -g uipro-cli
uipro init --ai claude
### 安装 MCP
claude mcp add --transport stdio chrome-devtools -- npx -y chrome-devtools-mcp
claude mcp add --transport stdio playwright -- npx -y @playwright/mcp@latest

### 安装 Plugin, Skill
claude plugin marketplace add zai-org/zai-coding-plugins
claude plugin install glm-plan-usage@zai-coding-plugins
claude plugin install code-simplifier@claude-plugins-official --scope local/
claude plugin uninstall code-simplifier --scope local
# 常用 Plugin

# 66
# https://github.com/zai-org/zai-coding-plugins
/plugin marketplace add zai-org/zai-coding-plugins
/plugin install glm-plan-usage@zai-coding-plugins
/glm-plan-usage:usage-query

# 8.7k
# https://github.com/anthropics/claude-plugins-official
/plugin marketplace add anthropics/claude-plugins-official
/plugin install context7@claude-plugins-official
/plugin install superpowers@claude-plugins-official
/plugin install code-review@claude-plugins-official
/plugin install code-simplifier@claude-plugins-official
/plugin install ralph-loop@claude-plugins-official
/plugin install playwright@claude-plugins-official
/plugin install typescript-lsp@claude-plugins-official
/plugin install pyright-lsp@claude-plugins-official
/plugin install rust-analyzer-lsp@claude-plugins-official
/plugin install jdtls-lsp@claude-plugins-official
/plugin install gopls-lsp@claude-plugins-official

# 77.6k
# https://github.com/github/spec-kit
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git
specify init . --ai claude

# 90.0k
# https://github.com/obra/superpowers
/plugin marketplace add obra/superpowers-marketplace
/plugin install superpowers@superpowers-marketplace

# 60.89k
# https://github.com/nextlevelbuilder/ui-ux-pro-max-skill
/plugin marketplace add nextlevelbuilder/ui-ux-pro-max-skill
/plugin install ui-ux-pro-max@ui-ux-pro-max-skill

# 46.1k
# https://github.com/thedotmack/claude-mem
# https://gitea.szis.com.cn/github/thedotmack-claude-mem.git
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-mem

# 30k
# https://github.com/wshobson/agents
# Claude Code Plugins: Orchestration and Automation
/plugin marketplace add wshobson/agents
# Essential development plugins
/plugin install python-development          # Python with 16 specialized skills
/plugin install javascript-typescript       # JS/TS with 4 specialized skills
/plugin install backend-development         # Backend APIs with 3 architecture skills
# Infrastructure & operations
/plugin install kubernetes-operations       # K8s with 4 deployment skills
/plugin install cloud-infrastructure        # AWS/Azure/GCP with 4 cloud skills
# Security & quality
/plugin install security-scanning           # SAST with security skill
/plugin install comprehensive-review       # Multi-perspective code analysis
# Full-stack orchestration
/plugin install full-stack-orchestration   # Multi-agent workflows

# 12.9k
# https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering
/plugin marketplace add muratcankoylan/Agent-Skills-for-Context-Engineering
/plugin install context-engineering-fundamentals@context-engineering-marketplace
/plugin install agent-architecture@context-engineering-marketplace
/plugin install agent-evaluation@context-engineering-marketplace
/plugin install agent-development@context-engineering-marketplace
/plugin install cognitive-architecture@context-engineering-marketplace

# 9.7k
# https://github.com/EveryInc/compound-engineering-plugin
/plugin marketplace add EveryInc/compound-engineering-plugin
/plugin install compound-engineering
# 帮我通过以下命令安装 lark-cli
npm install -g @larksuite/cli

# 然后通过以下命令安装相关 skills
npx skills add https://github.com/larksuite/cli -y -g

# 然后通过以下命令配置应用
lark-cli config init --new