Anthropic không chỉ là công ty làm model. Họ cũng xây app sản phẩm để: 1.
- Giải thích Claude Code và Computer Use là gì, khác nhau thế nào
- Nhận diện chúng là "agent" — và tại sao đây là case study xuyên khóa
- Mô tả các pattern kỹ thuật (tool use, multi-step, environment interaction) xuất hiện trong cả hai
- Biết mình sẽ mổ xẻ hai ứng dụng này ở bài nào của khóa
Claude Code — Terminal-based coding agent
Claude Code là CLI — bạn gõ vào terminal, Claude làm việc trong codebase của bạn. Nó có thể:
Tại sao Claude Code là landmark agent?
Nhiều AI coding tool đã tồn tại (Copilot, Cursor) nhưng Claude Code khác ở điểm:
Những pattern bạn sẽ học lại từ Claude Code
Claude Code không phải "kỳ quan ma thuật" — nó là tập hợp các pattern bạn sẽ học, ráp lại một cách khéo léo.
- Đọc bất kỳ file nào trong repo (Glob, Grep, Read)
- Sửa file (Edit, Write) với diff preview trước khi apply
- Chạy bash commands (npm test, git commit, docker build)
- Duyệt web (WebFetch, WebSearch) khi cần doc mới
- Gọi agent phụ để phân tích song song (Task tool)
- Version control — commit, push, tạo PR
- Agent thật sự — tự lập kế hoạch, tự thực thi, tự kiểm tra. Không chờ bạn chỉ từng bước.
- Terminal-first — không phụ thuộc UI, tích hợp dễ với CI/CD, script, cron job
- Tool use production-grade — schema rõ ràng, error handling thật, retry logic
- Open design patterns — Anthropic công bố nhiều blog/video về cách Claude Code được build
| Pattern trong Claude Code | Bạn học ở bài |
|---|---|
| Tool schema (Glob, Edit, Bash...) | 6.31 Tool schemas |
| Multi-turn loop với tool results | 6.35-6.36 Multi-turn |
| Environment inspection | 6.73 Environment inspection |
| Planning + execution chaining | 6.74 Chaining workflows |
| Parallel subagents | 6.75 Parallelization |
| Routing based on task type | 6.76 Routing |
┌────────────────────────────────────────────────┐ │ │ │ $ claude │ │ │ │ > Fix the auth bug in src/middleware.js │ │ │ │ ● Reading src/middleware.js... │ │ ● Running tests to reproduce... │ │ ● Found issue: token validation race │ │ ● Editing src/middleware.js... │ │ ● Re-running tests... ✅ 23 passed │ │ │ │ Done. Fixed in src/middleware.js:42 │ │ │ └────────────────────────────────────────────────┘
Computer Use — Claude điều khiển desktop
Computer Use là bộ 3 tool cho Claude:
Với 3 tool đơn giản đó, Claude có thể làm bất cứ gì một con người làm được trên máy tính:
Computer Use vs Claude Code
Quy tắc chọn:
Tại sao Computer Use quan trọng?
Nhiều task thực tế không có API — app nội bộ 20 năm tuổi, SaaS đắt tiền không publish API, legacy system chỉ có terminal xanh đen. Computer Use mở ra khả năng automate các workflow này — không cần đợi vendor tích hợp.
Case study thực tế: một công ty logistics đã dùng Computer Use để automate việc nhập đơn hàng vào hệ thống kho legacy — task trước đây cần 3 người ngồi gõ 8 giờ/ngày, giờ chạy tự động qua đêm.
- computer_screenshot — chụp màn hình hiện tại
- computer_click / computer_type / computer_scroll — điều khiển chuột/bàn phím
- bash — chạy shell command trên VM
- Mở browser, tìm kiếm, đọc bài
- Điền form phức tạp
- Dùng Excel, PowerPoint, Photoshop
- Chuyển dữ liệu giữa app không có API
- Xử lý task cross-app (copy từ Gmail sang Slack)
- Task có thể làm qua CLI / API → Claude Code
- Task chỉ làm được qua UI (ví dụ app nội bộ không có API) → Computer Use
- Task cross-system (SaaS X → SaaS Y, không có integration) → Computer Use hoặc MCP (Module 8)
| Claude Code | Computer Use | |
|---|---|---|
| Phạm vi | Chỉ filesystem + terminal | Toàn bộ desktop app |
| Interface | CLI text | Visual GUI (qua screenshot) |
| Tốc độ | Nhanh (command chạy ngay) | Chậm (screenshot + click từng bước) |
| Reliability | Cao (text output predictable) | Trung bình (UI thay đổi sẽ break) |
| Cost | Trung bình | Cao (nhiều screenshot = input lớn) |
| Best for | Coding, DevOps | Task không có API, automation UI |
┌──────────────────────────────────────────────────┐ │ │ │ Claude ────▶ Virtual machine │ │ ┌────────────────┐ │ │ Tools: │ │ │ │ - computer_screenshot │ [Desktop] │ │ │ - computer_click │ │ │ │ - computer_type │ ┌──────────┐ │ │ │ - computer_scroll │ │ Browser │ │ │ │ - bash │ └──────────┘ │ │ │ │ │ │ │ └────────────────┘ │ │ │ └──────────────────────────────────────────────────┘
Cả hai là agents — và agents có 4 tính chất
1. Tool integration
Agent biết cách gọi tool bên ngoài qua schema chuẩn. Không phải "AI tưởng tượng code" mà thực sự chạy code qua tool.
2. Multi-step execution
Agent làm được task dài — nhiều bước, mỗi bước phụ thuộc kết quả bước trước. Không chỉ "input → output 1 lần".
3. Environment interaction
Agent đọc được state hiện tại của môi trường (filesystem, màn hình, database), và điều chỉnh plan theo state đó.
4. Autonomous problem-solving
Khi gặp lỗi, agent tự retry, tự điều chỉnh, không panic đẩy về human sau lỗi đầu tiên.
Hai app Anthropic này vừa có cả 4 — lý do chúng ta nghiên cứu chúng như case study.
┌─────────────────────────────────────────────┐ │ │ │ AGENT │ │ ┌──────────────────────────┐ │ │ │ 1. Tool integration │ │ │ │ 2. Multi-step execution │ │ │ │ 3. Env. interaction │ │ │ │ 4. Autonomous solving │ │ │ └──────────────────────────┘ │ │ │ │ Claude Code ✓ ✓ ✓ ✓ │ │ Computer Use ✓ ✓ ✓ ✓ │ │ │ └─────────────────────────────────────────────┘
Ví dụ thực chiến: Một session Claude Code điển hình
Tình huống
Bạn là backend dev, nhận bug report: "API /users trả 500 khi query user không tồn tại, đáng ra phải 404."
Bước 1: Bạn prompt
Bước 2: Claude lập plan (tự hiển thị)
$ claude
> Fix bug: /users endpoint returns 500 for non-existent user,
should return 404 with proper error messageBước 2: Claude lập plan (tự hiển thị)
Bước 3: Claude thực thi (hiển thị từng bước)
Plan:
1. Read src/routes/users.ts to find the endpoint
2. Check current error handling
3. Find the tests for this endpoint
4. Write failing test for the 404 case
5. Fix the handler
6. Run tests to verifyBước 3: Claude thực thi (hiển thị từng bước)
Bước 4: Claude báo cáo
● Reading src/routes/users.ts... (Read tool)
● Found issue: line 42 catches error but returns 500
● Reading tests/users.test.ts... (Read tool)
● Writing failing test for 404 case... (Edit tool)
● Running: npm test users.test.ts (Bash tool)
→ 1 failed (expected)
● Editing src/routes/users.ts line 42... (Edit tool)
● Running: npm test users.test.ts (Bash tool)
→ All passed ✅Bước 4: Claude báo cáo
Kết quả
Đây là agent thật đang làm việc. Và đó là những gì bạn sẽ học cách xây dựng từ scratch.
- Thời gian: 90 giây
- Code changes: 2 file, 6 dòng
- Tests: 1 mới, 23 cũ vẫn pass
- So với làm tay: ~15 phút
Fixed. Changes:
- src/routes/users.ts:42 — return 404 instead of 500
- tests/users.test.ts — added test for non-existent user
Commit message suggestion:
fix(users): return 404 for non-existent user instead of 500Case studies theo ngành: Ai dùng các app này?
💻 Software Engineering — Startup 20 người
Pain trước: PR review backlog 30+ PRs, code review mất 2 giờ/PR.
Giải pháp:
🎧 Customer Support — Ops team
Pain trước: Import 500 ticket/ngày từ Zendesk vào hệ thống nội bộ (không có API).
Giải pháp: Computer Use script chạy 3AM, login Zendesk, export CSV, import vào internal tool qua UI.
Kết quả: 2 người toàn thời gian → 0, tự động chạy đêm.
📊 Finance — Month-end close
Pain trước: Reconcile 3 hệ thống (ERP, bank, invoices), mỗi tháng 5 ngày.
Giải pháp: Claude Code agent chạy từng SOP step, flag exception cho human review.
Kết quả: 5 ngày → 2 ngày, error rate giảm 60%.
🏭 Manufacturing — Inventory sync
Pain trước: 4 warehouse, mỗi cái phần mềm riêng, không sync real-time.
Giải pháp: Computer Use agent crawl từng warehouse system mỗi 15 phút, update master inventory.
Kết quả: real-time inventory, giảm stock-out 40%.
- Claude Code chạy trong CI: tự review PR, comment inline, suggest improvements
- Human review chỉ focus vào architecture decisions
- Kết quả: 2 giờ → 20 phút/PR, backlog clear trong 1 tuần
Anti-patterns — Khi KHÔNG nên dùng agent
❌ Dùng agent cho task 1-shot đơn giản
Ví dụ: "Summarize this article" — chỉ cần 1 API call, không cần agent.
Hiểu hiện: Quen dùng Claude Code cho mọi thứ, kể cả task trivial.
Fix: Agent có overhead (planning, tool setup, multi-turn). Task 1-shot → API call trực tiếp.
❌ Dùng Computer Use khi có API
Ví dụ: "Post message lên Slack" — Slack có API rõ ràng. Computer Use chậm hơn 100x.
Fix: Luôn check có API / MCP server không trước khi dùng Computer Use.
❌ Deploy agent không có observability
Hiểu hiện: Agent chạy autonomous trên production, không ai biết nó làm gì.
Fix: Agent phải log mọi tool call. Phải có dashboard monitor success/failure rate. Phải có kill switch.
❌ Cho agent full access production không có sandbox
Hiểu hiện: "Let's give Claude Code access to prod DB, it'll be fine."
Fix: Không bao giờ. Agent chạy trong sandbox / staging. Production access qua reviewed pipeline.
Áp dụng ngay
Bài tập 1: Cài Claude Code và chạy thử (15 phút)
(Hoặc dùng cách cài khác theo docs.anthropic.com/claude-code)
- Cài:
- Vào bất kỳ repo git nào:
npm install -g @anthropic-ai/claude-codeBài tập 1: Cài Claude Code và chạy thử (15 phút)
- Thử prompt:
cd your-project
claudeÁp dụng ngay (tiếp)
Bài tập 2: Lập danh sách task cho app của bạn (10 phút)
Trong my-goals.md, thêm:
- Quan sát Claude đọc những file nào — đây chính là "environment inspection" bạn sẽ học ở bài 6.73.
> What does this project do? Summarize in 3 bullets.Bài tập 2: Lập danh sách task cho app của bạn (10 phút)
## Tác vụ agentic có thể có trong app
Task nào của app tôi có tính chất agent (multi-step, tool use, autonomous)?
1. Ví dụ: user hỏi "status đơn hàng của tôi" → agent gọi tool `get_order()` → format response
2. ___________
3. ___________
Task nào có thể đẩy cho **Claude Code** dùng trong dev?
- ___________
Task nào có thể automate bằng **Computer Use** (không có API)?
- ___________Tóm tắt bài học
🎯 Claude Code và Computer Use là 2 agent production-grade của Anthropic — không phải demo, mà là app thật được dùng rộng rãi.
🎯 Claude Code = coding agent trong terminal. Multi-turn tool use với Read, Edit, Bash, WebFetch. Cơ bản của mọi pattern bạn sẽ học ở Module 5-10.
🎯 Computer Use = agent điều khiển desktop qua screenshot + click. Giải quyết task không có API — cost cao, slow hơn Claude Code.
🎯 4 tính chất của agent: tool integration, multi-step execution, environment interaction, autonomous problem-solving.
🎯 Hai app này là case study xuyên khóa. Mỗi khi học xong một kỹ thuật (tool schema, multi-turn, routing), bạn sẽ thấy nó xuất hiện trong Claude Code và Computer Use.
- Claude Code docs
- Claude Code best practices — blog chính thức
- Computer Use docs
- anthropic-cookbook/claude-computer-use