首页标签分类
006 claude code使用
2025-08-16 · 更新 2026-03-03约 2 分钟 · 383 字
开发工具包
000

目录

Claude Code 使用
安装 Claude Code Router 和 Claude Code
GPT-Load 接入 Claude Code Router
使用
zcf 配置 claude code简化使用
spec开发法则在claude code中的使用

Claude Code 使用

安装 Claude Code Router 和 Claude Code

此处使用scoop管理windows10系统的系统环境,nodejs版本要求18+

image-20250816155113871

powershell
自动换行:关
放大阅读
展开代码
PS C:\Users\H> scoop install nodejs-lts PS C:\Users\H> node -v v22.18.0 PS C:\Users\H> npm install -g @anthropic-ai/claude-code added 10 packages, and changed 2 packages in 940ms 11 packages are looking for funding run `npm fund` for details PS C:\Users\H> npm install -g @musistudio/claude-code-router npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead added 152 packages in 17s 41 packages are looking for funding run `npm fund` for details

为 claude code router 编辑配置文件:

~/.claude-code-router/config.json

json
自动换行:关
放大阅读
展开代码
{ "APIKEY": "your-secret-key", "PROXY_URL": "http://127.0.0.1:7890", "LOG": true, "API_TIMEOUT_MS": 600000, "NON_INTERACTIVE_MODE": false, "Providers": [ { "name": "openrouter", "api_base_url": "https://openrouter.ai/api/v1/chat/completions", "api_key": "sk-xxx", "models": [ "google/gemini-2.5-pro-preview", "anthropic/claude-sonnet-4", "anthropic/claude-3.5-sonnet", "anthropic/claude-3.7-sonnet:thinking" ], "transformer": { "use": ["openrouter"] } }, { "name": "deepseek", "api_base_url": "https://api.deepseek.com/chat/completions", "api_key": "sk-xxx", "models": ["deepseek-chat", "deepseek-reasoner"], "transformer": { "use": ["deepseek"], "deepseek-chat": { "use": ["tooluse"] } } }, { "name": "ollama", "api_base_url": "http://localhost:11434/v1/chat/completions", "api_key": "ollama", "models": ["qwen2.5-coder:latest"] }, { "name": "gemini", "api_base_url": "https://generativelanguage.googleapis.com/v1beta/models/", "api_key": "sk-xxx", "models": ["gemini-2.5-flash", "gemini-2.5-pro"], "transformer": { "use": ["gemini"] } }, { "name": "volcengine", "api_base_url": "https://ark.cn-beijing.volces.com/api/v3/chat/completions", "api_key": "sk-xxx", "models": ["deepseek-v3-250324", "deepseek-r1-250528"], "transformer": { "use": ["deepseek"] } }, { "name": "modelscope", "api_base_url": "https://api-inference.modelscope.cn/v1/chat/completions", "api_key": "", "models": ["Qwen/Qwen3-Coder-480B-A35B-Instruct", "Qwen/Qwen3-235B-A22B-Thinking-2507"], "transformer": { "use": [ [ "maxtoken", { "max_tokens": 65536 } ], "enhancetool" ], "Qwen/Qwen3-235B-A22B-Thinking-2507": { "use": ["reasoning"] } } }, { "name": "dashscope", "api_base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions", "api_key": "", "models": ["qwen3-coder-plus"], "transformer": { "use": [ [ "maxtoken", { "max_tokens": 65536 } ], "enhancetool" ] } }, { "name": "aihubmix", "api_base_url": "https://aihubmix.com/v1/chat/completions", "api_key": "sk-", "models": [ "Z/glm-4.5", "claude-opus-4-20250514", "gemini-2.5-pro" ] } ], "Router": { "default": "deepseek,deepseek-chat", "background": "ollama,qwen2.5-coder:latest", "think": "deepseek,deepseek-reasoner", "longContext": "openrouter,google/gemini-2.5-pro-preview", "longContextThreshold": 60000, "webSearch": "gemini,gemini-2.5-flash" } }

注意事项:

  1. 注意每次编辑,修改配置文件后需要重启 claude code router(ccr restart
  2. PROXY_URL指定的代理,如果没有使用代理,需要删除该配置,否则默认使用本地http://127.0.0.1:7890的代理
  3. APIKEY进行身份验证的,如果没有这个需求,必须删除该配置

GPT-Load 接入 Claude Code Router

官方文档 Claude Code Router 接入指南

使用

powershell
自动换行:关
放大阅读
展开代码
Usage Modes: • REPL: claude (interactive session) • Non-interactive: claude -p "question" Run claude -h for all command line options Common Tasks: • Ask questions about your codebase > How does foo.py work? • Edit files > Update bar.ts to... • Fix errors > cargo build • Run commands > /help • Run bash commands > !ls Interactive Mode Commands: /add-dir - Add a new working directory /agents - Manage agent configurations /bashes - List and manage background bash shells /bug - Submit feedback about Claude Code /clear - Clear conversation history and free up context /compact - Clear conversation history but keep a summary in context. Optional: /compact [instructions for summarization] /config - Open config panel /cost - Show the total cost and duration of the current session /doctor - Diagnose and verify your Claude Code installation and settings /exit - Exit the REPL /export - Export the current conversation to a file or clipboard /help - Show help and available commands /hooks - Manage hook configurations for tool events /ide - Manage IDE integrations and show status /init - Initialize a new CLAUDE.md file with codebase documentation /install-github-app - Set up Claude GitHub Actions for a repository /login - Sign in with your Anthropic account /logout - Sign out from your Anthropic account /mcp - Manage MCP servers /memory - Edit Claude memory files /migrate-installer - Migrate from global npm installation to local installation /model - Set the AI model for Claude Code /output-style - Set the output style directly or from a selection menu /output-style:new - Create a custom output style /permissions - Manage allow & deny tool permission rules /pr-comments - Get comments from a GitHub pull request /release-notes - View release notes /resume - Resume a conversation /review - Review a pull request /security-review - Complete a security review of the pending changes on the current branch /status - Show Claude Code status including version, model, account, API connectivity, and tool statuses /statusline - Set up Claude Code's status line UI /upgrade - Upgrade to Max for higher rate limits and more Opus /vim - Toggle between Vim and Normal editing modes

Claude Code的文档

zcf 配置 claude code简化使用

https://github.com/UfoMiao/zcf

使用zcf可以配置claude code和claude code router的配置简化

image-20250906132405128

linux do社区关于 此工具的讨论

https://linux.do/t/topic/860998

首次开始开放时,需要初始化

spec开发法则在claude code中的使用

https://github.com/Pimzino/spec-workflow-mcp

在使用spec思想开放时,对功能模块的实现依赖的需求描述程度比较高,只有对需求理解充分了,才能实际开发出符合设计者原本意图的功能,因此对需求的描述什么重要。引入https://github.com/cexll/myclaude

使用zcf中 /zcf:workflow 命令,

image-20250906133426518

或者使用 https://github.com/cexll/myclaude 中的/requirements-pilot,他会对需要实现的需求不断深挖细节,通过对话的方式完善需求,通过需求评估得分,判断是否需要进行下一步的执行开发

image-20250906134903488

使用 /requirements-pilot需要在项目目前下引入对应配置:myclaude quick start

bash
自动换行:关
放大阅读
展开代码
# Your project directory ├── commands/ # 11 specialized slash commands ├── agents/ # 9 expert agent configurations └── CLAUDE.md # Project-specific guidelines

本文作者:hedeoer

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!