跳至主要內容
精選 Discord Tips Hooks Official Community

來自官方 Discord 的內部技巧:Anthropic 團隊怎麼用 Claude Code

整理 Claude Developers Discord 中的實用技巧,包含官方推薦工具、Hooks 配置、效能優化等第一手情報。

2026年1月16日 12 分鐘閱讀 作者:Claude World

我們整理了 Claude Developers Discord 中的實用技巧,這些來自官方社群的討論,包含 Anthropic 團隊成員和資深用戶分享的使用方式和推薦工具。

官方推薦工具

1. Ghostty 終端機

Claude Code 團隊成員推薦:

“ghostty if you’re on linux or macos”

Ghostty 是針對現代開發優化的終端機。

2. 減少終端資源消耗

TERM=dumb claude

這個技巧可以移除讓終端機資源密集的元素,減少重繪。適合在資源受限的環境使用。

3. 官方 Plugins

“download all the official ‘[Hook/Skill/Agent/etc] Development’ ones. They’re incredible… makes it so trivial to customize CC”

安裝官方 code-simplifier:

claude plugin install code-simplifier

實測結果:1 小時內將 33,581 行減少到 30,613 行(8.8% 減少)。

團隊的工作方式

方法一:One-Shot Tasks

“sometimes, but usually I write out more structured plans externally and then just try to have all my tasks be one-shots”

重點:在外部先寫好結構化計劃,每個任務都設計成一次完成。

方法二:Hooks 自動化

團隊成員分享的 hooks 配置範例:

{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Write|Edit",
      "hooks": [{
        "type": "command",
        "command": "bun run format || true"
      }]
    }],
    "Notification": [{
      "matcher": ".*",
      "hooks": [{
        "type": "command",
        "command": "node ~/.claude/notify.js alert"
      }]
    }],
    "Stop": [{
      "matcher": ".*",
      "hooks": [{
        "type": "command",
        "command": "node ~/.claude/notify.js done"
      }]
    }]
  }
}

功能解析

  • PostToolUse:每次寫入/編輯後自動格式化
  • Notification:有通知時發送提醒
  • Stop:任務完成時發送提醒

進階 Hooks(實驗中)

{
  "hooks": {
    "UserPromptSubmit": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "echo '{\"additionalContext\": \"Reminder: Make sure you abide by your CLAUDE.md\"}'"
      }]
    }],
    "Stop": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "echo '{\"decision\": \"block\", \"reason\": \"Run code-simplifier on any files that were modified, unless already simplified.\"}'"
      }]
    }]
  }
}

功能解析

  • UserPromptSubmit:每次提交 prompt 時提醒 Claude 遵守 CLAUDE.md
  • Stop:完成前強制執行 code-simplifier

團隊對產品的看法

關於穩定性

“I wish CC were more stable, but I think there’s a lot they get right… They’re basically defining this entire space with much better resourced companies trying to keep up”

關於開發流程

“Replacing ink renderer takes time, it’s a significant change. Would have been smart to do that from the start, but I’m not sure they expected Claude Code to become a product from the start based on how they talk about it.”

關於 AI 與工作

“developers themselves have been automating away other jobs for the last several decades. This is nothing new. We can adapt or get left behind, such is the way of the world”

社群智慧:Context 管理

社群中被廣泛認可的方法:

“my claude.md is basically a bare minimum file that says ‘all work must be planned, then those plans broken down into beads, then coding subagents work on exactly one task and terminate’”

推薦使用 steveyegge/beads 作為 task manager。

核心概念

  • 所有工作必須先規劃
  • 計劃分解成小任務(beads)
  • 每個 subagent 只做一個任務就終止
  • smaller context == fewer tokens == less usage

實用技巧彙整

File Checkpoint 還原

claude --resume <session-id> --rewind-files <checkpoint-uuid>

# 可能需要設定環境變數
CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING=1

# 快照位置
~/.claude/file-history/<session-id>/

工具組合建議

“I flip flop gemini-cli and cc for ui… And claude for functionality”

結論:不同工具有不同強項,Gemini 適合 UI,Claude 適合功能邏輯。

Parallel Sub-agents

“once or twice I’ll usually ask for a parallel sweep code-simplifier / security review”

小技巧:在 CLAUDE.md 加入縮寫

"if I say lpsa it means launch parallel sub-agents"

v2.1.9 已知問題

社群回報的問題:

  • /context 指令沒反應
  • .mcp.json 不被識別
  • 偶爾 freeze

總結

從官方社群討論可以看出幾個重點:

  1. Hooks 是關鍵 - 大量使用 hooks 自動化流程
  2. One-shot 思維 - 計劃在外部寫好,每個任務設計成一次完成
  3. 混合工具 - 不同工具有不同強項,善用組合
  4. 產品還在演進 - 持續改進中,社群回饋很重要

想參與討論?加入 Claude Developers Discord


本文整理自 Claude Developers Discord 社群討論。