5 phút

Claude Code: Từ tool dòng lệnh đến AI agent thực thụ - Kinh nghiệm từ một CTO

Claude Code không chỉ là tool dòng lệnh - nó là AI agent thực thụ. Mình tổng hợp lại bí kíp từ Patrick, CTO một startup AI native: CLAUDE.md, GitHub integration, framework Explore - Plan - Execute và trick double escape.

Cũng có bằng: English · 中文 · 한국어 · 日本語

Chào các bạn! Hôm nay mình sẽ chia sẻ về Claude Code - một tool mà nhiều người đang dùng nhưng chưa khai thác hết 90% sức mạnh của nó. Một video từ Patrick (CTO của một startup AI native) cùng team đã mở mắt mình về cách biến Claude Code từ một chatbot bình thường thành một AI agent siêu mạnh.

Claude Code là gì và tại sao nó đáng chú ý?

Theo như mình hiểu sau khi xem video và research thêm, Claude Code không chỉ là một tool command line - nó là AI agent đầu tiên trong làn sóng AI agents mạnh mẽ sắp tới.

Điểm khác biệt cốt lõi: Claude Code vs Cursor

Patrick đã giải thích rất rõ:

ToolMạnh ở đâu
Claude CodeXuất sắc ở multi-step processing. Khi bạn có task lớn, nó tự chia nhỏ thành subtasks và thực hiện từng bước một. Rất tốt cho việc start project từ đầu.
CursorVẫn tốt cho việc solve specific problems, address specific files hoặc lines of code vì có thể select dễ dàng.

Điều thú vị là Patrick nói anh ấy tạo project mới “every other couple of days” chỉ nhờ Claude Code. Điều này cho thấy productivity tăng đáng kinh ngạc.

Bí kíp sử dụng Claude Code hiệu quả

1. CLAUDE.md - “README cho Claude Code”

Đây là context file chính của bạn. Khi chạy /init, nó sẽ:

  • Tạo overview về codebase
  • Phân tích tất cả files
  • Hiểu startup processes và structure

Pro tip từ Patrick: Tạo file CLAUDE.md cho mỗi subfolder. Điều này giúp Claude không phải “grep như điên” mà có thể track từng function và file một cách chi tiết.

2. GitHub Integration - Game changer thực sự

Này mới là điều WOW nhất:

  • Chỉ cần run một command, Claude Code tự setup với GitHub repo
  • Bạn có thể tag Claude như tag một developer thực sự
  • Nó tạo issues, tạo checklist, execute và thậm chí handle code review
Tôi có thể run 30 different commands cùng lúc, để Claude Code generate PRs cho tất cả features và tự tag Claude ở cuối. Khi về nhà thì mọi thứ đã hoàn thành.
— Patrick

3. Commands - Chia sẻ “prompts siêu việt”

Commands trong Claude Code = prompts được save thành files, có thể:

  • Share giữa các projects
  • Share trong team
  • Tạo comprehensive workflows

Ví dụ Patrick có một codebase analyzer command siêu dài nhưng hiệu quả, thậm chí còn tạo GitHub action để run ngay từ GitHub interface.

Framework “Explore - Plan - Execute”

Đây là core methodology mà Patrick recommend:

mermaidflowchart LR
  E["Explore: đọc codebase, build context"] --> P["Plan: chia việc theo mức rủi ro"]
  P --> X["Execute: code từng PR"]
  E -->|"overview sai thì /clear làm lại"| E
Vòng Explore - Plan - Execute

1. Explore phase

text# Thay vì jump straight vào execute, hãy làm:
"Prepare to work on this. Read the codebase, understand the structure."

Quan trọng: Buộc Claude spend tokens để build up context. Nếu overview sai, /clear và start over - đừng cố sửa.

2. Plan phase

Patrick không dùng plan mode mà prefer:

text"Think hardest. Write function names in 1-3 sentences about what they do. Write test names in 5-10 words about behavior they cover."

Risk-based planning:

Small

Đừng overthink, just write code

Medium-Large

Break into testable, deployable PRs

High-risk

Take 2-3 shots at the plan, review kỹ

3. Execute phase

Sử dụng context đã build up từ explore phase. Patrick recommend:

text"Work on PR1. Think hard. Write elegant code. NO backwards compatibility."

Double escape - Technique thần thánh

Đây là gem thực sự từ video:

  1. Sau khi explore và build context (7 minutes, 50k tokens)
  2. Double escape để fork conversation
  3. Mở new tab, hit resume
  4. Bạn có thể có 5 terminals với cùng amazing context
Nếu get một smart Claude, hãy keep và reuse nó over and over.
— Patrick

Test Driven Development (TDD) với Claude - Surprisingly good

Dù Patrick ghét TDD khi tự code, nhưng với Claude thì:

Claude writes failing test, then writes code that makes test pass. Nó làm excellent job.
— Patrick

Những insights sâu sắc khác

Context management

Model selection

  • Default là Sonnet, Opus đắt gấp 4 lần
  • Max plan ($200/month) cho unlimited usage - Patrick highly recommend
  • Sonnet 4 with thinking hard sometimes better than Opus for many tasks

Enterprise-ready problem

Claude “loves to be enterprise ready” - phải fight against điều này vì nó tạo ra overly complex solutions.

MCP (Model Context Protocol) - Mở rộng khả năng

Claude Code support MCPs để:

  • Connect với Google Drive, Jira, Slack
  • Add custom developer tooling
  • Extend functionality beyond coding

Agent swarms - Tương lai gần

Video có đề cập đến agent swarms - multiple containers chạy parallel để solve problems, rồi compare kết quả manually hoặc qua LLM judge. Một friend của Patrick đã setup 3 Opus instances với acceptance criteria và style guides.

Bottom line - Ai nên dùng Claude Code?

Sau khi analyze video và research thêm, mình thấy Claude Code phù hợp với:

✅ Should use

  • Developers muốn automate repetitive tasks
  • Teams cần consistent workflows
  • Projects với large, complex codebases
  • Ai thường xuyên start new projects

❌ Maybe not yet

  • Beginners chưa quen command line
  • Small projects dưới 1000 lines
  • Ai prefer visual IDE experience như Cursor

Tương lai của AI coding

Patrick nhấn mạnh rằng close collaboration giữa Anthropic’s ML team và product team làm Claude Code khác biệt. Opus 4 và Sonnet 4 được tune để “badly want to use bash commands” - perfectly aligned với Claude Code.


Các bạn đã thử Claude Code chưa? Share experience của các bạn nhé!

P/S: Video gốc dài hơn 2 tiếng, content cực kỳ dense. Mình recommend xem full nếu các bạn serious về AI coding tools.