Claude Code is an AI coding assistant tool that runs directly in your terminal. It can read your codebase, write code, run commands, and even orchestrate other agents to complete complex tasks.
Claude Code là công cụ AI coding assistant chạy trực tiếp trong terminal. Nó có thể đọc codebase, viết code, chạy lệnh và thậm chí điều phối các agent khác để hoàn thành tác vụ phức tạp.
Unlike AI tools that only suggest code, Claude Code has execution capabilities - it can create files, run builds, commit code, and much more with your permission.
Không giống các công cụ AI chỉ gợi ý code, Claude Code có khả năng thực thi - nó có thể tạo file, chạy build, commit code và nhiều hơn nữa với sự cho phép của bạn.
To get started, simply open a terminal in your project directory and run the claude command.
Để bắt đầu, chỉ cần mở terminal trong thư mục dự án và chạy lệnh claude.
1# Navigate to your project2cd my-project34# Start Claude Code5claude67# You'll see a prompt like:8# ╭─────────────────────────────────────────╮9# │ Claude Code │10# │ What would you like to do? │11# ╰─────────────────────────────────────────╯After starting, you'll see an interactive interface where you can type requests in natural language. Claude will analyze the request and perform the necessary steps.
Sau khi khởi động, bạn sẽ thấy giao diện tương tác nơi có thể nhập yêu cầu bằng ngôn ngữ tự nhiên. Claude sẽ phân tích yêu cầu và thực hiện các bước cần thiết.
- Type requests in English or Vietnamese - Claude understands both.
Nhập yêu cầu bằng tiếng Anh hoặc tiếng Việt - Claude hiểu cả hai.
- Use Ctrl+C to cancel a running operation.
Sử dụng Ctrl+C để hủy thao tác đang chạy.
- Press Enter to send message, Shift+Enter for new line.
Nhấn Enter để gửi tin nhắn, Shift+Enter để xuống dòng.
- Type /help to see available commands.
Gõ /help để xem danh sách các lệnh có sẵn.
Claude Code has access to various tools to assist you. Each tool has a specific purpose and Claude automatically selects the appropriate tool based on your request.
Claude Code có quyền truy cập vào nhiều công cụ để hỗ trợ bạn. Mỗi công cụ có mục đích cụ thể và Claude tự động chọn công cụ phù hợp dựa trên yêu cầu của bạn.
Reads file content from your project. Claude automatically uses this tool when it needs to understand existing code.
Đọc nội dung file từ dự án. Claude tự động sử dụng công cụ này khi cần hiểu code hiện có.
1# Claude uses Read internally when you ask:2"explain the authentication logic"3"what does the UserService class do?"4"show me the config file"Creates new files or completely overwrites existing ones. Typically used for new files, not small edits.
Tạo file mới hoặc ghi đè hoàn toàn file hiện có. Thường dùng cho file mới, không phải chỉnh sửa nhỏ.
Makes targeted changes to existing files by replacing specific text. More efficient than Write for small modifications.
Thực hiện thay đổi nhỏ trong file hiện có bằng cách thay thế đoạn text cụ thể. Hiệu quả hơn Write cho các chỉnh sửa nhỏ.
Executes shell commands in the terminal. Used for builds, tests, git, and other system operations.
Thực thi lệnh shell trong terminal. Dùng cho build, test, git và các thao tác hệ thống khác.
1# Claude uses Bash for:2"run the tests" → npm test3"install lodash" → npm install lodash4"check git status" → git status5"build the project" → npm run buildGlob finds files by pattern, Grep searches content within files. Claude uses these to navigate large codebases.
Glob tìm file theo pattern, Grep tìm nội dung trong file. Claude dùng chúng để điều hướng codebase lớn.
The CLAUDE.md file in your project root tells Claude about conventions, structure, and specific guidelines. This is the best way to ensure Claude works according to your project's style.
File CLAUDE.md trong thư mục gốc dự án cho Claude biết về các quy ước, cấu trúc và hướng dẫn đặc thù. Đây là cách tốt nhất để đảm bảo Claude làm việc theo phong cách dự án của bạn.
1# CLAUDE.md23## Project Overview4E-commerce app built with Next.js 14 and TypeScript.56## Commands7- `npm run dev` - Start dev server8- `npm run build` - Build for production9- `npm test` - Run tests1011## Code Style12- Use TypeScript strict modeClaude Code asks for permission before performing operations that could affect your system. You can approve, deny, or configure auto-approve.
Claude Code yêu cầu sự cho phép trước khi thực hiện các thao tác có thể ảnh hưởng đến hệ thống. Bạn có thể approve, deny hoặc cấu hình auto-approve.
1# When Claude wants to run a command:2> Claude wants to run: npm install axios3> [A]pprove [D]eny [E]dit45# Auto-approve safe operations in settings:6{7 "autoApprove": ["read", "glob", "grep"]8}Luôn review các thao tác trước khi approve, đặc biệt với lệnh bash. Claude thông minh nhưng không hoàn hảo.
Claude remembers the entire conversation within a session. You can reference previous discussions and Claude will understand the context.
Claude nhớ toàn bộ cuộc hội thoại trong phiên làm việc. Bạn có thể tham chiếu đến các thảo luận trước đó và Claude sẽ hiểu ngữ cảnh.
- Context window has limits - long conversations are automatically compressed.
Context window có giới hạn - conversation dài sẽ được tự động nén.
- Use /clear to wipe conversation and start fresh with clean context.
Dùng /clear để xóa conversation và bắt đầu lại với context sạch.
- Claude reads CLAUDE.md at startup, so important info should go there.
Claude đọc CLAUDE.md mỗi khi bắt đầu, nên thông tin quan trọng nên đặt ở đó.
Key Takeaways
Điểm Chính
- Claude Code runs in terminal with execution capabilitiesClaude Code chạy trong terminal với khả năng thực thi
- Built-in tools: Read, Write, Edit, Bash, Glob, GrepCông cụ tích hợp: Read, Write, Edit, Bash, Glob, Grep
- CLAUDE.md file guides Claude's behavior in your projectFile CLAUDE.md hướng dẫn hành vi của Claude trong dự án
- Permissions system protects against unintended actionsHệ thống permissions bảo vệ khỏi các thao tác ngoài ý muốn
Practice
Test your understanding of this chapter
What command starts Claude Code in your terminal?
Lệnh nào khởi động Claude Code trong terminal?
Claude Code can only suggest code, it cannot execute commands.
Claude Code chỉ có thể gợi ý code, không thể thực thi lệnh.
Complete the filename for project-specific Claude guidelines
Hoàn thành tên file chứa hướng dẫn dự án cho Claude
.mdWhich tool does Claude use to make small targeted changes to existing files?
Claude dùng công cụ nào để thực hiện thay đổi nhỏ trong file hiện có?