cluade code是一个命令行工具而非那种图形gui工具,和我之前以为的不一样。
Claude Code: Deep coding at terminal velocity \ Anthropic
安装node18+
Node.js 18+,
然后执行
npm install -g @anthropic-ai/claude-code
然后输入claude 即可,如果出现网络问题,则需要科学,然后设置环境变量:
cmd
set http_proxy=http://127.0.0.1:7897
set https_proxy=http://127.0.0.1:7897
powershell
$env:HTTP_PROXY="http://127.0.0.1:7897"; $env:HTTPS_PROXY="http://127.0.0.1:7897"
bash
export https_proxy=http://127.0.0.1:7897 http_proxy=http://127.0.0.1:7897 all_proxy=socks5://127.0.0.1:7897
随意选择样式
之后会选择用什么方式登录,选择后自动跳转浏览器授权
api的方式就算了,这个还需要搞定credits
所以选择第一个然后到了这里
实测开发一个助眠 白噪音的网站,方便各位在噪音环境下带耳机睡觉。
目录有问题,我换个目录重新输入。
ok,提问
他写了一分钟
这个英文就不翻译了,直接yes 创建 如下图的
然后我直接用vscode 或者jetbrain 的全家桶打开上面配置的目录, jetbrain的能记录本地历史记录,理论上我更推荐这个能自动记录本地历史的开发工具。
不然写入变更要自己手动提交git
最后我的助眠网站弄好了,各位睡不着打开这个 戴上那种睡觉的很软的耳机就行
命令的玩法
在交互模式
交互模式 - Anthropic --- Interactive mode - Anthropic
模式下 可以切命令模式恢复会话,比如突然提示limit reached
Claude usage limit reached. Your limit will reset at 6pm (Asia/Shanghai)
那么下次打开的时候需要恢复回话咋继续呢?
│ > │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
! for bash mode double tap esc to clear input ctrl + _ to undo
/ for commands alt + m to auto-accept edits
@ for file paths ctrl + r for verbose output
# to memorize backslash (\) + return (⏎) for
newline
输入/
斜杠命令 - Anthropic --- Slash commands - Anthropic
命令模式菜单
就可以切换很多的命令的模式了
/add-dir Add a new working directory
/agents Manage agent configurations
/bug Submit feedback about Claude Code
/clear (reset) Clear conversation history and free up context
/compact Clear conversation history but keep a summary in context. Optional: /compact [instructions for summarization]
/config (theme) 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 (quit) 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
/permissions (allowed-tools) 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
/status Show Claude Code status including version, model, account, API connectivity, and tool statuses
/upgrade Upgrade to Max for higher rate limits and more Opus
/vim Toggle between Vim and Normal editing modes
命令模式之恢复回话
而我们需要的是输入/review
这样就可以继续上一次cmd关闭的窗口了。
esc取消
引用本地文件提问
当然也可以切换其他模式@
引用文件
比如我@test_mcp.sh 这个是?
他就给我分析了
● The test_mcp.sh script is a testing utility for the SQL Server MCP server using MCP Inspector. It's a straightforward bash script that:
1. Checks dependencies - Verifies npx is installed
2. Provides user feedback - Shows configuration and instructions
3. Launches MCP Inspector - Runs npx @modelcontextprotocol/inspector python main_modular.py
The script is clean and serves as a convenient way to test the modular MCP server with the inspector tool. It uses the main_modular.py entry point we've been working on, which is the token-optimized version with all the
security enhancements and functionality we implemented.
This aligns perfectly with the MCP Inspector integration that was requested earlier in the conversation for testing the server's tools, prompts, and resources.
命令模式
!
则是命令模式比如!之后输入ls可以列出目录文件
! ls
⎿ __pycache__/
CLAUDE.md
db_config.json
… +18 lines (ctrl+r to expand)
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ > │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
! for bash mode double tap esc to clear input ctrl + _ to undo
/ for commands alt + m to auto-accept edits
@ for file paths ctrl + r for verbose output
# to memorize backslash (\) + return (⏎) for
newline
记忆模式
没搞太懂,我问了个这是,他回答说他说他的待办事项已经完成了。
2025-7-31 09:10:43
其它参考
【建议收藏】最全Claude Code 斜杠命令全指南:高效用法与避坑心得_claude code 命令-CSDN博客
claude code 重载mcp相对简单 不需要重启 , 但是无法通过交互让他重启,只能通过输入mcp然后选择对应的server然后如下图选择重连即可修复,这样就能做到claude code开发mcp又能同时让claude code自己测试迭代修复