將 Claude Desktop 用作免費編程代理,無需 Cursor 或 Claude Code
何時使用: 你已有 Claude Desktop,想讓它真正編輯你的程式庫,而非只是貼上程式碼片段。
前置條件
- 已安裝 Claude Desktop — 從 claude.ai/download 下載
- 工作目錄已加入白名單 — 首次執行時會提示 Claude 可操作哪些目錄
步驟
-
安裝並鎖定工作區Install desktop-commander. Limit it to ~/Code/myproject — nothing outside.✓ 已複製→ 設定顯示 allowed_directories 已限制;工具清單出現在 Claude 中
-
執行真實變更Open ~/Code/myproject. Find every TODO comment, group by file, propose fixes for the top 5.✓ 已複製→ 以 ripgrep 速度掃描,按行號排列優先清單
-
用 edit_block 套用變更Apply the proposed fixes using edit_block. Don't rewrite whole files — just the necessary diffs.✓ 已複製→ 每次編輯顯示 old_string/new_string 區塊;之後 git diff 整潔
結果: Claude Desktop 現在可以像付費 IDE 助手一樣,向你的程式庫寫入真實的程式碼變更。
注意事項
- 忘記設定 allowed_directories——Claude 會掃描整個家目錄 — 編輯 ~/.claude-server-commander/config.json 並重新啟動 Claude Desktop