cluade code是一個(gè)命令行工具而非那種圖形gui工具,和我之前以為的不一樣。
Claude Code: Deep coding at terminal velocity \ Anthropic
安裝node18+
Node.js 18+,
然后執(zhí)行
npm install -g @anthropic-ai/claude-code
然后輸入claude 即可,如果出現(xiàn)網(wǎng)絡(luò)問題,則需要科學(xué),然后設(shè)置環(huán)境變量:
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

隨意選擇樣式
之后會(huì)選擇用什么方式登錄,選擇后自動(dòng)跳轉(zhuǎn)瀏覽器授權(quán)
api的方式就算了,這個(gè)還需要搞定credits

所以選擇第一個(gè)然后到了這里


實(shí)測(cè)開發(fā)一個(gè)助眠 白噪音的網(wǎng)站,方便各位在噪音環(huán)境下帶耳機(jī)睡覺。
目錄有問題,我換個(gè)目錄重新輸入。
ok,提問

他寫了一分鐘
這個(gè)英文就不翻譯了,直接yes 創(chuàng)建 如下圖的

然后我直接用vscode 或者jetbrain 的全家桶打開上面配置的目錄, jetbrain的能記錄本地歷史記錄,理論上我更推薦這個(gè)能自動(dòng)記錄本地歷史的開發(fā)工具。
不然寫入變更要自己手動(dòng)提交git




最后我的助眠網(wǎng)站弄好了,各位睡不著打開這個(gè) 戴上那種睡覺的很軟的耳機(jī)就行
命令的玩法
在交互模式
交互模式 - Anthropic --- Interactive mode - Anthropic
模式下 可以切命令模式恢復(fù)會(huì)話,比如突然提示limit reached
Claude usage limit reached. Your limit will reset at 6pm (Asia/Shanghai)
那么下次打開的時(shí)候需要恢復(fù)回話咋繼續(xù)呢?
│ > │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
! 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
命令模式之恢復(fù)回話
而我們需要的是輸入/review
這樣就可以繼續(xù)上一次cmd關(guān)閉的窗口了。

esc取消
引用本地文件提問
當(dāng)然也可以切換其他模式@ 引用文件
比如我@test_mcp.sh 這個(gè)是?
他就給我分析了

● 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

記憶模式
沒搞太懂,我問了個(gè)這是,他回答說他說他的待辦事項(xiàng)已經(jīng)完成了。

2025-7-31 09:10:43
其它參考
【建議收藏】最全Claude Code 斜杠命令全指南:高效用法與避坑心得_claude code 命令-CSDN博客
claude code 重載mcp相對(duì)簡(jiǎn)單 不需要重啟 , 但是無法通過交互讓他重啟,只能通過輸入mcp然后選擇對(duì)應(yīng)的server然后如下圖選擇重連即可修復(fù),這樣就能做到claude code開發(fā)mcp又能同時(shí)讓claude code自己測(cè)試迭代修復(fù)
