Skip to content
DocsUse AIfundamentalsClaude Code Basics
Chapter 3 of 15·fundamentals·7 min read

Claude Code Basics

Cơ Bản Claude Code

Getting started with Claude Code CLI and core concepts

Hover or tap any paragraph to see Vietnamese translation

Claude Code Overview

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.

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.

Starting a Session

To get started, simply open a terminal in your project directory and run the claude command.

Terminal
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# ╰─────────────────────────────────────────╯

Basic Interface

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.

  • Type requests in English or Vietnamese - Claude understands both.
  • Use Ctrl+C to cancel a running operation.
  • Press Enter to send message, Shift+Enter for new line.
  • Type /help to see available commands.

Built-in Tools

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.

Read - Reading Files

Reads file content from your project. Claude automatically uses this tool when it needs to understand existing code.

Read Tool Usage
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"

Write - Writing Files

Creates new files or completely overwrites existing ones. Typically used for new files, not small edits.

Edit - Editing Files

Makes targeted changes to existing files by replacing specific text. More efficient than Write for small modifications.

Bash - Running Commands

Executes shell commands in the terminal. Used for builds, tests, git, and other system operations.

Bash Tool Usage
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 build

Glob & Grep - Searching

Glob finds files by pattern, Grep searches content within files. Claude uses these to navigate large codebases.

CLAUDE.md - Project Guide

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.

CLAUDE.md
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 mode

Permissions System

Claude Code asks for permission before performing operations that could affect your system. You can approve, deny, or configure auto-approve.

Permissions
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}
Warning
Always review operations before approving, especially bash commands. Claude is smart but not perfect.

Context and Memory

Claude remembers the entire conversation within a session. You can reference previous discussions and Claude will understand the context.

  • Context window has limits - long conversations are automatically compressed.
  • Use /clear to wipe conversation and start fresh with clean context.
  • Claude reads CLAUDE.md at startup, so important info should go there.

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

Quiz

What command starts Claude Code in your terminal?

Lệnh nào khởi động Claude Code trong terminal?

True or False

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.

Code Challenge

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

.md
Quiz

Which 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ó?

← → to navigate chapters
Built: 4/8/2026, 12:01:11 PM