◆ Claude 4.5 Sonnet (Claude Code) · ChatGPT (GPT-5) + Cursor · Gemini 2.5 Pro Deep Think
程式碼除錯 + 重構.
意圖 — 看 stack trace 找 bug、重構巨型函式
Coding LLM 戰場最白熱化的領域。三家 frontier model 都拿 SWE-bench 高分但實戰使用體驗差很多 —— Claude Code 能 agentic 直接動 repo / GPT-5 配 Cursor 整合最完整 / Gemini 2.5 Pro 一次看完整 codebase 再做 architectural decisions。
01
Claude 4.5 Sonnet (Claude Code)
◆ 推薦 prompt
Here's a TypeScript Next.js project. The /api/comments endpoint is throwing 500 sometimes — see attached stack trace + the route handler. Diagnose root cause, propose fix, then implement it across all relevant files. Run typecheck after.在 Claude 開(記得貼)
✓ 強項
- **Claude Code agentic mode**:直接 read/write/run,免來回貼 code
- 對程式碼 "intent" 理解深 — 抓得到 race condition / TOCTOU 等微妙 bug
- Long-context refactor 連貫性最強
✗ 弱項
- Claude Code 是 CLI / IDE plugin,不像 Cursor 內建編輯體驗
- Web 搜尋整合需要 Computer Use
- Pro 訂閱有訊息額度限制
什麼時候用
全 stack debugging / refactor / agentic 任務(讓它自己跑 test、自己修)。
02
ChatGPT (GPT-5) + Cursor
◆ 推薦 prompt
// In Cursor: select the failing function and use Cmd+K Fix this race condition in the rate limiter — the SET-IF-NOT-EXISTS check has a TOCTOU window. Use atomic INCR with TTL instead.在 ChatGPT 開(記得貼)
✓ 強項
- **Cursor / Copilot 整合最深** — IDE 內 inline 完成、ghost text、CMD+K
- GPT-5 在 LiveCodeBench / SWE-bench 持續領先
- o1 / o1 Pro 的深度思考對複雜邏輯題特別強
✗ 弱項
- Long-context refactor 不如 Claude 連貫
- Code Interpreter / Canvas 有時 over-engineer
- Pro plan 才有 o1 Pro
什麼時候用
IDE 內 daily coding / inline 補全 / 短任務:bug fix / 加 feature flag / 寫測試。
03
Gemini 2.5 Pro Deep Think
◆ 推薦 prompt
[Attach: full 50k-line codebase via Repo extension] This Next.js app is migrating from Pages Router to App Router. Read the entire codebase, identify all API routes / page components / shared utilities, and produce: (1) migration order with dependency graph (2) breaking changes list (3) per-file refactor checklist. Don't skip any file.在 Gemini 開(記得貼)
✓ 強項
- **1M token context**:可看完整 50k 行 codebase 再給 architectural advice
- 對 monorepo / cross-package 依賴的 understanding 比另兩個強
- Deep Think 模式對 "先想再答" 任務有幫助
✗ 弱項
- Inline IDE 整合弱於 GPT + Cursor
- Coding agentic 工具鏈不如 Claude Code 成熟
- 回應較慢(Deep Think 模式)
什麼時候用
大型 refactor / migration / architecture review / 看完整 codebase 後做計畫的工作。
◆ 一句話結論
Agentic 直接動 repo → Claude Code。配 Cursor / Copilot 即時補全 → GPT-5。重構大型 codebase 前先全面理解 → Gemini 2.5 Pro。