Learn > Claude > Claude Code in Action

Claude Code in Action

AI-assisted coding, terminal, debugging, CI/CD thực chiến.

  • Coding assistant không chỉ là công cụ viết code mà là một hệ thống dùng language model (LM) để giải task lập trình, theo quy trình như dev người thật: Gather context → Formulate a plan → Take an action, rồi lặp (iterate).
  • Bên trong Assistant = Language Model + Set of tools. Đa số assistant dùng LM host từ xa; Claude Code dùng Claude series, host ở Anthropic, AWS hoặc Google Cloud (configurable).
  • Tool Use Challenge: LM tự thân chỉ text-in/text-out, không thật sự đọc file hay chạy lệnh. Tool use giải bằng cách coding assistant chèn instruction dạy LM cách request action (VD "ReadFile: main.go"), assistant thực thi hộ rồi trả kết quả ngược lại cho LM.
  • Không phải LM nào cũng dùng tool giỏi như nhau. Claude series (Opus, Sonnet, Haiku) đặc biệt mạnh ở hiểu và dùng tool — kể cả tool chưa từng thấy.
  • Lợi ích tool use mạnh: tackle task khó hơn (kết hợp nhiều tool), extensible platform (thêm tool mới dễ), và better security (navigate codebase không cần indexing → thường không gửi cả codebase lên server ngoài).
  • Claude Code ship kèm bộ built-in tools: Agent, Bash, Edit, Glob (tìm file theo pattern), Grep (tìm nội dung file), LS, MultiEdit, NotebookEdit/NotebookRead, Read, TodoRead/TodoWrite, WebFetch, WebSearch, Write — harness khai báo cho model ở mỗi request.
  • Sức mạnh nằm ở chuỗi nhiều tool và mở rộng bằng MCP: data analysis qua notebook (viết code → chạy → thêm cell → summary), UI styling qua Playwright MCP (điều khiển browser: mở, navigate, screenshot), review PR qua GitHub MCP, và đọc xuyên Terraform/IaC để soi luồng dữ liệu across hệ thống (DB → Lambda → S3).

Claude Code in Action là gì? Là khoá thực chiến tiếp nối Claude Code 101, đi sâu vào coding với sự hỗ trợ của AI trong thực tế. Đây là ghi chú tiếng Việt tóm tắt toàn khoá, thuật ngữ giữ nguyên tiếng Anh kèm chú thích.

TL;DR — Một coding assistant không chỉ viết code; nó là hệ thống ghép language model (LM) với một set of tools, chạy vòng Gather context → Formulate a plan → Take an action rồi lặp. Mấu chốt: LM tự thân chỉ text-in/text-out, không đọc file hay chạy lệnh được — nó "làm được việc" nhờ tool use: assistant dạy LM trả về text đúng định dạng (VD ReadFile: main.go), rồi assistant thực thi hộ và đưa kết quả ngược lại. Claude series (Opus/Sonnet/Haiku) đặc biệt giỏi tool use, mang lại task khó hơn, dễ mở rộng, và bảo mật tốt hơn (không cần index cả codebase).

Coding assistant thực sự là gì

Một coding assistant không chỉ là công cụ viết code — nó là một hệ thống tinh vi dùng language model để giải các task lập trình phức tạp. Hiểu cách nó vận hành phía sau giúp nhận ra điều gì làm nên một "coding companion" thật sự mạnh.

Coding assistant làm việc thế nào

Khi nhận một task — VD fix một bug từ error message — coding assistant đi theo quy trình giống hệt một dev người thật:

  1. Gather context (thu thập ngữ cảnh) — hiểu error trỏ tới cái gì, phần nào của codebase bị ảnh hưởng, và file nào liên quan.
  2. Formulate a plan (lập kế hoạch) — quyết cách giải: sửa code chỗ nào, rồi chạy test để verify fix.
  3. Take an action (hành động) — thực sự hiện thực giải pháp: update file và chạy lệnh.

Rồi iterate (lặp) tới khi xong. Điểm mấu chốt: bước 1 và 3 buộc assistant phải tương tác với thế giới ngoài — đọc file, fetch documentation, chạy lệnh, hoặc sửa code.

Bên trong khối Assistant có hai thành phần: một Language Model và một Set of tools. Về nơi host model:

  • Đa số coding assistant dùng language model host từ xa (remotely hosted).
  • Claude Code dùng Claude series of models, host ở Anthropic, AWS, hoặc Google Cloudconfigurable (cấu hình được).

The Tool Use Challenge — vì sao cần tool

Đây là chỗ thú vị. Language model tự thân chỉ xử lý text và trả về text — nó không thật sự đọc file hay chạy lệnh được. Nếu bảo một LM trần "đọc file này", nó sẽ nói nó không có khả năng đó.

Vậy coding assistant giải bài toán này ra sao? Bằng một hệ thống khéo léo gọi là "tool use".

Tool use chạy như thế nào

Khi bạn gửi request tới coding assistant, nó tự động chèn thêm instruction vào message để dạy language model cách request một action. VD nó thêm dòng: "If you want to read a file, respond with ReadFile: name of file" (muốn đọc file thì trả lời ReadFile: tên file).

Flow đầy đủ:

  1. Bạn hỏi: "main.go có code gì?"
  2. Coding assistant thêm tool instructions vào request.
  3. Language model đáp: ReadFile: main.go.
  4. Coding assistant đọc file thật và gửi nội dung file ngược lại cho model.
  5. Language model đưa ra câu trả lời cuối dựa trên nội dung file.

Hệ thống này cho phép language model "đọc file", "viết code", "chạy lệnh" một cách hiệu quả — dù thực chất nó chỉ đang sinh ra các text response được định dạng cẩn thận. Người thực thi hành động là coding assistant, không phải model.

Vì sao tool use của Claude tạo khác biệt

Không phải language model nào cũng dùng tool giỏi ngang nhau. Claude series of models đặc biệt mạnh ở việc hiểu tool làm gìdùng chúng hiệu quả để hoàn thành task phức tạp. Sức mạnh này mang lại vài lợi ích then chốt cho Claude Code:

  • Tackles harder tasks (kham task khó hơn) — Claude kết hợp nhiều tool để xử việc phức tạp, và dùng được cả tool nó chưa từng thấy.
  • Extensible platform (nền tảng mở rộng được) — thêm tool mới vào Claude Code dễ dàng, và Claude tự thích ứng khi workflow thay đổi.
  • Better security (bảo mật tốt hơn) — Claude Code navigate codebase mà không cần indexing, nghĩa là thường không phải gửi toàn bộ codebase lên server ngoài.

Key takeaways

  • Coding assistant dùng language model để hoàn thành các task khác nhau.
  • Language model cần tool để kham hầu hết task lập trình thực tế.
  • Không phải LM nào dùng tool cũng giỏi như nhau.
  • Tool use mạnh của Claude mở ra bảo mật tốt hơn, tuỳ biến cao hơn, và độ bền (longevity) lâu hơn trong Claude Code.

Chính khả năng tool use này biến một model chỉ-sinh-text thành một coding assistant thực thụ: đọc được file, hiểu codebase, và tạo thay đổi có ý nghĩa cho dự án.

Áp dụng thực tế: hiểu "LM chỉ sinh text, assistant mới thực thi" giúp debug đúng chỗ khi Claude Code hành xử lạ: nếu nó hiểu sai việc cần làm thì đó là vấn đề model/prompt (context, mô tả); còn nếu nó muốn làm đúng nhưng thao tác trượt (đọc nhầm file, lệnh lỗi) thì đó là tầng tool/permission. Hai tầng, hai cách sửa. Về mặt Delivery, ý "better security nhờ không cần indexing" là điểm tôi hay nhấn khi thuyết phục khách Nhật: mã nguồn không bị đẩy nguyên khối lên server ngoài để build index — một khác biệt bảo mật cụ thể, không phải khẩu hiệu.

Bộ tool sẵn có trong Claude Code

Claude Code ship kèm một bộ tool tiêu chuẩn (built-in) — chính là "tay chân" mặc định. Claude tự chọn tool phù hợp cho từng bước:

Tool Công dụng
Agent Khởi chạy một subagent lo một task
Bash Chạy một shell command
Edit Sửa một file
Glob Tìm file theo một pattern
Grep Tìm trong nội dung file
LS Liệt kê file & thư mục
MultiEdit Nhiều sửa đổi cùng lúc
NotebookEdit Ghi vào một cell trong Jupyter notebook
NotebookRead Đọc một cell
Read Đọc một file
TodoRead Đọc một mục trong to-do đã tạo
TodoWrite Cập nhật danh sách to-do
WebFetch Lấy nội dung từ một URL
WebSearch Tìm kiếm web
Write Ghi ra một file

Nối với bài trước: những tool này không nằm sẵn trong model — Claude Code (harness) khai báo chúng cho model ở mỗi request; model đọc mô tả rồi quyết gọi cái nào. Nhớ cặp dễ nhầm: Glob = tìm file theo pattern, còn Grep = tìm nội dung bên trong file.

Claude Code phối hợp tool ra sao — 4 ví dụ thực chiến

Sức mạnh không nằm ở từng tool lẻ, mà ở việc Claude tự chuỗi (chain) nhiều tool để hoàn thành một task lớn. Bốn ví dụ minh hoạ:

1. Data analysis task (built-in + notebook)

Task: "Phân tích dữ liệu trong file streaming.csv" (tìm insight về user của một video streaming platform). Claude Code tự đi:

  1. Viết code trong một notebook để soi định dạng dữ liệu.
  2. Chạy code và xem kết quả.
  3. Thêm cell, chạy từng cái để dẫn dắt phân tích.
  4. Viết final summary.

→ Dùng NotebookEdit / NotebookRead + Bash + Read; Claude chạy thử → đọc kết quả → quyết bước tiếp (đúng agentic loop).

2. UI styling task (Playwright MCP Server)

Task: "Cải thiện design của app này, tập trung vào chat interface và header." Cắm thêm Playwright MCP Server = bộ tool cho phép Claude điều khiển browser. Claude Code: Open browser → Navigate tới app → Take a screenshot → Update styling.

→ Điểm học: sửa CSS "mù" (chỉ đọc code) thì được tạm ổn, nhưng cho Claude tự nhìn UI qua screenshot thì nó verify được bằng mắt — đúng tinh thần "add tools" ở Claude Code 101.

3. GitHub integration (GitHub MCP Server)

Task: "Review các thay đổi trong pull request." Cắm GitHub MCP Server = bộ tool cho Claude tương tác với GitHub (kể cả tạo comment). Claude Code: Đọc changes trong PR → đánh giá code quality / performance → viết summary report.

4. Đọc xuyên hạ tầng — soi luồng dữ liệu (Infrastructure-as-Code)

Ví dụ cảnh báo: một DynamoDB Table (userId, email, plansViewed, registrationDate) → một Lambda Function ghi dữ liệu ra một S3 Bucket dùng chung → được cả Internal Marketing Team External Marketing Partner truy cập. Vì hạ tầng được định nghĩa trong Terraform files (infrastructure-as-code) mà Claude Code đọc dễ dàng, Claude có thể lần theo luồng dữ liệu xuyên nhiều tầng (DB → code → cloud config) và chỉ ra rủi ro — VD partner ngoài đang chạm tới dữ liệu không nên chạm.

→ Điểm học lớn nhất: vì Claude Code đọc trực tiếp code + IaC, nó reason trên cả hệ thống, không chỉ một file đơn lẻ — thứ mà một công cụ chỉ-đọc-một-file không làm được.

Áp dụng thực tế: cách tôi đọc 4 ví dụ này = cùng một Claude Code, khác nhau ở bộ tool được trao. Built-in lo việc trong repo; MCP mở rộng ra ngoài (browser, GitHub, cloud). Với khách Nhật, ví dụ số 4 là điểm tôi hay dùng để định vị Claude Code như một reviewer hạ tầng: nó đọc được Terraform + Lambda + schema DB nên soi được luồng dữ liệu nhạy cảm (VD PII rò sang partner ngoài) — thứ review tay xuyên nhiều repo / nhiều dịch vụ rất dễ bỏ sót.

Lộ trình ghi chú — 7 phần

  1. Claude Code: context management & CLAUDE.md Lệnh /init, nhắc file bằng @, và cách viết CLAUDE.md để Claude thật sự theo.
  2. Claude Code: Planning Mode, /compact & rewind Screenshot, Planning Mode vs Effort, rewind/compact, và /goal · /loop · worktree.
  3. Claude Code: permission mode & hooks Sáu permission mode + classifier auto mode; hook Pre/PostToolUse dựng theo 4 bước.
  4. Claude Code: routine, headless & Agent SDK Dải giao việc lặp: routine → headless -p → Agent SDK, và chọn cái nào khi nào.
  5. Claude Code: custom command & skill Custom slash command với $ARGUMENTS, và skill — vì sao verification là skill đầu tiên.
  6. Claude Code: MCP server & tích hợp GitHub Cắm MCP server (Playwright) + hai đường vào pull request: Code Review vs Action v1.
  7. Claude Code: plugin & kiểm chứng việc AI làm Đọc diff thay vì tóm tắt, test thành cửa thật; plugin đóng gói .claude và bẫy khi cài.

Từ khoá cần thuộc

🔴 Core: coding assistant (hệ thống dùng LM, không chỉ viết code) · quy trình Gather context → Formulate a plan → Take an action + iterate · bước 1 & 3 tương tác thế giới ngoài (đọc file, fetch docs, chạy lệnh, sửa code) · Language Model + Set of tools (2 thành phần trong Assistant) · Tool Use Challenge (LM tự thân chỉ text-in / text-out, không đọc file/chạy lệnh) · tool use (assistant chèn instruction dạy LM request action) · flow 5 bước (ReadFile: main.go = LM nói, assistant làm rồi trả nội dung ngược lại) · Claude series đặc biệt mạnh tool use · better security = navigate codebase không cần indexing (không gửi cả codebase ra ngoài) · built-in tools (harness khai báo cho model mỗi request): Agent · Bash · Edit · Glob · Grep · LS · MultiEdit · NotebookEdit · NotebookRead · Read · TodoRead · TodoWrite · WebFetch · WebSearch · Write · Glob = tìm file theo pattern vs Grep = tìm nội dung trong file · MCP server mở rộng bộ tool (Playwright MCP = control browser; GitHub MCP = interact with GitHub) · Claude Code đọc IaC (Terraform)reason xuyên cả hệ thống, không chỉ 1 file · context management (quá nhiều context không liên quan → giảm hiệu năng) · /init (phân tích toàn codebase → sinh CLAUDE.md) · CLAUDE.md nhét vào MỌI request (system prompt bền vững cho project) · 3 vị trí: CLAUDE.md (commit, share team) / CLAUDE.local.md (cá nhân, không commit) / ~/.claude/CLAUDE.md (mọi project trên máy) · @path = tự chèn nội dung file vào request · @ trong CLAUDE.md = file cross-cutting tự vào mọi request (VD @prisma/schema.prisma) · screenshot (dán Ctrl+V, kể cả macOS — không Cmd+V) chỉ đúng vùng UI · Planning Mode (/plan hoặc Shift+Tab 2 lần): đọc nhiều file → plan chi tiếtchờ duyệt trước khi sửa · effort level (/effort) — thang low · medium · high (mặc định) · xhigh · max, ⭐ UI hiển thị xhigh là "Extra" (xhigh là tên gửi qua API), riêng Opus 4.7 mặc định xhigh · đặt mức model không hỗ trợ → tụt xuống mức cao nhất ≤ mức đó (xhigh chạy thành high trên Opus 4.6) · low/medium/high/xhigh nhớ qua session và đặt được ở khoá effortLevel trong settings; max chỉ session hiện tại, settings không nhận · ⭐ ultracode = mục thứ 6 trong picker /effort nhưng KHÔNG phải effort level của model: nó là setting của Claude Code — gửi xhigh cho model + cho Claude tự dựng dynamic workflow ở mọi task đáng kể; session-only, settings không nhận, và Claude chat không có mức này · ultrathink = nghĩ thêm 1 prompt lẻ (không đổi effort session) · Planning = bề RỘNG (nhiều file/bước) vs Effort = chiều SÂU (logic/debug/thuật toán) · cả hai tốn thêm token · Escape = ngắt Claude giữa chừng để bẻ lái · Escape 2 lần / /rewind = tua về điểm trước, dọn context nhiễu · /compact = tóm tắt + giữ cốt (task liên quan) vs /clear = context sạch mới (task khác hẳn) · /resume = quay lại hội thoại cũ (/clear không xoá nó) · custom command (tự tạo slash command) · .claude/commands/<name>.md (Markdown; tên file = tên lệnh, VD audit.md/audit; tự nhận KHÔNG cần restart) · $ARGUMENTS (placeholder nhận tham số — string bất kỳ, không chỉ file path) · thêm MCP server: claude mcp add playwright npx @playwright/mcp@latest (chạy trong terminal, KHÔNG trong Claude Code) · pre-approve permission trong .claude/settings.local.jsonpermissions.allow: ["mcp__playwright"] (HAI gạch dưới mcp__) · Playwright MCP = control browser; lợi thế = Claude thấy visual output THẬT, không chỉ code · 2 đường đưa Claude vào pull request: Code Review (managed, Anthropic host) vs GitHub Action (tự dựng, cho việc vượt quá review) · Code Review bật bởi organization adminClaude Code admin settings → mục Code review → Configure · 3 lựa chọn thời điểm chạy: khi PR mở · mỗi lần push · chỉ khi comment @claude review · review agent phân tích diff trong bối cảnh TOÀN codebaseinline comment đúng dòng + severity + bảng tóm tắt trong check run, có dedupe & xếp hạng · ⭐ 3 ranh giới Code Review: KHÔNG bao giờ approve hay block PR (người vẫn quyết) · KHÔNG có managed autofix (chỉ post findings) · research preview, gói team & enterprise · áp dụng finding = nước đi ở local: lệnh /code-review + cờ --fix (áp vào working tree) · /install-github-app cài Action (cần repo admin; dẫn qua install app + đặt secret API key) · action là anthropics/claude-code-action@v1 · chỉ còn 2 cần gạt: prompt (làm gì) + claude_args (chạy thế nàochuỗi CLI argument truyền thẳng vào Claude Code) · input khác: anthropic_api_key (optional) · github_token (mặc định secrets.GITHUB_TOKEN) · trigger_phrase (mặc định @claude) · use_bedrock / use_vertex · workflow ở .github/workflows/claude.yaml · chạy được cả cron lẫn workflow_dispatch (bấm tay từ tab Actions) · --max-turns 5 = trần cứng cho agent loop · job không người trựcđừng để nó dừng lại hỏi (không ai trả lời) + tool read-only cho job báo cáo · thứ tự chọn: managed trước, chỉ tụt xuống action khi cần Claude LÀM gì đó trong CI, không chỉ bình luận · ⚠️ cú pháp beta đã chết: mode (bỏ, tự nhận diện) · direct_promptprompt · custom_instructions--append-system-prompt · max_turns / model / allowed_tools / disallowed_tools → nằm trong claude_args · hook = chạy command của bạn trước/sau khi Claude gọi tool · PreToolUse (chạy TRƯỚC, CHẶN được → cho phép, hoặc block + gửi error message về Claude) · PostToolUse (chạy SAU, KHÔNG chặn được vì tool đã chạy → chỉ follow-up như format + feedback cho Claude) · matcher = chỉ định tool bị nhắm (VD "Read", "Write|Edit" — dấu | = OR) · hook khai trong settings.json (3 vị trí: ~/.claude/settings.json global / .claude/settings.json project-commit / .claude/settings.local.json cá nhân) hoặc gõ /hooks · Pre = kiểm soát Claude ĐƯỢC LÀM GÌ vs Post = tăng cường thứ ĐÃ LÀM · dựng hook 4 bước: chọn Pre/Post → xác định tool (matcher) → viết command nhận JSON tool call qua stdinexit code báo allow/block · JSON fields: session_id · transcript_path · hook_event_name · tool_name · tool_input · exit 0 = success (stdout JSON → Claude parse), exit 2 = blocking error (stderr feed ngược cho Claude làm context) · ⚠️ exit 1 KHÔNG chặn (trông như lỗi nhưng Claude vẫn chạy command — muốn dừng thì 2, không phải 1) · exit 2 chặn được cả Stop ("chưa xong đâu") · PostToolUse chặn là muộn (tool đã chạy) nhưng vẫn feed text về · vài event bỏ qua chặn hoàn toàn (Notification, SessionStart) · plain text ở stdout được cộng vào context CHỈ với 3 event: SessionStart · UserPromptSubmit · UserPromptExpansion · hook = deterministic code tại điểm cố định trong loopguarantee, còn CLAUDE.md chỉ là request ("Claude thường nghe" ≠ đủ khi bạn không ngồi canh) · PreToolUse trả JSON rồi exit 0: hookSpecificOutput.permissionDecision = allow / deny / ask (đẩy về user quyết) + permissionDecisionReason · defer = giá trị thứ tư, chỉ cho non-interactive -p run (tiến trình gọi tạm dừng tool rồi resume) · ⭐ updatedInput = VIẾT LẠI call thay vì chặnredact secret (guardrail canh Bash, thấy pattern sk_live_ → thay bằng placeholder; lệnh vẫn chạy, secret không đi qua) · ⚠️ updatedInput thay TOÀN BỘ input objectphải echo lại field không đổi kẻo mất · matcher chọn tool, thêm mệnh đề if để thu hẹp về đúng một loại lệnh · routine = prompt được lưu, chạy trên cloud — gói 3 thứ: prompt + repository + connectors, không script, không server, hạ tầng là của Anthropic · 3 trigger: cron schedule · HTTP POST tới API endpoint · GitHub event (PR mới) · tạo bằng claude.ai/code/routines (web) hoặc lệnh /schedule ngay trong Claude Code · ⚠️ 3 giới hạn routine: research preview · recurring schedule tối đa MỖI GIỜ 1 lần · mỗi run = fresh clone của default branch, chỉ push được branch prefix claude/ (guardrail chống viết đè main) · headless mode = cờ -p (= --print): one-shot, không UI, đọc stdin ghi stdoutpipe như tool shell · theo khoá -p bỏ auto-discovery (hook · skill · plugin · MCP server · CLAUDE.md) → khởi động nhanh hơn (⚠️ docs gán việc này cho --bare) · --output-format json + --json-schema → object nằm ở field structured_output, móc ra bằng jq · nhiều bước: bắt session_id từ JSON rồi claude --resume "$(jq -r .session_id …)" · --bare = deterministic mode cho CI (kết quả lặp lại được mỗi lần chạy) · thứ tự chọn: routine (mặc định việc lặp) → -p (cần pipeline của bạn) → --bare (CI) → Agent SDK (việc thuộc về sản phẩm của bạn) — bắt đầu bằng routine, chỉ tụt xuống khi thật sự cần · ví dụ chặn .env (bản hiện hành): matcher "Read" + hook kiểm tool_input.file_path (.includes(".env")exit 2, stderr "You cannot read the .env file") · mỗi tool khác input shape (Readfile_path, Greppattern+paththư mục, Bashcommand) nên check file_path chỉ bắt Read · phủ đồng đều = permissions.deny "Read(**/.env)" (áp mọi tool) · gotcha bảo mật: dùng absolute path (KHÔNG relative) cho script hook → chống path interception + binary planting attack · $PWD placeholder trong settings.example.json · npm run setup → chạy scripts/init-claude.js thay $PWD = absolute path máy bạn → copy & đổi tên thành settings.local.json · 2 file: settings.example.json (template, commit) vs settings.local.json (sinh, cá nhân không commit) · TypeScript type-checking hook (PostToolUse): chạy tsc --noEmit sau mỗi edit → capture error → feed lại Claude sửa call site nó quên (đổi signature ở schema.ts nhưng quên main.ts) · query duplication hook: dùng Agent SDK khởi chạy Claude instance thứ HAI review file trong ./queries → phát hiện query trùng → feedback bắt tái dùng (VD getPendingOrders()) = "AI reviews AI" · trade-off: TS hook nhẹ/nhanh; query hook nặng (mỗi edit tốn time + API) → chỉ monitor thư mục quan trọng · ~33 hook event trong một session (không cần thuộc hết — nhớ nhúm hay dùng) · PreToolUse = primitive để CƯỠNG CHẾ (loại duy nhất dừng được việc trước khi xảy ra) · PostToolUse = chỗ đặt auto-format/auto-lint (sau tool call thành công) · Stop = gác cửa TURN (Claude muốn kết thúc → từ chối được) + SubagentStop · PreCompact / PostCompact · InstructionsLoaded (CLAUDE.md/rule file được load → audit thứ gì THẬT SỰ vào context) · SessionStart mồi môi trường (source startup = chỉ lúc khởi động mới) · ⚠️ bơm lại context SAU compaction = SessionStart matcher compact, KHÔNG phải PostCompact (chỉ SessionStart mới đưa output ngược vào hội thoại) · 7 event vòng đời hay gặp nhất (không phải toàn bộ danh sách): Notification (xin quyền tool / idle 60s) · Stop (trả lời xong) · SubagentStop (subagent = "Task" xong) · PreCompact (trước compact thủ công/tự động) · UserPromptSubmit (user submit prompt, TRƯỚC khi Claude xử lý) · SessionStart (bắt đầu/resume) · SessionEnd (kết thúc) · stdin shape đổi theo 2 trục: (1) loại hook, (2) tool được gọi (tool_input) · Stop hook: chỉ hook_event_name + stop_hook_active, KHÔNGtool_name/tool_input · PostToolUse có thêm tool_response (oldTodos/newTodos) · mẹo soi input: matcher "*" + jq . > post-log.json · Agent SDK = chạy Claude Code programmatically (TypeScript + Python) · cùng agent loop CLI (đọc/sửa file, tool use) dưới quyền bạn · package @anthropic-ai/claude-agent-sdk · ⚠️ @anthropic-ai/claude-code = CLI, KHÔNG import được (tên cũ đã đổi — freshness) · query({ prompt }) = async iterator, for await → stream JSON messages (tool call, tool result, text) · giới hạn tool: options.allowedTools: ["Read","Glob"] = bản SDK của --allowedTools · permission mode = quyết định MỘT LẦN Claude được chạy gì (thay vì duyệt từng thao tác) · 6 mode: Manual (default) = chỉ reads, còn lại hỏi · Accept edits (acceptEdits) = reads + file edits + common file system bash commands (review sau) · Plan = read-only, chỉ nghiên cứu & đề xuất · Auto = chấp nhận mọi thứ nhưng classifier model RIÊNG review từng action TRƯỚC khi chạy · Don't ask (dontAsk) = chỉ tool pre-approved, còn lại auto-deny KHÔNG prompt · Bypass permissions = bỏ mọi check (= cờ --dangerously-skip-permissions), chỉ trong container/VM cô lập · Shift+Tab cycle: manual → accept edits → plan → auto · status bar luôn hiện mode hiện tại · classifier gác INTENT — chặn production deploys & migrations, force push, pipe code tải về vào shell, gửi sensitive data ra endpoint ngoài, phá huỷ file; cho qua local edits, cài dependency từ lock file, read-only requests, push lên branch của chính mình · ⭐ classifier kiểm INTENT, KHÔNG kiểm CORRECTNESS (refactor auth mà viết auth hỏng vẫn được cho qua — hỏng ≠ nguy hiểm) → ghép auto mode với Stop hook chạy test: auto gác intent TRƯỚC mỗi action, Stop hook gác correctness SAU khi xong · dontAsk cho unattended run (CI pipeline · scheduled job · batch chạy đêm) — pipeline chạy tiếp thay vì treo chờ cái duyệt không ai bấm · ⭐ kiểm tỉ lệ thuận với lượng dây đã thả (càng ít nhìn, càng phải kiểm nhiều): session ngắn ngồi xem → liếc là đủ; unattended run / job CI không ai trong vòng lặpkiểm thật, phải dựng lại sau khi việc đã rồi · run không người trực giữ auto, KHÔNG bypass (classifier vẫn soi từng action) · ⭐ nhưng classifier chỉ gắn cờ hành động NGUY HIỂM, không bao giờ phán code ĐÚNG hay khôngbật auto không cho phép hạ mức kiểm · bắt đầu từ DIFF, không từ bản tóm tắt: (1) /code-review rà thay đổi → (2) tự mắt đọc git diff · cái bẫy = tóm tắt gọn gàng nhưng diff đụng file bạn không ngờtóm tắt không nói, diff mới nói · đọc file trong kế hoạch trước rồi soi thứ ngoài kế hoạch · ⭐ bản viết sạch KHÔNG phải bằng chứng của code sạch · test = CỬA, không phải lời hứa: câu hỏi thật là test có pass Claude có THẬT SỰ chạy hay chỉ nói là đã chạywire thành hook để không skip được · Stop hook chạy test, fail → từ chối kết thúc turn · PostToolUse hook lint + type check sau mỗi edit · mấu chốt vẫn là exit 2đẩy fail ngược về Claude, Claude tự sửa không cần nhắc, và check bắn ở MỌI lần chạy · ý kiến thứ hai LẠNH = session/sub-agent MỚI, không có ký ức về cách code được dựngkhông có phần trong cách làm nên bắt được thứ lần chạy gốc đã tự nói cho qua · ⭐ reviewer mắt sạch tìm ra đúng cái tác giả đã tự biện hộ · 4 việc chốt lại: tự đọc diff · test thành hook gác turn · headless kiểm bằng JSON result + exit code · ý kiến thứ hai lạnh cho việc quan trọng · plugin = MỘT đơn vị cài đặt duy nhất (một version, một lần cài) gói skill · subagent · hook · MCP server config + đuôi dài: LSP server · background monitor · theme · một lát settings.json · /plugin install org-name@plugin-name → rồi /reload-plugins để áp dụng · /plugin marketplace add your-org/claude-plugins = nguồn dùng chung mọi plugin resolve qua đódiscovery tập trung + version tracking + update một chỗ · duyệt ở tab Discover · ⭐ ĐỌC TRƯỚC KHI CÀI: plugin chạy code trên máy bạn, với quyền của bạn; hook của nó bắn ở MỌI tool call khớp matchercài vì skill thì nhận luôn PreToolUse + Stop hook của nó, đọc hay không cũng vậy · ví dụ rủi ro: community plugin ship Stop hook gọi network endpoint mỗi lần, không gì trong cấu hình cảnh báo bạn · trước khi cài xem details: cài những gì + ước lượng chi phí context + cảnh báo Anthropic KHÔNG kiểm soát nội dung plugin bên thứ ba · 2 nguồn: form submit trong app → community marketplace SAU automated review · official marketplace curate trên track RIÊNG · ⚠️ "đã review" ≠ "đáng tin" (automated review bắt một số, không phải mọi thứ) · component chạy SONG SONG, không đè cấu hình của bạn · ⭐ hook CỘNG DỒN (PreToolUse của plugin của bạn cùng bắn, không cái nào thay cái nào) · skill/agent/command được NAMESPACE theo tên pluginkhông đụng tên · plugin ship settings.json nhưng chỉ honor 2 khoá: agent + subagentStatusLine · ⭐ đặt khoá agent = đẩy một subagent của plugin lên MAIN THREAD kèm system prompt · giới hạn tool · model của nó → bật plugin lên là hành vi mặc định đã đổi · plugin panel = xem mọi thứ nó thêm, quản lý, gỡ · đóng gói KHÔNG cần cấu trúc lại: một folder / skill · một file markdown / subagent dưới agents · hooks/hooks.json + .mcp.jsonplugin root · khám phá theo QUY ƯỚC thư mục · manifest .claude-plugin/plugin.json (name · version · description · author) là OPTIONAL · ⭐ name = field DUY NHẤT bắt buộc, namespace skill thành company-name:skill-name · version như mọi dependency = thứ làm update & version tracking chạy được trên cả team · 2 luật chốt: dùng → đọc trước khi cài (nhìn hook, agent, MCP server) · làm → đóng gói .claude ngay khi nó chạy được.

🟡 Important: Opus · Sonnet · Haiku (Claude series) · tackles harder tasks (kết hợp tool + dùng cả tool chưa từng thấy) · extensible platform (thêm tool mới dễ, Claude tự thích ứng) · model host configurable: Anthropic / AWS / Google Cloud · đa số assistant dùng LM remote-hosted · LM sinh text được định dạng cẩn thận (không thật sự "chạy") · assistant là bên thực thi action · notebook workflow (viết code → chạy → thêm cell từng bước → final summary) · dùng screenshot để verify UI (Playwright) · PR review flow (đọc changes → đánh giá quality/perf → summary report; GitHub MCP tạo được comment) · Agent tool = spawn subagent · MultiEdit = nhiều sửa đổi cùng lúc · Shift+Tab = cho Claude tự ghi file suốt session (vs Enter duyệt từng thao tác) · /memory mở CLAUDE.md để sửa (hoặc edit tay) · Claude đọc CLAUDE.md đầu mỗi conversation → áp dụng từ message kế · @auth → Claude hiện danh sách file để chọn · @AGENTS.md ở dòng đầu CLAUDE.md = nạp file tool khác, khỏi trùng · Ctrl+G mở plan ra editor sửa tay → Claude dùng bản cuối · Ctrl+O mở transcript viewer (chi tiết reasoning + tool execution) · default effort tùy model + gói · Shift+Tab 1 lần nếu đang auto-accept · Planning để review & bẻ lái trước khi Claude làm · Escape + /memory = dập lỗi lặp lại (ghi cách đúng vào CLAUDE.md) · 4 lợi ích custom command: Automation · Consistency · Context · Flexibility · ví dụ /audit (npm audit → audit fix → test) và /write_tests <path> · commit .claude/commands/ cho cả team dùng chung · MCP hỏi phép mỗi lần tới khi pre-approve · vòng tự cải thiện prompt sinh UI: navigate → generate → review → update prompt (@src/lib/prompts/generation.tsx) → test lại · pull request = chỗ đáng giao việc lặp nhất (review, merge, việc lặt vặt đều nằm ở đó) · Action chạy trên PR comment · scheduled job · mọi GitHub event · ví dụ mention: @claude implement the spec in the linked Linear issue → Claude push commit + post comment mô tả việc nó vừa làm · theo dõi từng step trong tab Actions như mọi workflow khác · ví dụ claude_args: --max-turns 5 --model claude-sonnet-5 · ứng dụng hook: code formatting · testing · access control · code quality (lint/type check) · logging · validation · viết hook tay hoặc dùng /hooks · PostToolUse: follow-up + feedback, không block · command của hook nhận chi tiết tool call Claude định làm · command đọc JSON từ stdin → parse → quyết allow/block theo tool_name + tool_input · hỏi thẳng Claude liệt kê tool đang có (đổi khi thêm MCP server) · bước 3–4: nhận JSON qua stdin, phản hồi qua exit code · absolute path = đánh đổi: bảo mật cao nhưng khó share (thư mục mỗi máy khác) → pattern template + generator giải · init-claude.js nằm trong scripts/, copy example → rename local · typed language dùng type checker; untyped dùng automated tests · nguyên tắc mở rộng: compiler/linter = feedback tức thì · code review bằng AI instance riêng · focus thư mục giá trị cao · cân bằng automation vs cost · matcher chỉ có nghĩa với Pre/Post (lọc theo tool name); Stop/Session… không có tool để match · TodoWrite = tool Claude quản to-do · event ngoài-tool mở tự động hoá vòng đời: SessionStart nạp context, UserPromptSubmit chèn/chặn prompt, Stop báo xong, PreCompact lưu state, Notification ping khi Claude chờ · SDK hỗ trợ đủ như CLI: custom system prompt · MCP servers · hooks · subagents · session resumption · SDK mặc định có full tool set · SDK là thứ query_hook.js dùng (AI reviews AI) · allowedTools = cùng cần gạt ở CLI/GitHub Actions/SDK · auto KHÁC bypassPermissions (auto còn classifier gác từng action; bypass không còn gì gác) · đặt mode mặc định bằng khoá defaultMode trong settings file · default hiển thị nhãn "Manual" + nhận alias manual · tổ chức khoá 2 mode nguy hiểm bằng permissions.disableAutoMode / permissions.disableBypassPermissionsMode = "disable" (đặt ở managed settings thì user không override được) · guardrail auto mode vẫn đang tiến hoá → tra docs lấy block/allow list hiện hành · hook nằm đúng các điểm trong agentic loop: session bắt đầu → prompt vào → tool được gọi → turn kết thúc · JSON chỉ được parse khi exit 0 · permissionDecisionReason = lời giải thích đi kèm deny/ask · redact ≠ block: guardrail có thể là "vẫn cho làm, nhưng bản an toàn" thay vì "cấm" · hook giữ-state qua compact chỉ cần echo plain text (khỏi JSON) vì SessionStart nhận stdout làm context · ba việc nên làm ngoài auto-format: guard tool bằng PreToolUse · gác turn bằng Stop · giữ state qua compact · spectrum tự động hoá: routine (hạ tầng Anthropic) ↔ headless/SDK (code của bạn) · use case routine: morning dependency audit · PR triager · quét Sentry ticket hằng ngày · routine hợp với "cùng một prompt trên một trigger lặp lại" · SDK phơi cùng hàm querycả TS lẫn Python, nhận prompt + options (allowedTools, system prompt, permission mode) rồi lặp qua message stream về · bước kiểm sau-khi-chạy chính là thứ làm cho hands-off Claude Code đáng dựa vào · sub-agent code review vốn dùng trước khi mở PRchĩa được luôn vào unattended run · /code-review ở đây đóng vai rà máy trước, git diffmắt người sau — hai lớp, không thay nhau · setup đáng giá hơn khi CẢ TEAM cùng chạy — nút thắt là chuyển nó đi, không phải dựng nó · copy-paste giữa các máy rồi hy vọng còn đồng bộ = đúng thứ plugin sinh ra để thay · chỗ plugin NẰM quyết định cách bạn CÀI (tên trực tiếp vs qua marketplace) · marketplace đặt tên gì cũng được · plugin có hai mặt: dùng đồ người khác publishtự đóng gói khi đã có thứ đáng chia sẻ.

🟢 Good-to-know: ẩn dụ "như dev người thật" · longevity (độ bền theo thời gian) · coding companion · standalone LM sẽ nói "không có khả năng đọc file" · tool instruction được tự động thêm vào message · TodoRead/TodoWrite quản danh sách to-do · NotebookEdit/NotebookRead cho Jupyter · S3 bucket dùng chung → rủi ro External Marketing Partner chạm dữ liệu (ví dụ data-governance) · /init sinh CLAUDE.md, CLAUDE.md được commit & chia sẻ · shortcut cũ # "memory mode" đã bị gỡ (dùng /memory) · ví dụ chỉ thị tùy biến: Use comments sparingly. Only comment complex code · keyword "think / think harder" cũ đã vô hiệu (dùng /effort) · "still thinking" hint khi Claude đang reason · kết hợp Plan + Effort cho task vừa rộng vừa sâu · /clear không xoá hội thoại khỏi session history · các kỹ thuật điều hướng hợp lúc: hội thoại dài, chuyển task, Claude lặp lỗi, project phức tạp · user-level ~/.claude/commands/ (lệnh cá nhân xuyên project) · custom command vs hook: gọi-khi-cần + có tham số vs tất định luôn chạy · MCP ecosystem: database · API testing/monitoring · file system · cloud · dev tool automation · "code assistant → development partner" · kết quả prompt sinh UI đẹp hơn: warm sunset / ocean depth / asymmetric / spacing phá cách · cron ví dụ 0 9 * * * (9:00 UTC) cho báo cáo hằng ngày · API key luôn để dạng GitHub secret, không hardcode vào workflow · least-privilege trong CI (trần turn + tool read-only) = một security control, không phải thủ tục · (docs, ngoài text khoá) severity 🔴 Important / 🟡 Nit / 🟣 Pre-existing · check run kết thúc ở trạng thái neutralkhông chặn merge qua branch protection · REVIEW.md (chỉ dành cho review, ưu tiên cao nhất) vs CLAUDE.md (vi phạm mới = nit) · @claude review always = subscribe review theo mỗi push, @claude review trơn = một lần · /code-review --comment post findings thành inline comment lên PR · hook còn loại khác ("you'll see other hooks in a later lesson") · ví dụ command hook: node /home/hooks/read_hook.js, node /home/hooks/edit_hook.js · "type": "command" trong hook · luồng thường: query + tool definitions → Claude formatted response → Claude Code execute tool → result · hook khai trong settings.json (KHÁC CLAUDE.md) · access control → đặt ở PreToolUse (chỉ loại này chặn được); formatting/logging → PostToolUse · ví dụ JSON: hook_event_name: "PreToolUse", tool_name: "Read", tool_input.file_path: "/code/queries/.env" · exit 2 ở PostToolUse vô nghĩa (tool đã chạy) · video khoá bản cũ có kèm Grep, text hiện hành bỏ, chỉ Read (freshness) · Grep.path = thư mục tìm kiếm (không phải file) → không hợp check kiểu file_path · hook = lớp feedback, permissions.deny mới là lớp chặn đồng đều · link: hooks guide code.claude.com/docs/en/hooks-guide · $PWD trên Windows = path có \ (escape JSON) + dấu cách → generator phải forward-slash + quote path (portability gotcha thực tế) · tsc.js dùng TS compiler API** (ts.createProgram + noEmit) không phải gọi CLI · query_hook.js tắt sẵn bằng process.exit(0) để khỏi tốn API · deterministic gate (tsc: có ground truth) vs probabilistic gate (LLM review: việc mờ, có thể sai) · "shift-left": bắt lỗi lúc sửa thay vì ở CI muộn · stop_hook_active field trong Stop hook · transcript_path có trong mọi input · kỷ luật "log-first": jq ghi input rồi đọc, đừng đoán schema · chọn event HẸP nhất cho đúng tín hiệu · SDK install: npm install @anthropic-ai/claude-agent-sdk · index.mjs + node index.mjs · JSON stream = same event như CLI · mỗi query() = một lượt model tính tiền (production bọc rate/spend guard) · manual/accept edits/plan = 3 mode "hằng ngày" đã gặp từ trước, auto mới là chỗ hands-off Claude Code thật sự sống · dontAsk deny cả AskUserQuestion (mode này sinh ra cho lúc không có ai trả lời) · bypassPermissions vẫn prompt với ask rule tường minh và xoá thư mục gốc/home (rm -rf /) — circuit breaker cuối · permission là thứ Claude Code cưỡng chế, CLAUDE.md chỉ thuyết phục model (cùng bài học "luật cứng → hook") · Stop có bản song sinh SubagentStop cho sub-agent · InstructionsLoaded hợp để kiểm kê file luật nào thật sự được nạp · compaction đánh rơi rất nhiều chi tiết → hook in summary "đang sửa file nào" để Claude bắt nhịp thay vì bắt đầu lạnh · câu chốt bài hook: hoàn vốn ngay lần đầu nó bắt được một thứ trong lần chạy bạn còn chẳng ngồi xem · routine không có workflow file để maintain (khác GitHub Actions ở bài trước) · /schedule nhận mô tả bằng lời thường · headless pipe được nên hợp làm linter/reviewer trong build script · docs ghi --bare sẽ thành mặc định của -p ở bản sau · --bare bỏ cả OAuth/keychain → auth phải đến từ ANTHROPIC_API_KEY hoặc apiKeyHelper · "unattended" gồm cả job CI chứ không chỉ lúc bạn đi pha cà phê · "tin nhau rồi" không phải một mức kiểm · hook check chạy kể cả khi bạn quên yêu cầu — đó mới là điểm ăn tiền của nó · hỏi tiếp trong session đang chạy không phải ý kiến thứ hai (nó mang theo lý lẽ cũ) · ví dụ manifest trong khoá: svg-splitter-review v0.1.0, author Lewis Menelaws · /reload-plugins là bước dễ quên sau khi cài · "một lát settings.json" nghĩa đen: phần lớn khoá settings của plugin bị bỏ qua · cài plugin cùng loại rủi ro với **postinstall của package npm — câu hỏi đúng không phải "tiện không""nó ship hook gì, gọi ra đâu".

🎓 Chứng chỉ: hoàn thành khoá này nhận Course Certificate mang đúng tên "Claude Code in Action" — miễn phí, gắn LinkedIn kèm URL verify. Không có "chứng chỉ Claude Code" riêng; xem toàn bộ 22 khoá & cách lấy Course Certificate.


Nguồn: Claude Code in Action (Anthropic Academy) — Copyright Anthropic. Phần đề thi thử cho khoá này nằm ở tab "Đề thi thử".

Câu hỏi thường gặp

Coding assistant hoạt động thế nào bên trong?
Coding assistant là một hệ thống dùng language model để giải task lập trình, theo quy trình như dev người thật: Gather context (hiểu error, xác định file và phần codebase liên quan), Formulate a plan (quyết cách sửa và cách verify), rồi Take an action (sửa file, chạy lệnh) — lặp lại tới khi xong. Bước gather context và take action bắt buộc phải tương tác với thế giới ngoài như đọc file, fetch documentation, chạy lệnh hay sửa code.
Tool use trong coding assistant là gì và giải quyết vấn đề gì?
Language model tự thân chỉ nhận text và trả text — nó không thật sự đọc file hay chạy lệnh được. Tool use giải vấn đề đó: khi bạn gửi request, coding assistant tự chèn thêm instruction dạy LM cách yêu cầu một action, ví dụ "nếu muốn đọc file thì trả lời ReadFile: tên file". LM đáp lại bằng text đúng định dạng đó (VD "ReadFile: main.go"), coding assistant đọc file thật rồi gửi nội dung ngược lại cho LM để nó đưa câu trả lời cuối. Nhờ vậy LM "đọc file / viết code / chạy lệnh" được dù thực chất chỉ sinh text theo quy ước.
Vì sao khả năng dùng tool của Claude lại quan trọng với Claude Code?
Không phải language model nào cũng dùng tool giỏi như nhau. Claude series (Opus, Sonnet, Haiku) đặc biệt mạnh ở việc hiểu tool làm gì và dùng chúng hiệu quả để hoàn thành task phức tạp. Điều này mang lại ba lợi ích cho Claude Code: tackle được task khó hơn (kết hợp nhiều tool, dùng cả tool chưa từng thấy), là extensible platform (thêm tool mới dễ, Claude tự thích ứng), và better security (navigate codebase không cần indexing nên thường không phải gửi toàn bộ codebase lên server ngoài).
Claude Code dùng model nào và host ở đâu?
Claude Code dùng Claude series of models. Khác với đa số coding assistant dùng language model host từ xa cố định, Claude Code cho phép cấu hình (configurable) nơi host model: Anthropic, AWS, hoặc Google Cloud.
Claude Code có sẵn những tool nào (built-in)?
Bộ built-in gồm: Agent (khởi chạy subagent lo một task), Bash (chạy shell command), Edit (sửa file), Glob (tìm file theo pattern), Grep (tìm nội dung trong file), LS (liệt kê file & thư mục), MultiEdit (nhiều sửa đổi cùng lúc), NotebookEdit (ghi vào cell Jupyter), NotebookRead (đọc cell), Read (đọc file), TodoRead và TodoWrite (đọc/cập nhật danh sách to-do), WebFetch (lấy nội dung từ URL), WebSearch (tìm web), và Write (ghi ra file). Lưu ý dễ nhầm: Glob tìm FILE theo pattern, còn Grep tìm NỘI DUNG bên trong file.
Làm sao Claude Code làm được việc ngoài repo như điều khiển browser hay thao tác GitHub?
Bằng cách cắm thêm MCP server để mở rộng bộ tool. Ví dụ Playwright MCP Server cung cấp bộ tool cho Claude điều khiển browser (mở browser, navigate tới app, chụp screenshot, cập nhật styling) trong task cải thiện UI; GitHub MCP Server cung cấp bộ tool tương tác với GitHub (đọc thay đổi trong pull request, đánh giá chất lượng code, tạo comment, viết summary report) trong task review PR. Cùng một Claude Code, chỉ khác nhau ở bộ tool được trao.
Vì sao Claude Code có thể soi luồng dữ liệu xuyên nhiều dịch vụ cloud?
Vì Claude Code đọc trực tiếp cả code lẫn infrastructure-as-code. Trong ví dụ DynamoDB → Lambda → S3 bucket dùng chung (được cả Internal Marketing Team và External Marketing Partner truy cập), hạ tầng được định nghĩa trong các file Terraform mà Claude Code đọc dễ dàng. Nhờ đó Claude lần theo được luồng dữ liệu xuyên nhiều tầng và chỉ ra rủi ro như partner ngoài đang chạm tới dữ liệu không nên chạm — thứ mà công cụ chỉ đọc một file đơn lẻ khó phát hiện.
Học xong Claude Code in Action có được cấp chứng chỉ không?
Có — hoàn thành khoá trên Anthropic Academy sẽ nhận Course Certificate mang đúng tên khoá "Claude Code in Action", miễn phí và gắn được vào LinkedIn kèm URL verify. Đây là chứng chỉ hoàn thành khoá, KHÔNG phải một "chứng chỉ Claude Code" riêng — không tồn tại chứng chỉ nghề nào mang tên đó. Ở cấp chứng chỉ nghề, kiến thức Claude Code được đo trong bài thi CCA-F qua domain Claude Code Configuration & Workflows (trọng số 20%).

Đề thi thử (219 câu)

Đề thi thử tự biên soạn, bám sát đề thi chứng chỉ thật — trích 20 câu đầu dưới đây. Bản tương tác — chấm điểm, đáp án & giải thích từng câu — nằm ở tab “Đề thi thử” trên trang.

  1. How Coding Assistants Work How is a coding assistant best described?

    • A. A sophisticated system that uses language models to tackle complex programming tasks, not just a tool that writes code
    • B. A simple text editor with syntax highlighting and autocomplete that suggests the next few characters to you as you type
    • C. A compiler that turns natural-language prompts directly into machine code without producing any source
    • D. A database of pre-written code snippets that you search and paste into your project
  2. How Coding Assistants Work When solving a task like fixing a bug, what three-step process does a coding assistant follow, similar to a human developer?

    • A. Compile the project, run the resulting binary, and then debug whatever fails along the way
    • B. Gather context, formulate a plan, take an action
    • C. Read, summarize, reply
    • D. Index, search, deploy
  3. How Coding Assistants Work Which steps of the coding assistant's process specifically require interacting with the outside world?

    • A. Only the 'formulate a plan' step, since planning is where external information gets pulled in
    • B. None of the steps — everything happens inside the language model, which already holds the whole project in its weights
    • C. The 'gather context' and 'take an action' steps — e.g. reading files, fetching docs, running commands, editing code
    • D. Only the final answer step, when the result is written back out to you
  4. How Coding Assistants Work Inside the 'Assistant', which two components work together?

    • A. A database and a web server
    • B. A compiler and a linter
    • C. A frontend and a backend
    • D. A language model and a set of tools
  5. How Coding Assistants Work Where are the Claude models used by Claude Code hosted?

    • A. At Anthropic, AWS, or Google Cloud (configurable)
    • B. Only on the user's local machine
    • C. Only on Anthropic's servers, with no other option
    • D. On a peer-to-peer network of user devices
  6. The Tool Use Challenge What is the fundamental limitation of a language model by itself?

    • A. It can only process images rather than text, so code has to be screenshotted before the model can help at all
    • B. It can only process text and return text — it cannot actually read files or run commands
    • C. It can read files from disk but cannot generate any text back
    • D. It can run commands on your machine but cannot understand natural language instructions
  7. How Tool Use Works How does a coding assistant teach a language model to request an action?

    • A. By fine-tuning the model on the user's own codebase before every single request, so that it memorises all of the file names
    • B. By giving the model direct network access to the file system so it can open files on its own
    • C. By automatically adding instructions to the message, e.g. 'If you want to read a file, respond with ReadFile: name of file'
    • D. By compiling the request into a binary tool that the model executes inside its own sandbox
  8. How Tool Use Works You ask: "What code is written in the main.go file?" What does the language model itself actually produce when it wants to read the file?

    • A. It directly opens and reads main.go from the disk itself, using a file handle it holds internally
    • B. It sends an email requesting the file from whoever owns the repository
    • C. It compiles main.go and returns the resulting binary for the assistant to inspect
    • D. It produces a formatted text response such as 'ReadFile: main.go', which the coding assistant then executes
  9. How Tool Use Works In the tool use flow, what happens right after the language model responds with 'ReadFile: main.go'?

    • A. The coding assistant reads the actual file and sends its contents back to the model
    • B. The model gives its final answer immediately with no file contents
    • C. The session ends and waits for a new prompt
    • D. The model asks the user to paste the file manually
  10. Why Claude's Tool Use Matters According to the course, what is true about language models and tool use?

    • A. All language models use tools with exactly the same skill level, so the choice of model makes no practical difference here
    • B. Not all language models are equally good at using tools; the Claude series is particularly strong at it
    • C. Only models running locally can use tools
    • D. Tool use makes all models perform identically
  11. Benefits of Strong Tool Use Which of the following is a security benefit of Claude Code's strong tool use?

    • A. It encrypts every file on your disk before any tool is allowed to read them
    • B. It blocks all network access permanently for the duration of the session
    • C. It can navigate codebases without requiring indexing, which often means not sending your entire codebase to external servers
    • D. It requires two-factor authentication before every single tool call, so nothing at all can ever run unattended without you
  12. Benefits of Strong Tool Use What does it mean that Claude Code is an 'extensible platform'?

    • A. It can only ever use a fixed, built-in set of tools that ships with the assistant and cannot be extended at all
    • B. It automatically rewrites your entire codebase
    • C. It extends the context window to unlimited size
    • D. You can easily add new tools, and Claude will adapt to use them as your workflow evolves
  13. Key Takeaways Which statement best captures the key takeaway about tool use?

    • A. It turns a text-generating model into a coding assistant that can read files, understand the codebase, and make real changes
    • B. Tool use replaces the need for a language model entirely, since the tools themselves do all of the work
    • C. Tool use only matters for writing documentation, not for changing code
    • D. Tool use slows the assistant down considerably and should be avoided whenever the task could be done from existing context alone instead
  14. Tools with Claude Code What does the built-in Agent tool do in Claude Code?

    • A. Runs a shell command
    • B. Launches a subagent to handle a task
    • C. Reads a file
    • D. Searches the web
  15. Tools with Claude Code In Claude Code's built-in tools, what is the difference between Glob and Grep?

    • A. Glob searches the contents of a file; Grep finds files by pattern
    • B. Both find files by name; they are interchangeable
    • C. Glob finds files based upon a pattern; Grep searches the contents of a file
    • D. Glob lists directories; Grep edits files
  16. Tools with Claude Code Which built-in tool lets Claude Code make several edits at the same time?

    • A. Edit
    • B. Write
    • C. NotebookEdit
    • D. MultiEdit
  17. Tools with Claude Code What is the difference between the WebFetch and WebSearch tools?

    • A. WebFetch fetches content from a specific URL; WebSearch searches the web
    • B. WebFetch searches the web; WebSearch fetches from a URL
    • C. Both fetch from a fixed URL
    • D. WebFetch reads a local file; WebSearch reads a remote file
  18. Tools with Claude Code Which pair of built-in tools is used to manage a to-do list in Claude Code?

    • A. NotebookRead and NotebookEdit
    • B. TodoRead and TodoWrite
    • C. Read and Write
    • D. Glob and Grep
  19. Data analysis task In the streaming.csv data analysis example, what workflow does Claude Code follow?

    • A. It uploads the entire CSV to an external analysis server and then waits for the aggregated result to come back before reporting anything to you
    • B. It only prints the first row of the file and then stops without analysing anything
    • C. It writes code in a notebook to examine the data format, runs it, adds cells to guide the analysis, then writes a summary
    • D. It converts the CSV into a screenshot and reads the numbers off the image
  20. UI styling task In the UI styling task, what does the Playwright MCP Server provide to Claude Code?

    • A. A faster language model specialised for styling work and CSS generation
    • B. A database of ready-made CSS templates that Claude picks from
    • C. A tool that deploys the finished application to production as soon as you approve the styling changes it made
    • D. A set of tools that allow Claude to control a browser (open browser, navigate, take a screenshot)

…và 199 câu nữa trong bản đề thi thử đầy đủ (219 câu) — mở tab “Đề thi thử” trên trang để làm toàn bộ, có chấm điểm & giải thích.