QuotaCheap Playbook

Claude Code subagents: giữ context sạch bằng Explore, Plan và custom workers

Tìm hiểu claude code subagents: giữ context sạch bằng explore, plan và custom workers theo Claude Code docs: subagents, agent view, teams, GitHub Actions,…

Subagents docs nói subagents là specialized AI assistants cho task-specific workflows và context management. Mỗi subagent chạy trong context window riêng, có custom system prompt, tool access và independent permissions; built-in subagents gồm Explore, Plan và general-purpose.

Bài Claude Code Playbook: Subagents docs nói subagents là specialized AI assistants cho task-specific workflows và context management. Mỗi subagent chạy trong context window riêng, có custom system prompt, tool access và independent permissions; built-in subagents gồm Explore, Plan và general-purpose. Bài viết bám Claude Code documentation, tập trung parallel workflow, review gate, CI/CD và guardrails.

Claude Code subagents: giữ context sạch bằng Explore, Plan và custom workers Subagents docs nói subagents là specialized AI assistants cho task specific workflows và context management.

Mỗi subagent chạy trong context window riêng, có custom system prompt, tool access và independent permissions; built in subagents gồm Explore, Plan và general purpose.

Điều docs xác nhận Subagents docs nói subagents là specialized AI assistants cho task specific workflows và context management.

Mỗi subagent chạy trong context window riêng, có custom system prompt, tool access và independent permissions; built in subagents gồm Explore, Plan và general purpose.

Điểm cần giữ là mỗi cơ chế phục vụ một loại parallelism khác nhau.

Subagents chạy trong một session và trả summary về caller.

Agent view quản lý nhiều background sessions.

Agent teams cho nhiều Claude Code instances phối hợp với shared task list nhưng còn experimental.

CI/CD chạy Claude trong workflow của GitHub hoặc GitLab, với review gate là PR/MR.

Nếu gom tất cả thành “multi agent” thì bài sẽ sai về mặt vận hành.

Khi nào nên dùng Dùng cơ chế này khi work có ranh giới rõ.

Research độc lập, review nhiều góc nhìn, investigation flaky tests, docs update, PR analysis và task chuẩn hóa là ứng viên tốt.

Không nên dùng parallel agents cho thay đổi tuần tự, same file edits, migration nhạy cảm hoặc task phụ thuộc chặt nhau.

Parallelism chỉ có lợi khi giảm waiting time mà không tăng merge/review cost quá nhiều.

Nếu task cần communication giữa workers, cân nhắc agent teams.

Nếu chỉ cần kết quả gọn từ một worker phụ, subagent thường rẻ hơn.

Nếu muốn dispatch nhiều việc độc lập rồi quay lại xem, agent view hợp hơn.

Nếu workflow gắn với issue/PR/MR và cần audit trail, GitHub Actions hoặc GitLab CI/CD hợp hơn.

Prompt mẫu Prompt này giúp tránh lỗi phổ biến: chạy nhiều agent chỉ vì feature có vẻ lớn.

Parallel work phải bắt đầu bằng dependency analysis, không bắt đầu bằng số lượng worker.

Runbook triển khai Bước một: phân loại task.

Research only thì cho subagent hoặc background session đọc và summarize.

Implementation nhỏ thì chạy một session với plan rõ.

Implementation nhiều mảng thì tách theo boundary: frontend, backend, tests, docs, migration preparation.