【Claude Code】入门

📅 2026/7/6 15:14:47
【Claude Code】入门
【Claude Code】入门0.【2万字】深度梳理Claude Code Skills1.Claude Code快速入门与配置1.1 安装Node JS1.2 安装Claude Code1.3 其他安装方式2. 常用命令3. Claude Code API附录0.【2万字】深度梳理Claude Code Skillshttps://mp.weixin.qq.com/s/mN5UuIPOehMVmKWl6-6oPQ1.Claude Code快速入门与配置1.1 安装Node JS(FastAPI_first)➜ Qwen nvminstallv22.18.0 Downloading and installingnodev22.18.0... Downloading https://nodejs.org/dist/v22.18.0/node-v22.18.0-darwin-arm64.tar.xz...################################################################################################################################################ 100.0%Computing checksum with shasum-a256Checksums matched!Now usingnodev22.18.0(npm v10.9.3)(FastAPI_first)➜ Qwennode-vv22.18.0(FastAPI_first)➜ Qwennpm-v10.9.31.2 安装Claude Code(FastAPI_first)➜ Qwensudonpminstall-ganthropic-ai/claude-code Password: added3packagesin7s2packages are lookingforfunding runnpmfundfordetails(FastAPI_first)➜ Qwen claude--version2.1.87(Claude Code)选项说明–add-dir directories…允许工具访问的额外目录–agent当前会话使用的智能代理覆盖配置中的 agent 设置–agents以 JSON 格式自定义代理–allow-dangerously-skip-permissions可选绕过所有权限校验仅推荐无外网沙箱环境使用–allowed-tools tools…允许使用的工具列表逗号 / 空格分隔–append-system-prompt在默认系统提示词后追加内容–bare极简模式关闭钩子、LSP、插件同步等附加功能–betas betas…API 请求中加入 Beta 功能头仅 API Key 用户–brief启用代理与用户通信的消息工具–chrome启用 Claude 与 Chrome 集成-c, --continue继续当前目录最近一次对话–dangerously-skip-permissions直接绕过所有权限校验仅推荐无外网沙箱-d, --debug [filter]开启调试模式支持分类过滤–debug-file将调试日志写入指定文件–disable-slash-commands禁用所有技能/ 命令–disallowed-tools tools…禁止使用的工具列表–effort会话思考 / 执行力度low / medium / high / max–fallback-model默认模型过载时自动切换备用模型仅配合 --print–file specs…启动时预下载文件格式file_id:路径–fork-session恢复会话时新建会话 ID不复用原 ID–from-pr [value]通过 PR 编号 / URL 恢复关联会话-h, --help显示帮助信息–ide启动时自动连接到可用 IDE–include-partial-messages实时输出部分消息块仅配合 --print 流式 JSON–input-format输入格式text / stream-json仅配合 --print–json-schema结构化输出校验用的 JSON Schema–max-budget-usdAPI 调用最大花费上限美元仅配合 --print–mcp-config configs…从 JSON 文件 / 字符串加载 MCP 服务配置–mcp-debug已废弃改用 --debug开启 MCP 调试–model指定使用的模型支持别名如 sonnet / opus-n, --name为会话设置显示名称–no-chrome关闭 Claude 与 Chrome 集成–no-session-persistence关闭会话持久化不保存到磁盘仅配合 --print–output-format输出格式text / json / stream-json仅配合 --print–permission-mode会话权限模式acceptEdits / bypassPermissions / default 等–plugin-dir为本会话加载指定目录插件-p, --print打印结果后直接退出适合管道调用–replay-user-messages回显用户输入消息仅配合流式 JSON-r, --resume [value]通过会话 ID 恢复对话–session-id指定会话 UUID–setting-sources配置来源列表user / project / local–settings从 JSON 文件 / 字符串加载额外配置–strict-mcp-config仅使用 --mcp-config 定义的 MCP 服务–system-prompt设置会话系统提示词–tmux为工作树创建 tmux 会话–tools tools…指定可用工具列表–verbose强制开启详细日志-v, --version显示版本号-w, --worktree [name]为会话创建新 git worktree1.3 其他安装方式https://www.komapi.top/aboutcurl-fsSLhttps://claude.ai/install.sh|shexporthttps_proxyhttp://your-proxy:portcurl-fsSLhttps://claude.ai/install.sh|shnpminstall-ganthropic-ai/claude-code--registryhttps://registry.npmmirror.com brewinstallclaude-codenpminstall-ganthropic-ai/claude-codenpminstall-ganthropic-ai/claude-code--registryhttps://registry.npmmirror.com2. 常用命令配置代理网络和Claude API Key在当前项目的目录下创建.claude/settings.json{env:{HTTP_PROXY:http://127.0.0.1:7890,HTTPS_PROXY:http://127.0.0.1:7890}}配置API Key环境变量# 设置API密钥如果需要 这是另一种登录方式也可以通过官网的方式登录见下图exportANTHROPIC_API_KEYyour_api_key# 设置自定义模型exportANTHROPIC_MODELclaude-3-5-sonnet-20241022# 设置基础URL用于代理exportANTHROPIC_BASE_URLhttps://your-proxy.com/v13. Claude Code API使用后效果附录Claude Code 超详细完整指南2026最新版 https://zhuanlan.zhihu.com/p/1971872808159141982Claude Code课程VibeCoding零基础实战开发 https://www.yuque.com/xxcls/vibecodingCLAUDE.md 速通指南8 个技巧让 Claude Code 起飞