claude-help

13. Mẹo và Thủ thuật Claude Code CLI

Tổng hợp các mẹo, thủ thuật và kỹ thuật nâng cao giúp bạn sử dụng Claude Code CLI hiệu quả nhất.


1. Tối ưu năng suất

Alias hữu ích

# Thêm vào ~/.bashrc hoặc ~/.zshrc

# Lệnh cơ bản rút gọn
alias c='claude'
alias cc='claude --continue'
alias cr='claude --resume'

# Kiểm tra trạng thái nhanh
alias cs='claude "git status && git diff --stat"'

# Tìm và sửa lỗi tự động
alias cfix='claude "tìm và sửa lỗi trong file vừa thay đổi"'

# Review code thay đổi
alias creview='claude "review code đã thay đổi, kiểm tra bug và security"'

# Chạy test và sửa nếu fail
alias ctest='claude "chạy test và sửa nếu fail"'

# Cập nhật documentation
alias cdoc='claude "cập nhật documentation cho code vừa thay đổi"'

# Giải thích code nhanh
alias cexplain='claude "giải thích code trong file"'

# Tối ưu performance
alias cperf='claude "phân tích và tối ưu performance cho code vừa thay đổi"'

Scripts tiện ích

# Quick commit với Claude
ccommit() {
  claude "/commit"
}

# Review Pull Request
creviewpr() {
  claude "/code-review $1"
}

# Bắt đầu tính năng mới
cfeature() {
  git checkout -b "feature/$1"
  claude "Bắt đầu phát triển tính năng: $1"
}

# Fix bug từ issue number
cfixissue() {
  claude "đọc issue #$1 và fix bug được mô tả trong đó"
}

# Tạo test cho file cụ thể
ctestfile() {
  claude "viết unit test đầy đủ cho file $1"
}

# Refactor file
crefactor() {
  claude "refactor file $1 — cải thiện code quality, giữ nguyên behavior"
}

# Tìm kiếm và giải thích
csearch() {
  claude "tìm tất cả nơi sử dụng '$1' trong codebase và giải thích"
}

# Morning standup — tóm tắt thay đổi
cstandup() {
  claude "tóm tắt tất cả thay đổi từ hôm qua (git log --since=yesterday), liệt kê thành bullet points cho standup"
}

Hàm nâng cao trong shell

# Claude với retry logic khi bị rate limit
claude_retry() {
  local max_retries=3
  local count=0
  until claude "$@"; do
    count=$((count + 1))
    if [ $count -ge $max_retries ]; then
      echo "Đã thử $max_retries lần, vẫn thất bại."
      return 1
    fi
    echo "Thử lại lần $count/$max_retries sau 10 giây..."
    sleep 10
  done
}

# Claude one-shot và lưu kết quả
claude_save() {
  local output_file="${2:-claude-output.txt}"
  claude -p "$1" | tee "$output_file"
  echo "Đã lưu kết quả vào $output_file"
}

# Batch xử lý nhiều file
claude_batch() {
  local prompt="$1"
  shift
  for file in "$@"; do
    echo "=== Xử lý: $file ==="
    claude "$prompt cho file $file"
  done
}

2. Quản lý Context hiệu quả

Khi nào cần dùng /compact

# Khi context quá lớn, Claude sẽ chậm và tốn token
/compact

# Compact với hướng dẫn giữ lại thông tin quan trọng
/compact giữ lại thông tin về database schema và API endpoints

Quy tắc vàng:

Giữ prompt tập trung

# SAI — quá chung chung
claude "fix bugs"

# ĐÚNG — cụ thể và rõ ràng
claude "fix lỗi NullPointerException trong file src/services/UserService.ts dòng 45, xảy ra khi user chưa có profile"

Chia nhỏ task lớn

# SAI — yêu cầu quá nhiều trong 1 prompt
claude "xây dựng hệ thống authentication đầy đủ với login, register, forgot password, 2FA, OAuth, session management"

# ĐÚNG — chia thành từng bước
claude "tạo cấu trúc database schema cho authentication system"
claude --continue "implement đăng ký user với validation"
claude --continue "implement đăng nhập với JWT"
claude --continue "thêm forgot password flow"

Dùng –max-turns để kiểm soát

# Giới hạn số lượt tool call — tránh Claude chạy quá lâu
claude --max-turns 5 "tìm và liệt kê tất cả TODO trong codebase"

# Không giới hạn cho task phức tạp
claude --max-turns 50 "refactor toàn bộ module payment"

One-shot mode cho câu hỏi nhanh

# Dùng -p (print) cho câu hỏi một lần, không cần interactive session
claude -p "giải thích hàm này làm gì" < src/utils/crypto.ts

# Pipe kết quả ra file
claude -p "tạo TypeScript interface từ JSON này" < sample.json > types.ts

# Dùng cho CI/CD pipeline
claude -p "kiểm tra code có lỗ hổng security không" < src/auth.ts

3. Chọn Model phù hợp

Lệnh chuyển model

/model                    # Xem model hiện tại
/model opus              # Dùng Opus cho task phức tạp
/model sonnet            # Dùng Sonnet cho task thường
/model haiku             # Dùng Haiku cho task đơn giản
/fast                     # Toggle fast mode (cùng model, output nhanh hơn)

Khi nào dùng model nào

Tình huống Model đề xuất Lý do
Thiết kế kiến trúc hệ thống Opus Cần suy luận sâu, nhiều bước
Refactor module phức tạp Opus Cần hiểu toàn bộ codebase
Debug lỗi khó tìm Opus Cần phân tích nhiều khả năng
Viết code feature mới Sonnet Cân bằng chất lượng và tốc độ
Review code Sonnet Đủ khả năng phát hiện vấn đề
Viết test đơn giản Sonnet Không cần suy luận quá phức tạp
Hỏi cú pháp nhanh Haiku Nhanh, rẻ, đủ chính xác
Format/lint code Haiku Task đơn giản, lặp lại
Tạo boilerplate Haiku Template-based, không cần sáng tạo

So sánh chi phí và tốc độ

# Opus:   Chậm nhất  | Đắt nhất   | Chất lượng cao nhất
# Sonnet: Trung bình  | Trung bình  | Phù hợp đa số task
# Haiku:  Nhanh nhất  | Rẻ nhất     | Tốt cho task đơn giản

# Mẹo: Bắt đầu với Sonnet, chuyển sang Opus khi cần

4. CLAUDE.md Templates

Template cho Node.js/TypeScript project

# Project: [Tên dự án]

## Tech stack
- Node.js 20+ with TypeScript 5.x
- Express/Fastify
- PostgreSQL + Prisma ORM
- Jest + Supertest for testing
- ESLint + Prettier

## Conventions
- Dùng ESM imports (import/export), không dùng CommonJS
- Strict TypeScript — không dùng `any`
- Error handling với custom Error classes kế thừa AppError
- Response format: `ApiResponse<T>` cho tất cả endpoints
- File naming: kebab-case (user-service.ts)
- Biến, hàm: camelCase; Class: PascalCase
- Mỗi service file đi kèm file test tương ứng

## Project Structure
- src/controllers/ — Route handlers
- src/services/ — Business logic
- src/models/ — Prisma models
- src/middleware/ — Express middleware
- src/utils/ — Helper functions
- tests/ — Test files mirror src/ structure

## Commands
- `npm run dev` — Chạy dev server
- `npm test` — Chạy test suite
- `npm run build` — Build production
- `npm run lint` — Kiểm tra linting

Template cho Go project

# Project: [Tên dự án]

## Tech stack
- Go 1.22+
- Gin/Echo HTTP framework
- PostgreSQL + sqlc
- testify for testing

## Conventions
- Tuân theo Go standard project layout
- Error wrapping với fmt.Errorf("context: %w", err)
- Interface nhỏ, composition thay vì inheritance
- Table-driven tests
- Context propagation cho mọi function có I/O
- Dùng slog cho structured logging

## Commands
- `go run ./cmd/server` — Chạy server
- `go test ./...` — Chạy tất cả test
- `go vet ./...` — Static analysis
- `golangci-lint run` — Linting

Template cho Next.js project

# Project: [Tên dự án]

## Tech stack
- Next.js 15 (App Router)
- TypeScript strict mode
- Tailwind CSS + shadcn/ui
- Prisma + PostgreSQL
- NextAuth.js v5

## Conventions
- Server Components mặc định, chỉ dùng 'use client' khi cần
- Server Actions cho mutations
- Zod cho validation
- File naming: kebab-case
- Colocation: component, test, styles cùng thư mục

## Project Structure
- app/ — App router pages và layouts
- components/ — Shared components
- lib/ — Utilities, database, auth config
- actions/ — Server actions
- types/ — TypeScript type definitions

Template cho Monorepo

# Project: [Tên dự án] Monorepo

## Tech stack
- Turborepo/Nx cho monorepo management
- pnpm workspaces
- Shared TypeScript config

## Packages
- packages/ui — Shared UI components
- packages/utils — Shared utilities
- packages/types — Shared TypeScript types
- apps/web — Next.js frontend
- apps/api — Express backend
- apps/admin — Admin dashboard

## Conventions
- Import từ packages qua alias: @repo/ui, @repo/utils
- Mỗi package có tsconfig riêng extend từ root
- Shared dependencies ở root package.json
- Package-specific deps ở package riêng

## Commands
- `pnpm dev` — Chạy tất cả apps
- `pnpm build` — Build tất cả packages
- `pnpm test` — Test tất cả packages
- `pnpm lint` — Lint tất cả packages

5. Làm việc với codebase lớn

Dùng .claudeignore loại trừ file không cần thiết

# Tạo file .claudeignore ở root project
# Cú pháp giống .gitignore

node_modules/
dist/
build/
.next/
coverage/
*.min.js
*.min.css
*.map
vendor/
__pycache__/
*.pyc
.git/
*.log
tmp/
temp/
uploads/
public/assets/images/

Prompt nhắm mục tiêu cụ thể

# Chỉ định file cụ thể thay vì để Claude tìm kiếm toàn bộ
claude "refactor hàm calculateTotal trong file src/services/order-service.ts"

# Chỉ định thư mục phạm vi
claude "tìm tất cả API endpoints trong thư mục src/controllers/ và liệt kê"

# Tham chiếu file liên quan
claude "file src/models/user.ts đã thay đổi schema, cập nhật src/services/user-service.ts và src/controllers/user-controller.ts cho phù hợp"

Chia công việc thành các phiên tập trung

# Phiên 1: Phân tích và lên kế hoạch
claude "phân tích cấu trúc module payment trong src/payment/, liệt kê các vấn đề cần refactor"

# Phiên 2: Refactor từng phần
claude "refactor PaymentService — tách thành StripePayment và PaypalPayment"
claude --continue "cập nhật tất cả imports và dependencies"

# Phiên 3: Test
claude "viết test cho StripePayment và PaypalPayment services"

6. Git Workflow với Claude

Feature branch workflow

# Tạo branch và bắt đầu implement
claude "tạo branch feature/user-auth và implement authentication với JWT"

# Fix bug từ issue
claude "đọc issue #123 và fix bug được mô tả"

# Squash commits
claude "giúp tôi squash 5 commits cuối thành 1 commit có message rõ ràng"

# Resolve merge conflicts
claude "resolve merge conflicts trong file src/app.ts, ưu tiên giữ logic từ feature branch"

# Cherry-pick với giải thích
claude "cherry-pick commit abc1234 từ branch develop sang main, giải thích ảnh hưởng"

Quy trình review code

# Review trước khi tạo PR
claude "review tất cả thay đổi trên branch hiện tại so với main, kiểm tra:
1. Bug tiềm ẩn
2. Lỗ hổng security
3. Performance issues
4. Code style
5. Missing tests"

# Tạo PR với mô tả tự động
claude "/commit"
claude "tạo PR từ branch hiện tại sang main với mô tả chi tiết"

Conventional commits tự động

# Claude tự phân tích changes và tạo commit message phù hợp
claude "commit với conventional commit message dựa trên changes hiện tại"

# Chỉ định loại commit
claude "commit changes hiện tại — đây là bugfix cho login flow"

7. Debug hiệu quả

Template debug chuẩn

Lỗi: [paste error message đầy đủ]
File: [đường dẫn file]
Dòng: [số dòng nếu biết]
Ngữ cảnh: [mô tả ngắn khi nào xảy ra lỗi]

Hãy:
1. Phân tích nguyên nhân gốc rễ
2. Tìm root cause trong code
3. Đề xuất cách fix (có thể nhiều option)
4. Implement fix tốt nhất
5. Viết test để đảm bảo lỗi không tái phát

Debug theo loại lỗi

# Runtime error
claude "lỗi TypeError: Cannot read property 'id' of undefined tại src/services/user.ts:45. Phân tích tại sao user có thể null ở đây và fix"

# Performance issue
claude "API endpoint /api/users chạy mất 5 giây. Phân tích query, tìm bottleneck và tối ưu"

# Memory leak
claude "ứng dụng bị memory leak sau vài giờ chạy. Kiểm tra event listeners, subscriptions, và timers chưa được cleanup"

# Race condition
claude "có race condition khi 2 users cùng update đơn hàng. Implement optimistic locking"

Dùng log để debug

# Phân tích log file
cat error.log | claude "phân tích log này, tìm pattern lỗi và đề xuất fix"

# Phân tích stack trace
claude "stack trace sau đây nghĩa là gì và cách fix:
[paste stack trace]"

8. Pipe và Automation

Pipe dữ liệu vào Claude

# Pipe nội dung file
cat error.log | claude "phân tích log này và tìm vấn đề"

# Pipe git diff
git diff | claude "review changes này, tìm bug tiềm ẩn"

# Pipe test output
npm test 2>&1 | claude "phân tích test failures và đề xuất fix"

# Pipe từ curl
curl -s https://api.example.com/status | claude "phân tích response này"

# Pipe SQL output
psql -c "SELECT * FROM users LIMIT 10" | claude "phân tích data structure này"

Tạo code từ mô tả

# Generate từ mô tả
echo "REST API cho quản lý sản phẩm với CRUD operations" | claude -p "tạo code theo mô tả"

# Generate từ file spec
cat api-spec.yaml | claude -p "tạo TypeScript types từ OpenAPI spec này"

# JSON to TypeScript
cat sample.json | claude -p "tạo TypeScript interface từ JSON data này"

Chain với tools khác

# Kết hợp với jq
claude -p "tạo sample JSON cho User model" --output-format json | jq '.result'

# Kết hợp với prettier
claude -p "tạo React component cho UserProfile" > UserProfile.tsx && npx prettier --write UserProfile.tsx

# Kết hợp với ESLint
claude -p "tạo Express router cho /api/products" > products.ts && npx eslint --fix products.ts

Automation trong CI/CD

# Script kiểm tra code quality trong CI
#!/bin/bash
claude -p "kiểm tra file src/new-feature.ts có vấn đề security nào không. Trả lời YES hoặc NO" | grep -q "NO" || exit 1

# Auto-generate changelog
claude -p "tạo changelog từ các commits sau: $(git log --oneline v1.0..HEAD)"

# Auto-review PR trong GitHub Actions
claude -p "review diff sau và liệt kê vấn đề: $(git diff origin/main...HEAD)"

9. Memory System

Lệnh cơ bản

/memory                   # Xem toàn bộ memory hiện tại

Cách memory hoạt động

# Claude tự động lưu thông tin quan trọng vào CLAUDE.md:
# - Cấu trúc project
# - Tech stack đang dùng
# - Patterns và conventions
# - Lỗi đã gặp và cách fix

# Memory được lưu ở 3 cấp:
# 1. ~/.claude/CLAUDE.md     — Global (áp dụng mọi project)
# 2. ./CLAUDE.md              — Project root (áp dụng cho project)
# 3. ./src/CLAUDE.md          — Thư mục con (áp dụng cho thư mục cụ thể)

Quản lý memory thủ công

# Xem memory file
cat CLAUDE.md

# Yêu cầu Claude nhớ quy tắc
claude "hãy nhớ: project này dùng tabs thay vì spaces, indent 4"

# Yêu cầu Claude quên thông tin sai
claude "xóa memory về database connection string cũ"

# Thêm convention vào project memory
claude "thêm vào CLAUDE.md: convention cho error handling là luôn dùng custom AppError class"

Mẹo tổ chức memory

# Trong CLAUDE.md, tổ chức theo section rõ ràng:

## Quy tắc code
- Dùng TypeScript strict mode
- Không dùng `any`
- Mọi function phải có return type

## Quy tắc Git
- Branch naming: feature/, fix/, chore/
- Commit message: conventional commits bằng tiếng Việt

## Quy tắc Testing
- Coverage tối thiểu 80%
- Mỗi service file phải có unit test

## Những điều KHÔNG làm
- Không commit file .env
- Không dùng console.log trong production code
- Không sửa file migration đã chạy

10. Multi-file Editing Patterns

Yêu cầu sửa nhiều file cùng lúc

# Đổi tên entity xuyên suốt codebase
claude "đổi tên model 'Product' thành 'Item' trong toàn bộ codebase — model, service, controller, routes, tests"

# Thêm field mới xuyên suốt các layer
claude "thêm field 'phone' vào User model và cập nhật tất cả: schema, validation, API endpoint, frontend form, tests"

# Refactor import paths
claude "di chuyển file src/utils/helpers.ts sang src/lib/helpers.ts và cập nhật tất cả imports"

Atomic changes — thay đổi đồng bộ

# Đảm bảo tất cả file thay đổi cùng nhau
claude "thêm endpoint POST /api/orders bao gồm:
1. Route definition trong src/routes/order.ts
2. Controller handler trong src/controllers/order-controller.ts
3. Service logic trong src/services/order-service.ts
4. Validation schema trong src/validators/order-validator.ts
5. Unit test trong tests/services/order-service.test.ts
6. Integration test trong tests/routes/order.test.ts
Đảm bảo tất cả file nhất quán với nhau"

Refactoring patterns

# Extract function
claude "extract logic xử lý payment từ OrderService thành PaymentService riêng"

# Extract component
claude "extract phần form trong UserProfile.tsx thành UserProfileForm component riêng"

# Introduce interface
claude "tạo interface INotificationService và refactor EmailNotification, SmsNotification implement interface đó"

# Replace magic numbers
claude "tìm tất cả magic numbers trong src/ và thay bằng named constants"

11. Cost Optimization

Chiến lược tiết kiệm token

# 1. Dùng model phù hợp — không cần Opus cho mọi thứ
/model sonnet
claude "format lại file config này"

# 2. Dùng /compact thường xuyên
/compact

# 3. One-shot mode cho câu hỏi nhanh (không tạo session)
claude -p "cú pháp Promise.all trong TypeScript"

# 4. Gom nhiều thay đổi nhỏ thành 1 prompt
# SAI: 5 prompt riêng lẻ
claude "thêm field email vào User"
claude "thêm field phone vào User"
claude "thêm field address vào User"

# ĐÚNG: 1 prompt gom lại
claude "thêm 3 fields vào User model: email (string, required), phone (string, optional), address (string, optional)"

# 5. Chỉ định rõ scope — tránh Claude đọc file không cần thiết
claude "sửa hàm validateEmail trong file src/utils/validation.ts — chỉ cần xem file đó"

Theo dõi chi phí

# Xem thống kê phiên hiện tại
/cost

# Claude hiển thị token usage sau mỗi phản hồi
# Chú ý: Input tokens thường nhiều hơn output tokens
# Giảm input bằng cách: compact, claudeignore, prompt cụ thể

12. Tích hợp với Workflow hàng ngày

Morning standup helper

# Tóm tắt công việc hôm qua
claude "tóm tắt tất cả commits của tôi từ hôm qua đến giờ, format cho standup meeting:
- Đã làm gì
- Đang làm gì
- Có blocker gì không"

Quy trình review PR hàng ngày

# Review tất cả PR đang mở
claude "liệt kê tất cả PR đang mở trên repo này, tóm tắt changes của từng PR"

# Review PR cụ thể
claude "review PR #42, kiểm tra code quality, security, performance. Để lại comment nếu có vấn đề"

End of day commit routine

# Cuối ngày: commit, push, cập nhật docs
claude "commit tất cả thay đổi hôm nay với message phù hợp, push lên remote"
claude --continue "cập nhật CHANGELOG.md với thay đổi hôm nay"

Sprint planning assistance

# Ước lượng effort cho task
claude "phân tích requirements sau và ước lượng story points:
- Implement OAuth2 login
- Thêm export CSV cho báo cáo
- Refactor payment module
Dựa trên codebase hiện tại, đánh giá độ phức tạp và effort cho từng task"

# Phân tích technical debt
claude "scan codebase và liệt kê technical debt: TODO comments, deprecated code, missing tests, code duplication"

13. Lỗi thường gặp và cách khắc phục

Context quá lớn

# Triệu chứng: Claude phản hồi chậm hoặc báo lỗi context length
# Cách fix:

# 1. Compact context
/compact

# 2. Bắt đầu phiên mới
/clear

# 3. Thêm .claudeignore để loại file không cần
echo "node_modules/" >> .claudeignore
echo "dist/" >> .claudeignore
echo "*.log" >> .claudeignore

# 4. Dùng prompt cụ thể hơn, tránh để Claude đọc nhiều file

Permission denied

# Triệu chứng: Claude không thể đọc/ghi file
# Cách fix:

# Kiểm tra quyền file
ls -la src/config.ts

# Sửa quyền nếu cần
chmod 644 src/config.ts

# Kiểm tra Claude có quyền chạy tool không
# Xem lại settings trong /permissions

Rate limiting

# Triệu chứng: Lỗi 429 Too Many Requests
# Cách fix:

# 1. Đợi 1-2 phút rồi thử lại
# 2. Dùng model rẻ hơn (Haiku/Sonnet)
/model sonnet

# 3. Giảm tần suất request — gom prompt lại
# 4. Kiểm tra plan usage trên console.anthropic.com

Tool execution failed

# Triệu chứng: Claude báo tool call thất bại
# Cách fix:

# 1. Kiểm tra tool có sẵn không
# 2. Kiểm tra permissions
# 3. Thử chạy lệnh thủ công để xem lỗi cụ thể
# 4. Restart Claude session

# Ví dụ: Bash tool fail
# Thử chạy lệnh ngoài Claude trước:
npm test
# Nếu lỗi, fix lỗi rồi quay lại Claude

Model không phản hồi đúng

# Triệu chứng: Claude hiểu sai yêu cầu hoặc output không đúng
# Cách fix:

# 1. Viết prompt rõ ràng hơn, thêm ví dụ
claude "tạo function formatCurrency(amount: number): string
Ví dụ: formatCurrency(1000000) => '1,000,000 VND'
formatCurrency(50000) => '50,000 VND'"

# 2. Chia nhỏ yêu cầu
# 3. Dùng model mạnh hơn
/model opus

# 4. Cung cấp context rõ hơn
claude "trong project này dùng TypeScript strict mode, Prisma ORM. Hãy tạo..."

14. Bảng tham chiếu nhanh

Lệnh CLI cơ bản

Lệnh Mô tả
claude Mở interactive session
claude "prompt" Bắt đầu session với prompt
claude -p "prompt" One-shot mode (print và thoát)
claude --continue Tiếp tục phiên trước
claude --resume Chọn và resume phiên cũ
claude --max-turns N Giới hạn số lượt tool call
claude --model name Chọn model cụ thể
claude --output-format json Output dạng JSON
claude --verbose Hiển thị chi tiết debug

Lệnh trong session (slash commands)

Lệnh Mô tả
/help Hiển thị trợ giúp
/compact Nén context, giữ lại tóm tắt
/clear Xóa toàn bộ context
/cost Xem chi phí phiên hiện tại
/model Xem hoặc đổi model
/fast Toggle fast mode
/memory Xem memory đã lưu
/permissions Quản lý quyền tool
/commit Commit thay đổi với Claude
/code-review Review code hiện tại

Phím tắt

Phím Chức năng
Ctrl+C Hủy lệnh đang chạy
Ctrl+D Thoát Claude
Tab Autocomplete
Up/Down Duyệt lịch sử prompt
Shift+Enter / \\ Xuống dòng trong prompt
Esc Hủy prompt hiện tại
Esc x2 Hủy tool đang chạy

File cấu hình

File Phạm vi Mô tả
~/.claude/CLAUDE.md Global Quy tắc cho tất cả project
./CLAUDE.md Project Quy tắc cho project hiện tại
./src/CLAUDE.md Thư mục Quy tắc cho thư mục cụ thể
.claudeignore Project File/thư mục Claude bỏ qua
~/.claude/settings.json Global Cài đặt Claude CLI
.claude/settings.json Project Cài đặt project cụ thể

Mẹo hay nhớ thuộc

# 1. Luôn bắt đầu prompt bằng hành động cụ thể
"tạo...", "sửa...", "tìm...", "phân tích...", "refactor..."

# 2. Cung cấp context khi cần
"trong file X, hàm Y đang bị lỗi Z"

# 3. Chỉ định output mong muốn
"trả lời dạng bullet points", "tạo file tại src/..."

# 4. Dùng --continue thay vì lặp lại context
claude --continue "bây giờ thêm validation"

# 5. Compact trước khi chuyển task
/compact

# 6. Model phù hợp = tiết kiệm tiền + thời gian
# Haiku cho hỏi nhanh, Sonnet cho code, Opus cho kiến trúc

Tổng kết

Nắm vững các mẹo và thủ thuật trên sẽ giúp bạn:

Hãy bắt đầu từ vài alias cơ bản, sau đó dần áp dụng thêm các kỹ thuật nâng cao theo nhu cầu thực tế của bạn.