Files
claude-howto/vi/CATALOG.md
T
Luong NGUYENandGitHub 4f3fa85d7e docs: follow-ups from the v2.1.220 accuracy review (#161)
* fix(ci): move the EPUB build out of pre-commit into CI

The build-epub hooks called scripts/build_epub.py, which raises when the
mmdc binary is missing, while check_mermaid.py skips with a warning in the
same situation. On arm64 — where @mermaid-js/mermaid-cli has no working
build — that made 'pre-commit run --all-files' impossible to satisfy for a
docs-only change without --no-verify.

Remove the build-epub, vietnamese-build-epub and japanese-build-epub hooks
and widen the CI build-epub job to a language matrix so PR-time coverage is
not reduced: it previously built en only, and now builds en, vi, zh and ja.
zh was covered by neither the hooks nor this job, so a broken zh diagram
could only surface at release time.

Closes #156

* docs: replace the stale Kroki narrative with local mmdc rendering

Commit e76bbe4 swapped the Kroki HTTP dependency for local mmdc rendering
but left the docs describing the old design. The claim appeared in seven
live files, not the two originally reported: CLAUDE.md, scripts/README.md
and their ja/uk/vi copies.

Also corrects what the same staleness dragged along:
- scripts/README.md documented --timeout and --max-concurrent, which no
  longer exist, and omitted --mmdc-path, --lang and --puppeteer-config
- 'Async concurrent fetching' described a render_all() that is now a plain
  sequential loop with a dedupe cache
- the network-error/rate-limiting troubleshooting entries are replaced with
  the failures that actually occur now (missing mmdc, Chromium sandbox)

CHANGELOG entries recording the Kroki-to-mmdc switch are left alone; they
describe the past accurately.

Closes #157

* fix(scripts): make the ruff config match files that exist

Ruff resolves include/per-file-ignores patterns relative to the directory
holding pyproject.toml. Since the config lives in scripts/, the pattern
"scripts/**/*.py" meant scripts/scripts/**/*.py, which matches nothing —
'ruff check scripts/' printed 'warning: No Python files found under the
given path(s)' and then 'All checks passed!'. per-file-ignores had the same
mistake. Both are now relative to scripts/, so ruff sees all 14 files.

This silently disabled the pre-commit ruff hooks too, not just the
documented command, and two test files had drifted out of format as a
result. Reformatting them exposed a second problem: the pre-commit hook
pinned ruff v0.8.2 while the CI lint job installs unpinned latest and this
venv has 0.15.10. The versions disagree on formatting, so each reverted the
other's output, and CI would have started failing on a file the local hook
kept rewriting. Bump the hook pin and the requirements-dev floor to 0.15.10
so all three agree.

Verified: 'pre-commit run --all-files' is stable across consecutive runs,
'ruff format --check scripts/' and 'ruff check scripts/' both pass, 92
tests pass.

Closes #160

* docs: point localized module links at their own trees

Files at the root of a language directory used ../NN-module/, which from
uk/CATALOG.md resolves to the English 05-mcp/ at the repo root rather than
uk/05-mcp/. Readers following a count stated about the localized tree
landed in the English one. The link checker never caught it because the
English target does exist.

Files one level deeper (uk/04-subagents/README.md and friends) were already
correct — ../06-hooks/ from there resolves to uk/06-hooks/ — so this is
scoped to the 7 depth-1 files that actually escape: CATALOG.md in uk, vi,
ja and zh, LEARNING-ROADMAP.md in uk and vi, and ja/claude_concepts_guide.md.
119 links in total.

The ../NN- occurrences left in STYLE_GUIDE.md and TRANSLATION_NOTES.md are
inside fenced examples showing what a module page should contain, where the
../ form is the correct convention. All 119 rewritten targets were verified
to exist.

Closes #158

* docs(hooks): stop conflating hook types with hook event categories

'**Hook Types** (5 types, 31 events)' sat above four bullets, so the count
read as wrong. It was not — the two numbers describe different axes that
had been merged into one label.

06-hooks/README.md:126 documents five hook *types*: command, http, prompt,
mcp_tool and agent. Those describe how a hook runs. The four bullets are
event *categories* — Tool, Session, Task, Lifecycle — holding 31 events
(6+7+6+12), and describe when it runs.

Split the label so each number belongs to the axis it counts, in all nine
affected files: README.md and INDEX.md plus the ja, uk, vi and zh copies.
QUICK_REFERENCE.md and LEARNING-ROADMAP.md already stated '5 types' with
the handler names attached and needed no change.

Closes #159

* chore(scripts): drop the unused httpx dependency

httpx was the HTTP client for Kroki rendering. Nothing has imported it
since e76bbe4 moved diagram rendering to a local mmdc subprocess —
check_links.py, the only other network caller, uses stdlib urllib.request.
The PEP 723 blocks in build_epub.py and build_website.py had already
dropped it; only the manifests and docs still declared it.

Removes it from requirements.txt, pyproject.toml dependencies, the
dependency tables and uv --with lines in scripts/README.md and its ja/uk
copies, and the .cspell.json word list. Also drops the B113 bandit
suppression, which existed solely for an httpx timeout false positive —
bandit reports no issues without it.

Also corrects two Requirements lines missed in the previous pass: the ja
and uk script READMEs still listed an internet connection rather than mmdc.

Note: tenacity is now dead for the same reason and is left in place.

* chore(scripts): drop the unused tenacity dependency

Nothing imports tenacity — the retry logic it was added for went away
with the Kroki HTTP fetching in e76bbe4. It was still declared in
requirements.txt, pyproject.toml, both `uv run --with` lines and all
three dependency tables.

* docs(i18n): sync the localized pre-commit check lists

The ja/uk/vi CLAUDE.md files still listed build-epub as pre-commit
check #5, stale since 6da8184 moved the EPUB build to CI. They also
omitted markdown-rendering, and the ja/uk stated counts disagreed with
their own lists. Now matches the English CLAUDE.md.

* fix(scripts): silence PLR0917 now stable in ruff 0.16

CI installs the latest ruff (uv pip install ruff, unpinned), and 0.16.1
promoted too-many-positional-arguments from preview to stable, hard-failing
the Code Quality check on build_epub.py's long-signature draw/helper
functions. These sit in the same family as PLR0913, which is already
ignored. Add PLR0917 so the local 0.15.10 pin and unpinned CI lint agree
again.
2026-08-06 07:58:46 +07:00

518 lines
29 KiB
Markdown

<picture>
<source media="(prefers-color-scheme: dark)" srcset="../resources/logos/claude-howto-logo-dark.svg">
<img alt="Claude How To" src="../resources/logos/claude-howto-logo.svg">
</picture>
# Danh Mục Tính Năng Claude Code
> Hướng dẫn tham khảo nhanh cho tất cả tính năng Claude Code: commands, agents, skills, plugins, và hooks.
**Điều Hướng**: [Commands](#lệnh-slash) | [Permission Modes](#permission-modes) | [Tác Nhân Con](#tác-nhân-con) | [Skills](#skills) | [Plugins](#plugins) | [MCP Servers](#mcp-servers) | [Hooks](#hooks) | [Bộ Nhớ](#files-bộ-nhớ) | [Tính Năng Mới](#tính-năng-mới-tháng-3-năm-2026)
---
## Tóm Tắt
| Tính Năng | Built-in | Ví Dụ | Tổng | Tham Chiếu |
|---------|----------|----------|-------|-----------|
| **Lệnh Slash** | 60+ | 8 | 68+ | [01-slash-commands/](01-slash-commands/) |
| **Tác Nhân Con** | 6 | 6 | 12 | [04-subagents/](04-subagents/) |
| **Skills** | 10 bundled | 5 | 15 | [03-skills/](03-skills/) |
| **Plugins** | - | 3 | 3 | [07-plugins/](07-plugins/) |
| **MCP Servers** | 1 | 4 | 5 | [05-mcp/](05-mcp/) |
| **Hooks** | 31 sự kiện | 9 | 40 | [06-hooks/](06-hooks/) |
| **Bộ Nhớ** | 7 loại | 3 | 10 | [02-memory/](02-memory/) |
| **Tổng** | **115** | **38** | **153** | |
---
## Lệnh Slash
Commands là các lệnh tắt do người dùng gọi thực hiện các hành động cụ thể.
### Built-in Commands
| Command | Mô Tả | Khi Nào Dùng |
|---------|-------------|-------------|
| `/help` | Hiển thị thông tin help | Bắt đầu, học commands |
| `/btw` | Câu hỏi phụ không thêm vào context | Câu hỏi nhanh |
| `/chrome` | Cấu hình tích hợp Chrome | Tự động hóa trình duyệt |
| `/clear` | Xóa lịch sử conversation | Bắt đầu mới, giảm context |
| `/diff` | Trình xem diff tương tác | Review thay đổi |
| `/config` | Xem/chỉnh sửa cấu hình | Tùy chỉnh hành vi |
| `/status` | Hiển thị trạng thái session | Kiểm tra trạng thái hiện tại |
| `/agents` | Liệt kê các agents có sẵn | Xem tùy chọn ủy quyền |
| `/skills` | Liệt kê các skills có sẵn | Xem khả năng auto-invoke |
| `/hooks` | Liệt kê các hooks đã cấu hình | Debug tự động hóa |
| `/insights` | Phân tích patterns của session | Tối ưu hóa session |
| `/install-slack-app` | Cài đặt Claude Slack app | Tích hợp Slack |
| `/keybindings` | Tùy chỉnh phím tắt | Tùy chỉnh phím |
| `/mcp` | Liệt kê MCP servers | Kiểm tra tích hợp bên ngoài |
| `/memory` | Xem các file bộ nhớ đã tải | Debug tải context |
| `/mobile` | Tạo QR code mobile | Truy cập mobile |
| `/passes` | Xem usage passes | Thông tin subscription |
| `/plugin` | Quản lý plugins | Cài đặt/gỡ mở rộng |
| `/plan` | Vào planning mode | Triển khai phức tạp |
| `/rewind` | Rewind về checkpoint | Hoàn tác thay đổi, khám phá alternatives |
| `/checkpoint` | Quản lý checkpoints | Lưu/khôi phục trạng thái |
| `/cost` | Hiển thị chi phí usage token | Giám sát chi tiêu |
| `/context` | Hiển thị usage context window | Quản lý độ dài conversation |
| `/export` | Xuất conversation | Lưu để tham khảo |
| `/extra-usage` | Cấu hình giới hạn usage thêm | Quản lý rate limit |
| `/feedback` | Gửi feedback hoặc báo cáo bug | Báo cáo vấn đề |
| `/login` | Xác thực với Anthropic | Truy cập tính năng |
| `/logout` | Đăng xuất | Chuyển tài khoản |
| `/sandbox` | Bật/tắt sandbox mode | Thực thi command an toàn |
| `/vim` | Bật/tắt vim mode | Chỉnh sửa kiểu Vim |
| `/doctor` | Chạy chẩn đoán | Khắc phục sự cố |
| `/reload-plugins` | Tải lại plugins đã cài đặt | Quản lý plugin |
| `/release-notes` | Hiển thị release notes | Kiểm tra tính năng mới |
| `/remote-control` | Bật điều khiển từ xa | Truy cập từ xa |
| `/permissions` | Quản lý permissions | Kiểm soát truy cập |
| `/session` | Quản lý sessions | Workflows đa session |
| `/rename` | Đổi tên session hiện tại | Tổ chức sessions |
| `/resume` | Tiếp tục session trước | Tiếp tục làm việc |
| `/todo` | Xem/quản lý todo list | Theo dõi tasks |
| `/tasks` | Xem background tasks | Giám sát operations async |
| `/copy` | Sao chép response cuối vào clipboard | Chia sẻ output nhanh |
| `/teleport` | Chuyển session sang máy khác | Tiếp tục làm việc từ xa |
| `/desktop` | Mở Claude Desktop app | Chuyển sang interface desktop |
| `/theme` | Đổi màu theme | Tùy chỉnh giao diện |
| `/usage` | Hiển thị thống kê usage API | Giám sát quota và chi phí |
| `/fork` | Sao chép cuộc hội thoại thành một phiên nền độc lập mới (v2.1.212+) | Khám phá alternatives song song |
| `/subtask` | Spawn một subagent được fork kế thừa cuộc hội thoại và báo cáo lại (v2.1.212+) | Giao một tác vụ phụ mà không mất chỗ đang làm |
| `/stats` | Hiển thị thống kê session | Review metrics session |
| `/statusline` | Cấu hình status line | Tùy chỉnh hiển thị trạng thái |
| `/stickers` | Xem stickers của session | Phần thưởng vui |
| `/fast` | Bật/tắt mode output nhanh | Tăng tốc độ responses |
| `/terminal-setup` | Cấu hình tích hợp terminal | Thiết lập tính năng terminal |
| `/upgrade` | Kiểm tra cập nhật | Quản lý phiên bản |
### Custom Commands (Ví Dụ)
| Command | Mô Tả | Khi Nào Dùng | Phạm Vi | Cài Đặt |
|---------|-------------|-------------|-------|--------------|
| `/optimize` | Phân tích code để tối ưu hóa | Cải thiện hiệu năng | Project | `cp ../01-slash-commands/optimize.md .claude/commands/` |
| `/pr` | Chuẩn bị pull request | Trước khi gửi PRs | Project | `cp ../01-slash-commands/pr.md .claude/commands/` |
| `/generate-api-docs` | Tạo tài liệu API | Tài liệu hóa APIs | Project | `cp ../01-slash-commands/generate-api-docs.md .claude/commands/` |
| `/commit` | Tạo git commit với context | Commit thay đổi | User | `cp ../01-slash-commands/commit.md .claude/commands/` |
| `/push-all` | Stage, commit, và push | Triển khai nhanh | User | `cp ../01-slash-commands/push-all.md .claude/commands/` |
| `/doc-refactor` | Tái cấu trúc tài liệu | Cải thiện docs | Project | `cp ../01-slash-commands/doc-refactor.md .claude/commands/` |
| `/setup-ci-cd` | Thiết lập pipeline CI/CD | Dự án mới | Project | `cp ../01-slash-commands/setup-ci-cd.md .claude/commands/` |
| `/unit-test-expand` | Mở rộng độ phủ test | Cải thiện testing | Project | `cp ../01-slash-commands/unit-test-expand.md .claude/commands/` |
> **Phạm Vi**: `User` = workflows cá nhân (`~/.claude/commands/`), `Project` = chia sẻ team (`.claude/commands/`)
**Tham Chiếu**: [01-slash-commands/](01-slash-commands/) | [Tài Liệu Chính Thức](https://code.claude.com/docs/en/interactive-mode)
**Cài Đặt Nhanh (Tất Cả Custom Commands)**:
```bash
cp ../01-slash-commands/*.md .claude/commands/
```
---
## Permission Modes
Claude Code hỗ trợ 6 permission modes điều khiển cách tool use được ủy quyền.
| Mode | Mô Tả | Khi Nào Dùng |
|------|-------------|-------------|
| `default` | Hỏi cho mỗi tool call | Sử dụng tương tác tiêu chuẩn |
| `acceptEdits` | Tự động chấp nhận edits file, hỏi cho các khác | Workflows chỉnh sửa tin cậy |
| `plan` | Chỉ tools read-only, không ghi | Lập kế hoạch và khám phá |
| `auto` | Tất cả hành động, có kiểm tra từ bộ phân loại an toàn nền | Tác vụ dài, giảm số lần nhắc quyền |
| `bypassPermissions` | Bỏ qua tất cả kiểm tra permissions | CI/CD, môi trường headless |
| `dontAsk` | Bỏ qua tools cần yêu cầu permission | Scripting không tương tác |
> **Lưu Ý**: `auto` mode yêu cầu gói dịch vụ, model, và nhà cung cấp đủ điều kiện — xem [09-advanced-features/](09-advanced-features/#auto-mode). Chỉ dùng `bypassPermissions` trong môi trường tin cậy, được sandbox.
**Tham Chiếu**: [Tài Liệu Chính Thức](https://code.claude.com/docs/en/permissions)
---
## Tác Nhân Con
Các trợ lý AI chuyên biệt với context bị cô lập cho các tasks cụ thể.
### Built-in Subagents
| Agent | Mô Tả | Tools | Model | Khi Nào Dùng |
|-------|-------------|-------|-------|-------------|
| **general-purpose** | Tasks đa bước, nghiên cứu | All tools | Kế thừa model | Nghiên cứu phức tạp, tasks đa file |
| **Plan** | Lập kế hoạch triển khai | Read, Glob, Grep, Bash | Kế thừa model | Thiết kế kiến trúc, lập kế hoạch |
| **Explore** | Khám phá codebase | Read, Glob, Grep | Haiku 4.5 | Tìm kiếm nhanh, hiểu code |
| **Bash** | Thực thi command | Bash | Kế thừa model | Operations Git, tasks terminal |
| **statusline-setup** | Cấu hình status line | Bash, Read, Write | Sonnet 4.6 | Cấu hình hiển thị status line |
| **Claude Code Guide** | Trợ giúp và tài liệu | Read, Glob, Grep | Haiku 4.5 | Nhận trợ giúp, học tính năng |
### Subagent Configuration Fields
| Field | Type | Mô Tả |
|-------|------|-------------|
| `name` | string | Định danh agent |
| `description` | string | Agent làm gì |
| `model` | string | Ghi đè model (ví dụ: `haiku-4.5`) |
| `tools` | array | Danh sách tools được phép |
| `effort` | string | Mức độ effort lý luận (`low`, `medium`, `high`) |
| `initialPrompt` | string | System prompt được chèn khi agent bắt đầu |
| `disallowedTools` | array | Tools bị từ chối rõ ràng cho agent này |
### Custom Subagents (Ví Dụ)
| Agent | Mô Tả | Khi Nào Dùng | Phạm Vi | Cài Đặt |
|-------|-------------|-------------|-------|--------------|
| `code-reviewer` | Chất lượng code toàn diện | Sessions review code | Project | `cp ../04-subagents/code-reviewer.md .claude/agents/` |
| `code-architect` | Thiết kế kiến trúc tính năng | Lập kế hoạch tính năng mới | Project | `cp ../04-subagents/code-architect.md .claude/agents/` |
| `code-explorer` | Phân tích codebase sâu | Hiểu tính năng hiện có | Project | `cp ../04-subagents/code-explorer.md .claude/agents/` |
| `clean-code-reviewer` | Review nguyên tắc Clean Code | Review khả năng bảo trì | Project | `cp ../04-subagents/clean-code-reviewer.md .claude/agents/` |
| `test-engineer` | Chiến lược & độ phủ test | Lập kế hoạch test | Project | `cp ../04-subagents/test-engineer.md .claude/agents/` |
| `documentation-writer` | Tài liệu kỹ thuật | Tài liệu API, hướng dẫn | Project | `cp ../04-subagents/documentation-writer.md .claude/agents/` |
| `secure-reviewer` | Review tập trung bảo mật | Kiểm tra bảo mật | Project | `cp ../04-subagents/secure-reviewer.md .claude/agents/` |
| `implementation-agent` | Triển khai tính năng hoàn chỉnh | Phát triển tính năng | Project | `cp ../04-subagents/implementation-agent.md .claude/agents/` |
| `debugger` | Phân tích nguyên nhân gốc | Điều tra bug | User | `cp ../04-subagents/debugger.md ~/.claude/agents/` |
| `data-scientist` | Truy vấn SQL, phân tích dữ liệu | Tasks dữ liệu | User | `cp ../04-subagents/data-scientist.md ~/.claude/agents/` |
> **Phạm Vi**: `User` = cá nhân (`~/.claude/agents/`), `Project` = chia sẻ team (`.claude/agents/`)
**Tham Chiếu**: [04-subagents/](04-subagents/) | [Tài Liệu Chính Thức](https://code.claude.com/docs/en/sub-agents)
**Cài Đặt Nhanh (Tất Cả Custom Agents)**:
```bash
cp ../04-subagents/*.md .claude/agents/
```
---
## Skills
Các khả năng tự động gọi với hướng dẫn, scripts, và templates.
### Ví Dụ Skills
| Skill | Mô Tả | Khi Tự Động Gọi | Phạm Vi | Cài Đặt |
|-------|-------------|-------------------|-------|--------------|
| `code-review` | Review code toàn diện | "Review this code", "Check quality" | Project | `cp -r ../03-skills/code-review-specialist .claude/skills/` |
| `brand-voice` | Kiểm tra nhất quán brand | Viết marketing copy | Project | `cp -r ../03-skills/brand-voice .claude/skills/` |
| `doc-generator` | Trình tạo tài liệu API | "Generate docs", "Document API" | Project | `cp -r ../03-skills/doc-generator .claude/skills/` |
| `refactor` | Refactor code có hệ thống (Martin Fowler) | "Refactor this", "Clean up code" | User | `cp -r ../03-skills/refactor ~/.claude/skills/` |
> **Phạm Vi**: `User` = cá nhân (`~/.claude/skills/`), `Project` = chia sẻ team (`.claude/skills/`)
### Skill Structure
```
~/.claude/skills/skill-name/
├── SKILL.md # Định nghĩa & hướng dẫn skill
├── scripts/ # Scripts hỗ trợ
└── templates/ # Templates output
```
### Skill Frontmatter Fields
Skills hỗ trợ YAML frontmatter trong `SKILL.md` để cấu hình:
| Field | Type | Mô Tả |
|-------|------|-------------|
| `name` | string | Tên hiển thị skill |
| `description` | string | Skill làm gì |
| `autoInvoke` | array | Cụm từ kích hoạt cho auto-invocation |
| `effort` | string | Mức độ effort lý luận (`low`, `medium`, `high`) |
| `shell` | string | Shell để dùng cho scripts (`bash`, `zsh`, `sh`) |
**Tham Chiếu**: [03-skills/](03-skills/) | [Tài Liệu Chính Thức](https://code.claude.com/docs/en/skills)
**Cài Đặt Nhanh (Tất Cả Skills)**:
```bash
cp -r ../03-skills/* ~/.claude/skills/
```
### Bundled Skills
| Skill | Mô Tả | Khi Tự Động Gọi |
|-------|-------------|-------------------|
| `/simplify` | Review code về chất lượng | Sau khi viết code |
| `/batch` | Chạy prompts trên nhiều files | Operations hàng loạt |
| `/debug` | Debug tests/errors thất bại | Sessions debugging |
| `/loop` | Chạy prompts theo interval | Tasks định kỳ |
| `/claude-api` | Xây dựng apps với Claude API | Phát triển API |
---
## Plugins
Bộ sưu tập được đóng gói của commands, agents, MCP servers, và hooks.
### Ví Dụ Plugins
| Plugin | Mô Tả | Components | Khi Nào Dùng | Phạm Vi | Cài Đặt |
|--------|-------------|------------|-------------|-------|--------------|
| `pr-review` | Workflow review PR | 3 commands, 3 agents, GitHub MCP | Review code | Project | `/plugin install pr-review` |
| `devops-automation` | Triển khai & giám sát | 4 commands, 3 agents, K8s MCP | Tasks DevOps | Project | `/plugin install devops-automation` |
| `documentation` | Bộ tạo tài liệu | 4 commands, 3 agents, templates | Tài liệu | Project | `/plugin install documentation` |
> **Phạm Vi**: `Project` = chia sẻ team, `User` = workflows cá nhân
### Plugin Structure
```
.claude-plugin/
├── plugin.json # File manifest
├── commands/ # Lệnh slash
├── agents/ # Tác nhân con
├── skills/ # Skills
├── mcp/ # Cấu hình MCP
├── hooks/ # Script hooks
└── scripts/ # Scripts tiện ích
```
**Tham Chiếu**: [07-plugins/](07-plugins/) | [Tài Liệu Chính Thức](https://code.claude.com/docs/en/plugins)
**Plugin Management Commands**:
```bash
/plugin list # Liệt kê plugins đã cài
/plugin install <name> # Cài plugin
/plugin remove <name> # Gỡ plugin
/plugin update <name> # Cập nhật plugin
```
---
## MCP Servers
Máy chủ Model Context Protocol cho truy cập công cụ và API bên ngoài.
### MCP Servers Phổ Biến
| Server | Mô Tả | Khi Nào Dùng | Phạm Vi | Cài Đặt |
|--------|-------------|-------------|-------|--------------|
| **GitHub** | Quản lý PR, issues, code | Workflows GitHub | Project | `claude mcp add github -- npx -y @modelcontextprotocol/server-github` |
| **Database** | Truy vấn SQL, truy cập dữ liệu | Operations database | Project | `claude mcp add db -- npx -y @modelcontextprotocol/server-postgres` |
| **Filesystem** | Operations file nâng cao | Tasks file phức tạp | User | `claude mcp add fs -- npx -y @modelcontextprotocol/server-filesystem` |
| **Slack** | Communication team | Thông báo, cập nhật | Project | Cấu hình trong settings |
| **Google Docs** | Truy cập tài liệu | Chỉnh sửa, review docs | Project | Cấu hình trong settings |
| **Asana** | Quản lý dự án | Theo dõi tasks | Project | Cấu hình trong settings |
| **Stripe** | Dữ liệu thanh toán | Phân tích tài chính | Project | Cấu hình trong settings |
| **Memory** | Bộ nhớ lưu trữ | Nhớ lại qua sessions | User | Cấu hình trong settings |
| **Context7** | Tài liệu thư viện | Tra cứu docs cập nhật | Built-in | Built-in |
> **Phạm Vi**: `Project` = team (`.mcp.json`), `User` = cá nhân (`~/.claude.json`), `Built-in` = được cài trước
### MCP Configuration Example
```json
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}
```
**Tham Chiếu**: [05-mcp/](05-mcp/) | [Tài Liệu Giao Thức MCP](https://modelcontextprotocol.io)
**Cài Đặt Nhanh (GitHub MCP)**:
```bash
export GITHUB_TOKEN="your_token" && claude mcp add github -- npx -y @modelcontextprotocol/server-github
```
---
## Hooks
Tự động hóa dựa trên sự kiện thực thi shell commands trên các sự kiện Claude Code.
### Hook Events
| Event | Mô Tả | Khi Được Kích Hoạt | Use Cases |
|-------|-------------|----------------|-----------|
| `SessionStart` | Session bắt đầu/tiếp tục | Khởi tạo session | Tasks thiết lập |
| `InstructionsLoaded` | Hướng dẫn được tải | CLAUDE.md hoặc file rules được tải | Xử lý hướng dẫn tùy chỉnh |
| `UserPromptSubmit` | Trước khi xử lý prompt | User gửi tin nhắn | Xác thực input |
| `PreToolUse` | Trước khi thực thi tool | Trước khi bất kỳ tool chạy | Xác thực, logging |
| `PermissionRequest` | Dialog permission được hiển thị | Trước hành động nhạy cảm | Flows phê duyệt tùy chỉnh |
| `PostToolUse` | Sau khi tool thành công | Sau khi bất kỳ tool hoàn thành | Formatting, thông báo |
| `PostToolUseFailure` | Thực thi tool thất bại | Sau khi tool lỗi | Xử lý lỗi, logging |
| `Notification` | Thông báo được gửi | Claude gửi thông báo | Cảnh báo bên ngoài |
| `SubagentStart` | Subagent được tạo | Task subagent bắt đầu | Khởi tạo context subagent |
| `SubagentStop` | Subagent hoàn thành | Task subagent hoàn tất | Chuỗi hành động |
| `Stop` | Claude hoàn thành phản hồi | Phản hồi hoàn tất | Dọn dẹp, báo cáo |
| `StopFailure` | Lỗi API kết thúc turn | Lỗi API xảy ra | Phục hồi lỗi, logging |
| `TeammateIdle` | Agent teammate rảnh | Phối hợp agent team | Phân phối work |
| `TaskCompleted` | Task được đánh dấu hoàn tất | Task xong | Xử lý post-task |
| `TaskCreated` | Task được tạo qua TaskCreate | Task mới được tạo | Theo dõi task, logging |
| `ConfigChange` | Cấu hình được cập nhật | Settings được sửa đổi | Phản ứng thay đổi config |
| `CwdChanged` | Thư mục làm việc thay đổi | Thư mục thay đổi | Thiết lập cụ thể theo thư mục |
| `FileChanged` | File được theo dõi thay đổi | File được sửa | Giám sát file, rebuild |
| `PreCompact` | Trước operation compact | Nén context | Bảo toàn trạng thái |
| `PostCompact` | Sau khi compact hoàn tất | Compact xong | Hành động post-compact |
| `WorktreeCreate` | Worktree đang được tạo | Git worktree được tạo | Thiết lập môi trường worktree |
| `WorktreeRemove` | Worktree đang bị gỡ | Git worktree bị gỡ | Dọn dẹp tài nguyên worktree |
| `Elicitation` | MCP server yêu cầu input | MCP elicitation | Xác thực input |
| `ElicitationResult` | User phản hồi elicitation | User phản hồi | Xử lý phản hồi |
| `SessionEnd` | Session chấm dứt | Chấm dứt session | Dọn dẹp, lưu trạng thái |
### Ví Dụ Hooks
| Hook | Mô Tả | Event | Phạm Vi | Cài Đặt |
|------|-------------|-------|-------|--------------|
| `validate-bash.py` | Xác thực command | PreToolUse:Bash | Project | `cp ../06-hooks/validate-bash.py .claude/hooks/` |
| `security-scan.py` | Quét bảo mật | PostToolUse:Write | Project | `cp ../06-hooks/security-scan.py .claude/hooks/` |
| `format-code.sh` | Tự động format | PostToolUse:Write | User | `cp ../06-hooks/format-code.sh ~/.claude/hooks/` |
| `validate-prompt.py` | Xác thực prompt | UserPromptSubmit | Project | `cp ../06-hooks/validate-prompt.py .claude/hooks/` |
| `context-tracker.py` | Theo dõi usage token | Stop | User | `cp ../06-hooks/context-tracker.py ~/.claude/hooks/` |
| `pre-commit.sh` | Xác thực pre-commit | PreToolUse:Bash | Project | `cp ../06-hooks/pre-commit.sh .claude/hooks/` |
| `log-bash.sh` | Ghi log commands | PostToolUse:Bash | User | `cp ../06-hooks/log-bash.sh ~/.claude/hooks/` |
> **Phạm Vi**: `Project` = team (`.claude/settings.json`), `User` = cá nhân (`~/.claude/settings.json`)
### Hook Configuration
```json
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"command": "~/.claude/hooks/validate-bash.py"
}
],
"PostToolUse": [
{
"matcher": "Write",
"command": "~/.claude/hooks/format-code.sh"
}
]
}
}
```
**Tham Chiếu**: [06-hooks/](06-hooks/) | [Tài Liệu Chính Thức](https://code.claude.com/docs/en/hooks)
**Cài Đặt Nhanh (Tất Cả Hooks)**:
```bash
mkdir -p ~/.claude/hooks && cp ../06-hooks/*.sh ~/.claude/hooks/ && chmod +x ~/.claude/hooks/*.sh
```
---
## Files Bộ Nhớ
Ngữ cảnh lưu trữ được tải tự động qua sessions.
### Loại Bộ Nhớ
| Loại | Vị Trí | Phạm Vi | Khi Nào Dùng |
|------|----------|-------|-------------|
| **Managed Policy** | Policies được quản lý bởi tổ chức | Tổ chức | Thực thi tiêu chuẩn toàn tổ chức |
| **Project** | `./CLAUDE.md` | Project (team) | Tiêu chuẩn team, context dự án |
| **Project Rules** | `.claude/rules/` | Project (team) | Rules dự án modular |
| **User** | `~/.claude/CLAUDE.md` | User (cá nhân) | Sở thích cá nhân |
| **User Rules** | `~/.claude/rules/` | User (cá nhân) | Rules cá nhân modular |
| **Local** | `./CLAUDE.local.md` | Local (git-ignored) | Ghi đè cụ thể theo máy (không trong tài liệu chính thức tính đến tháng 3/2026; có thể là legacy) |
| **Auto Memory** | Tự động | Session | Insights và chỉnh sửa được tự động nắm bắt |
> **Phạm Vi**: `Organization` = được quản lý bởi admins, `Project` = chia sẻ với team qua git, `User` = sở thích cá nhân, `Local` = không được commit, `Session` = được tự động quản lý
**Tham Chiếu**: [02-memory/](02-memory/) | [Tài Liệu Chính Thức](https://code.claude.com/docs/en/memory)
**Cài Đặt Nhanh**:
```bash
cp ../02-memory/project-CLAUDE.md ./CLAUDE.md
cp ../02-memory/personal-CLAUDE.md ~/.claude/CLAUDE.md
```
---
## Tính Năng Mới (Tháng 3 Năm 2026)
| Tính Năng | Mô Tả | Cách Dùng |
|---------|-------------|------------|
| **Remote Control** | Điều khiển sessions Claude Code từ xa qua API | Sử dụng API điều khiển từ xa để gửi prompts và nhận responses theo chương trình |
| **Web Sessions** | Chạy Claude Code trong môi trường dựa trên trình duyệt | Truy cập qua `claude web` hoặc qua Anthropic Console |
| **Desktop App** | Ứng dụng desktop native cho Claude Code | Sử dụng `/desktop` hoặc tải từ website Anthropic |
| **Agent Teams** | Phối hợp nhiều agents làm việc trên các tasks liên quan | Cấu hình teammate agents cộng tác và chia sẻ context |
| **Task List** | Quản lý và giám sát background tasks | Sử dụng `/tasks` để xem và quản lý operations nền |
| **Prompt Suggestions** | Gợi ý command nhận biết ngữ cảnh | Gợi ý xuất hiện tự động dựa trên ngữ cảnh hiện tại |
| **Git Worktrees** | Git worktrees bị cô lập để phát triển song song | Sử dụng commands worktree để làm việc branch song song an toàn |
| **Sandboxing** | Môi trường thực thi bị cô lập để an toàn | Sử dụng `/sandbox` để bật/tắt; chạy commands trong môi trường bị hạn chế |
| **MCP OAuth** | Xác thực OAuth cho MCP servers | Cấu hình credentials OAuth trong settings MCP server để truy cập an toàn |
| **MCP Tool Search** | Tìm kiếm và khám phá MCP tools động | Sử dụng tìm kiếm tool để tìm MCP tools có sẵn qua các servers được kết nối |
| **Scheduled Tasks** | Thiết lập tasks định kỳ với `/loop` và cron tools | Sử dụng `/loop 5m /command` hoặc công cụ CronCreate |
| **Chrome Integration** | Tự động hóa trình duyệt với headless Chromium | Sử dụng flag `--chrome` hoặc command `/chrome` |
| **Keyboard Customization** | Tùy chỉnh keybindings bao gồm hỗ trợ chord | Sử dụng `/keybindings` hoặc chỉnh sửa `~/.claude/keybindings.json` |
| **Auto Mode** | Vận hành hoàn toàn tự động với kiểm tra từ bộ phân loại an toàn nền | `Shift+Tab` để chuyển sang, hoặc `--permission-mode auto` |
| **Channels** | Communication đa kênh (Telegram, Slack, v.v.) (Research Preview) | Cấu hình plugins channels; Tháng 3 năm 2026 |
| **Voice Dictation** | Input giọng nói cho prompts | Sử dụng icon microphone hoặc keybinding giọng nói |
| **Agent Hook Type** | Hooks tạo subagent thay vì chạy shell command | Đặt `"type": "agent"` trong cấu hình hook |
| **Prompt Hook Type** | Hooks chèn văn bản prompt vào conversation | Đặt `"type": "prompt"` trong cấu hình hook |
| **MCP Elicitation** | MCP servers có thể yêu cầu input người dùng trong khi thực thi tool | Xử lý qua các sự kiện hook `Elicitation``ElicitationResult` |
| **WebSocket MCP Transport** | Transport dựa trên WebSocket cho kết nối MCP server | Sử dụng `"transport": "websocket"` trong cấu hình MCP server |
| **Plugin LSP Support** | Tích hợp Language Server Protocol qua plugins | Cấu hình servers LSP trong `plugin.json` cho tính năng editor |
| **Managed Drop-ins** | Cấu hình drop-ins được quản lý bởi tổ chức (v2.1.83) | Được cấu hình bởi admin qua policies được quản lý; tự động áp dụng cho tất cả users |
---
## Ma Trận Tham Khảo Nhanh
### Hướng Dẫn Chọn Tính Năng
| Nhu Cầu | Tính Năng Khuyến Nghị | Tại Sao |
|------|---------------------|-----|
| Phím tắt nhanh | Lệnh Slash | Thủ công, ngay lập tức |
| Ngữ cảnh lưu trữ | Bộ Nhớ | Tự động tải |
| Tự động hóa phức tạp | Skill | Tự động gọi |
| Task chuyên biệt | Tác Nhân Con | Context bị cô lập |
| Dữ liệu bên ngoài | MCP Server | Truy cập thời gian thực |
| Tự động hóa sự kiện | Hook | Được kích hoạt bởi sự kiện |
| Giải pháp hoàn chỉnh | Plugin | Gói tất cả trong một |
### Ưu Tiên Cài Đặt
| Ưu Tiên | Tính Năng | Command |
|----------|---------|---------|
| 1. Thiết Yếu | Bộ Nhớ | `cp ../02-memory/project-CLAUDE.md ./CLAUDE.md` |
| 2. Dùng Hàng Ngày | Lệnh Slash | `cp ../01-slash-commands/*.md .claude/commands/` |
| 3. Chất Lượng | Tác Nhân Con | `cp ../04-subagents/*.md .claude/agents/` |
| 4. Tự Động Hóa | Hooks | `cp ../06-hooks/*.sh ~/.claude/hooks/ && chmod +x ~/.claude/hooks/*.sh` |
| 5. Bên Ngoài | MCP | `claude mcp add github -- npx -y @modelcontextprotocol/server-github` |
| 6. Nâng Cao | Skills | `cp -r ../03-skills/* ~/.claude/skills/` |
| 7. Hoàn Chỉnh | Plugins | `/plugin install pr-review` |
---
## Cài Đặt Một Lệnh Hoàn Chỉnh
Cài đặt tất cả ví dụ từ repository này:
```bash
# Tạo thư mục
mkdir -p .claude/{commands,agents,skills} ~/.claude/{hooks,skills}
# Cài đặt tất cả tính năng
cp ../01-slash-commands/*.md .claude/commands/ && \
cp ../02-memory/project-CLAUDE.md ./CLAUDE.md && \
cp -r ../03-skills/* ~/.claude/skills/ && \
cp ../04-subagents/*.md .claude/agents/ && \
cp ../06-hooks/*.sh ~/.claude/hooks/ && \
chmod +x ~/.claude/hooks/*.sh
```
---
## Tài Nguyên Thêm
- [Tài Liệu Chính Thức Claude Code](https://code.claude.com/docs/en/overview)
- [Đặc Tả Giao Thức MCP](https://modelcontextprotocol.io)
- [Lộ Trình Học Tập](../LEARNING-ROADMAP.md)
- [README Chính](../README.md)
---
**Cập Nhật Lần**: Tháng 3 năm 2026