Menu
ESC

Nhập từ khóa để tìm kiếm

↑↓ Di chuyển
Enter Mở
ESC Đóng

Đang tải...

Code

Claude Code

bởi Anthropic

CLI coding agent của Anthropic — chạy headless trong terminal, hiểu cả codebase, đa năng nhất 2025.

Gồm trong Claude Pro/Max plan (hoặc API pay-as-you-go) Trang chủ

Tool này là gì?

Claude Code là CLI tool của Anthropic — chạy trong terminal (zsh/bash), kết nối với Claude (Opus 4.7, Sonnet 4.5). Nó hiểu cả codebase, đọc/sửa nhiều file, chạy command, debug, commit, mở PR — không cần IDE.

2025, Claude Code trở thành "agent coding standard" cho dev senior — đặc biệt cho task headless / automated: refactor lớn, generate documentation, migrate codebase. Nhiều team CI/CD đã hook Claude Code vào pipeline thay vì script tay.

Cho PM: nếu bạn quen terminal, Claude Code là tool mạnh nhất để build internal tool nhanh và automate workflow code-heavy mà không phải mở IDE.

Khi nào nên dùng

Khi nào KHÔNG nên dùng

Workflow tiêu biểu

flowchart LR
    A[Mở terminal trong
repo] --> B[Chạy 'claude'] B --> C[Mô tả task] C --> D[Claude index codebase
+ propose plan] D --> E{Plan OK?} E -->|Edit| F[Refine task] E -->|OK| G[Auto-execute
edit nhiều file] F --> C G --> H[Run test / build] H --> I{Pass?} I -->|Fail| J[Auto-debug] I -->|Pass| K[Commit + PR] J --> G

Killer feature: Claude Code có thể chạy command (npm test, git diff, curl) và đọc output, tự debug. Không chỉ "edit file" — nó "làm việc" như 1 junior dev autonomous.

Prompt mẫu

(Trong terminal, sau khi 'claude' khởi động)

Task: Migrate toàn bộ component class-based React sang
function + hooks.

Quy tắc:
1. Mỗi component giữ nguyên props interface
2. Lifecycle method (componentDidMount, etc.) chuyển sang
   useEffect tương ứng
3. Update test (jest), giữ snapshot pass
4. Commit từng component thành 1 commit riêng,
   message format: 'refactor(comp): convert X to hooks'

Không touch business logic. Báo cáo file nào không
migrate được + lý do.
Generate API documentation:

1. Đọc mọi file trong src/api/
2. Extract endpoint (method + path + params + response)
3. Generate file docs/API.md (OpenAPI-style markdown)
4. Add example curl cho mỗi endpoint
5. Diff vs version cũ, list endpoint mới / removed

Mẹo nâng cao

Tip 1 — CLAUDE.md file: Tạo file CLAUDE.md ở root repo (giống .cursorrules) — Claude Code đọc context này mỗi session. Viết coding standard, naming, business domain — output consistent hơn nhiều.
Tip 2 — Skills & MCP: Claude Code hỗ trợ skill (workflow templates) và MCP server (tool extension). Vd skill "review-pr" cho code review chuẩn quy trình team, MCP "PostgreSQL" để query DB trực tiếp.
Cẩn thận: Claude Code có "auto-accept" mode — AI tự chạy command không hỏi. Disable trong môi trường production hoặc repo nhạy cảm. Luôn dry-run trước task lớn.

Kết hợp với công cụ khác

flowchart LR
    A[Cursor
daily edit] -->|task lớn| B[Claude Code
headless agent] B --> C[Git commit + PR] C --> D[GitHub Actions
+ Claude Code review] D --> E[Merge production]

Cursor (IDE) + Claude Code (CLI) là combo phổ biến — Cursor cho daily edit có feel UI, Claude Code cho task headless automated.

So với alternatives

So vớiMạnh hơn ởYếu hơn ở
CursorHeadless / CI-friendly, không cần GUI, automate đượcCursor có UI dễ tiếp cận hơn cho non-dev
GitHub Copilot WorkspaceMulti-step reasoning sâu hơn, tool ecosystem mạnh hơn (MCP)Copilot Workspace tích hợp GitHub PR sâu hơn
Aider (open source)Model Claude mạnh hơn baseline, skill/MCP frameworkAider miễn phí + open source, customize sâu hơn

Tài nguyên thêm

Công cụ cùng nhóm