Claude Code

Session 1 - Why & How

202604 | PM | 30 min

你跟 AI 之間的歷史脈絡
有好好保存利用嗎?

主流的 LLM 互動介面介紹

Chat Interface
(ChatGPT)
Hi! How can I help you today?
幫我整理這份會議記錄
好的,請提供會議記錄的內容...
Message...
零可控(每次從零開始)
Desktop App
(Claude App, 我沒用過...)
Chat
Artifacts
Files
meeting-notes.md
## Q2 Campaign
- 目標:...
有限可控(GUI 設定範圍內)
Integrated Dev Env (IDE)
(Cursor)
src/
app.ts
utils.ts
const data = fetch(...)
return data.map(x => x)
AI
Suggest: add error handling
專案內可控(讀寫當前程式碼)
Command-line Interface (CLI)
(Claude Code)
Terminal
$ claude
> /slack search campaign
Found 12 messages in #product...
Summarizing...
完全可控(可客製化整個系統架構)

四種 AI 協作模式

ChatCoworkide-editorClaude Code
代表Claude.ai, ChatGPTClaude Desktop CoworkCursor, Copilot, WindsurfClaude Code CLI / Desktop / VS Code
介面網頁 / app 對話框Claude Desktop GUIIDE 內嵌Terminal / VS Code
記憶memory + Projects當前專案檔案CLAUDE.md, rules, memory, skills
能接什麼搜尋、上傳本機檔案、plugins、computer use讀寫程式碼Terminal、檔案系統、MCP
自動化scheduled tasks、pluginsskills、hooks、cron triggers
可控範圍GUI 設定範圍內當前專案整個系統

Cowork vs Claude Code

面向CoworkClaude Code
設定方式GUI,開箱即用文字檔,你自己架構
客製化plugins(官方 / 企業提供)無上限(skills, rules, hooks 都是你寫的 markdown)
透明度背景執行,看結果每步都在 terminal,看得到過程
版本控制所有設定都是檔案 → git track
外部整合plugins + computer useMCP servers → API 層級串接

差別在誰擁有架構。Cowork → Anthropic 預設環境。Claude Code → 可被客製化環境。

(身為 PM)
自己做給自己的產品

同一件事,兩條路

情境:查上週 Slack 裡跟 campaign 相關的討論

Chat 的路

我是 Growth team PM,負責 campaign
了解,請問需要什麼協助?
上週 Slack 裡有人討論 Q2 campaign 的事,幫我整理
我無法存取 Slack。請手動複製相關訊息給我...
每週重來一次...
1. 開對話 2. 解釋身份 3. 手動截圖 4. 貼給 AI 5. 下週重來

Claude Code 的路

Terminal
> /slack search campaign
Searching #product, #growth, #campaign...
Found 12 messages from last 7 days.
## Q2 Campaign 討論摘要
- 預算從 500K 調到 380K...

CLAUDE.md 寫了你管什麼產品
→ Slack skill 定義好搜哪些頻道
→ MCP server 連 Slack API
設定一次,之後每次都在。

課前準備

還沒有 Claude 帳號?

  1. claude.ai 註冊帳號(Google / Email)
  2. 選擇方案 Pro($20/mo)或 Max($100/mo)皆可使用 Claude Code
  3. console.anthropic.com 取得 API key(或用 OAuth 登入)

安裝 Node.js(npm 會一起裝好)

已經有 npm 的人跳過這步。Terminal 打 npm -v 有版號就是裝好了。

$ brew install node          # macOS 用 Homebrew

沒有 Homebrew?到 nodejs.org 下載 macOS installer 也可以。

安裝 Claude Code

$ npm install -g @anthropic-ai/claude-code

Fork starter repo

github.com/plaxieappier/claude-code-starter 確認你有權限看到這個 repo

$ gh repo fork plaxieappier/claude-code-starter --clone
$ cd claude-code-starter

環境設定

啟動 Claude Code 並登入

$ cd claude-code-starter
$ claude

首次啟動會要求登入,照畫面指示完成 OAuth 或輸入 API key。

確認環境正常

讀一下 CLAUDE.md,告訴我這個 repo 的結構

Claude 能正確描述目錄結構就代表環境 OK。

沒有 repo 權限?

建一個空目錄,啟動 Claude,貼上以下 prompt 讓它幫你建完整環境:

$ mkdir claude-code-starter   # 建立專案資料夾
$ cd claude-code-starter      # 進入資料夾
$ claude                      # 啟動 Claude Code

幫我初始化 Claude Code 練習環境:

1. 建 CLAUDE.md,內容先放 placeholder

2. 建 .claude/rules/language.md,規則:回覆用繁體中文

3. 建 .claude/commands/ 空目錄

4. 建 workspace/ 放三個模擬文件(會議記錄、專案 brief、週報)

1
2
3

建你的 CLAUDE.md

原則:CLAUDE.md 控制在 150 行以內,太長 Claude 會忽略。

[placeholder] 換成你的資訊

幫我用以下架構建 CLAUDE.md:

1. Directory Overview — 目錄和用途

2. 常用流程 — 重複做的事

3. 工具清單 — 指令和自動化

4. 偏好 — 語言、格式、風格

我的資訊:

- 我是 [你的名字][團隊] PM,負責 [產品]

- 目前專案:[專案 A][專案 B]

- 工作目錄:[你的資料夾]

- 偏好繁體中文,技術名詞保留英文

我自己目前的 CLAUDE.md 架構

# CLAUDE.md

This file provides guidance to Claude Code
when working with code in this repository.

## Directory Overview
General project workspace containing
multiple independent projects.
Each subdirectory may have its own CLAUDE.md.

| Directory              | Description              |
|------------------------|--------------------------|
| kb/                    | Obsidian vault (iCloud)  |
| health-data/           | Apple Watch health data  |
| log/                   | Daily logs (via /today)  |
| auto-rev-est-modeling/ | Rev-est pipeline (work)  |
| shape/                 | Trading Desk PM Dashboard|
| juliano/               | Agent workspace (rsync)  |
| random/                | Scratch notes            |

## Daily Log Commands
When user says "/today" or "wrap up today":
1. Run git log --oneline --since="00:00"
2. Summarize current Claude session
3. Extract 3-5 keyword tags
4. Append entry to log/YYYY-MM.md

## Capabilities
Full registry at .claude/REGISTRY.md

Skills (15): health, kb, github,
  kickoff, jiraconf, rev-est, slack, ...
Utilities: tab-title, timer,
  patch-theme, sync-openclaw, ...
Automations: daily-health,
  morning-report, stock-tw, stock-us, ...
Prompt Templates: council

Global slash commands:
/health /jiraconf /kickoff /mentor /slack

## Codex CLI (Dual-Agent Setup)
Claude Code + Codex CLI side by side.
- Each agent owns its own config
- See .claude/rules/codex-handoff.md

Claude Code 內建指令

寫在 Claude Code 裡面,開箱即用

類別指令用途
Context/clear清除對話,重新開始
/compact壓縮對話,保留重點
/memory管理跨對話記憶
設定/config偏好設定
/permissions工具權限管理
/model切換模型
/mcpMCP server 管理
系統/help查看說明
/cost查看本次花費
/status狀態總覽
/doctor環境診斷
/login /logout登入登出

自訂工具的四種等級

等級說明背後元件
Prompt Template存一段 prompt 變成 /指令.claude/commands/*.md
Utility一個 shell 動作.claude/bin/ shell script
Automation排程自動跑,不需要人觸發.github/workflows/ YAML
Skill多步驟流程 + 外部 API.claude/skills/ SKILL.md + MCP

從一個 .md 檔開始製作 Prompt Template 。

為什麼要寫指令?

沒有指令有指令
每次重新打一段 prompt/kickoff 就跑
每次格式不一樣產出結構固定、可預期
換人就要重新教分享 .md 檔就能複製流程

指令背後的設計邏輯

你寫的 prompt            存成 .md 檔               變成 /指令

"逐一問我四個問題:      .claude/commands/        /kickoff
 目標、對象、限制、       kickoff.md
 產出..."

原則:一件事重複三次以上,就存成 Claude 重複執行的 SOP。

1
2
3

建你的第一個 Prompt Template

幫我建一個 /kickoff 指令。

存成 .claude/commands/kickoff.md。

內容:當我打 /kickoff 的時候,逐一問我四個問題:

1. 這個專案的目標是什麼?(一句話)  2. 對象是誰?

3. 三個條件或限制?(時間、預算、範圍等)  4. 產出為何?

整理成結構化 kickoff doc,建議 next step。

建好後試跑:

/kickoff 寫這個 repo 的使用說明書,對象:新進同事,條件:一頁以內且包含安裝步驟,產出:README.md

不滿意 → 跟 Claude 說怎麼改 → 它更新 kickoff.md → 再跑一次。

1
2
3

管理 Claude 的注意力和精力

/clear

切換任務前先清 context。Claude 的 context window 是有限資源 → 累積太多不相關的對話會讓它表現變差。
養成習慣:換話題就 /clear。

/compact

對話太長但不想全部清掉 → /compact 讓 Claude 壓縮保留重點。

Claude 的系統觀

目前 claude-code-starter 就是這個結構的簡化版(進階模式後續再聊。)

ref: Best Practices for Claude Code

claude-code-starter/
  │
  CLAUDE.md                      你是誰、管什麼、偏好什麼
  │
  .claude/
  ├── commands/                  存 prompt 變成 /指令kickoff.md  ← 你剛建的
  │
  ├── rules/                     行為邊界language.md  ← 已內建
  │
  ├── memory/                    跨對話保留的 contextClaude 自動寫入
  │
  ├── hooks/                     事件觸發的自動動作commit 前跑 lint  push 後通知 Slack
  │
  └── MCP servers                外部 API 串接
        Slack  Jira  Google Sheets

Key Takeaway

你的工作是管理 Claude

課後

Q&A 補充

Q: 怎麼看這次對話用了多少 context window?

/cost 可以看到本次 session 的 token 用量和花費。
另外,畫面最下方的 status bar 也會即時顯示目前的 context 使用比例。

Q: 自訂工具只能在專案內用,還是全系統都能用?

兩者都可以,取決於你放的位置:

放置位置範疇適用情境
專案/.claude/commands/僅該專案專案特有的流程
~/.claude/commands/所有專案跨專案通用的指令

同理適用於 rules/skills/
Automation 比較特殊,因為它綁定 GitHub Actions,只在該 repo 內運作。

Q: 怎麼快速告訴 Claude 要讀哪個檔案?

在輸入框打 @ 會跳出檔案選單,選取後 Claude 會自動讀取該檔案的內容。
也可以直接打完整路徑,例如 @src/app.ts

Q: Claude 可以讀取圖片嗎?

可以。Claude Code 是多模態的,支援 PNG、JPG 等圖檔。三種方式: