D7 · Developer Productivity & Operational Enablement (7%, ~4 câu)
Quay lại: MOC · Trước: D6 Stakeholder Communication & Lifecycle
Task statements
- Configure Claude tools and environments for teams (e.g., Claude Code)
- Improve developer workflows using AI-assisted tooling
- Support debugging and operational issue resolution
1. Cấu hình Claude Code cho team
Settings precedence (cao → thấp):
- Managed / enterprise policy (do IT phát hành, user không override được)
- Command-line arguments
- Local project:
.claude/settings.local.json(không commit) - Shared project:
.claude/settings.json(commit vào repo) - User:
~/.claude/settings.json
Quy tắc nào bắt buộc cho cả tổ chức (deny list, model được phép, tắt bypass permissions) thì đặt ở managed settings. Quy ước của team thì đặt ở project settings đã commit.
Memory (CLAUDE.md):
- Project:
./CLAUDE.mdhoặc./.claude/CLAUDE.md, commit vào repo để cả team dùng chung. - User:
~/.claude/CLAUDE.md, chỉ có trên máy cá nhân. ❌ Bẫy: quy ước team nằm ở file cá nhân của tech lead thì teammate không nhận được. - Có thể
@importfile khác./memoryđể xem và sửa.
Permissions: allow / ask / deny theo tool và pattern; deny ưu tiên cao nhất. Có các permission mode (default, acceptEdits, plan…).
MCP trong Claude Code: scope local / project (.mcp.json commit vào repo) / user. /mcp để xem trạng thái và xác thực.
Mở rộng:
| Cơ chế | Dùng cho |
|---|---|
| CLAUDE.md | Context luôn được nạp (quy ước, lệnh build/test) |
Slash commands / Skills (.claude/skills/…/SKILL.md) | Quy trình nạp theo nhu cầu |
Subagents (.claude/agents/) | Tác vụ cần context riêng, tool riêng |
| Hooks (PreToolUse, PostToolUse, …) | Thực thi tất định: chặn lệnh nguy hiểm, auto-format, lint. Hook PreToolUse có thể block |
| Plugins | Đóng gói và phân phối các thứ trên cho nhiều team |
Rule: thứ gì phải luôn xảy ra thì dùng hook (tất định). Thứ gì là hướng dẫn thì dùng CLAUDE.md hoặc Skill (model có thể quên).
2. Workflow AI-assisted
- Explore → Plan → Code → Commit. Dùng plan mode cho thay đổi lớn.
- TDD với Claude: viết test trước, cho Claude làm đến khi pass.
- Headless / CI:
claude -pvà GitHub Actions cho review PR, fix lint, triage issue. Thay đổi quan trọng vẫn giữ human approval (review PR). - Chạy song song nhiều phiên với git worktree.
- Đo hiệu quả bằng chỉ số gắn với outcome (lead time, tỷ lệ lỗi). ❌ Đếm số prompt hoặc số dòng code không đo được hiệu quả.
3. Debugging & vận hành
- Claude làm sai thì kiểm tra context đã nạp gì trước: CLAUDE.md nào, settings nào, MCP nào (dùng
/memory,/mcp,/status,/doctor,/context). - MCP server lỗi: xem trạng thái trong
/mcp(ví dụ failed hoặc cần authenticate), kiểm tra lệnh khởi chạy, biến môi trường, token OAuth. (cloudexam nói có “3 trạng thái lỗi MCP”, hãy kiểm tra lại docs Claude Code.) - Cô lập vấn đề: tắt bớt MCP, hook và plugin để tìm nguyên nhân.
- Biết lỗi nào API tự retry (429 rate limit, 529 overloaded, 5xx có backoff) và lỗi nào không (400 invalid request, 401/403).
Bẫy hay gặp
- ❌ Đặt quy ước team trong
~/.claude/CLAUDE.md. - ❌ Dùng Skill hoặc prompt cho quy tắc cần tất định (phải dùng hook hoặc permission deny).
- ❌ Cho CI chạy với
--dangerously-skip-permissionstrên môi trường có secret thật. - ❌ Đặt policy bắt buộc ở user settings (user có thể sửa).
Tự kiểm tra
- Thuộc thứ tự precedence của settings.
- Biết đặt
.mcp.json,CLAUDE.mdvàsettings.jsonở đâu để cả team dùng chung. - Phân biệt được hook, Skill, subagent và CLAUDE.md.
Đọc thêm
- Claude Code settings
- Memory (CLAUDE.md)
- Hooks
- MCP in Claude Code
- Claude Code best practices
- Skilljar: Team Enablement & Operational Productivity, Claude Code in Action