{"product_id":"chief-of-staff-agent-diều-phối-multi-agent-với-claude-sdk","title":"Chief of Staff Agent — Điều phối multi-agent với Claude SDK","description":"\n\u003cp\u003eTrong bài này, bạn sẽ xây dựng một \u003cstrong\u003eAI Chief of Staff\u003c\/strong\u003e cho startup 50 người vừa raise $10M Series A. Agent này điều phối nhiều subagents chuyên biệt, tổng hợp insights từ nhiều nguồn, và đưa ra executive summaries với actionable recommendations.\u003c\/p\u003e\n\n\u003cp\u003eQua quá trình xây dựng, bạn sẽ học \u003cstrong\u003e6 tính năng quan trọng\u003c\/strong\u003e của Claude Agent SDK.\u003c\/p\u003e\n\n\u003ch2\u003eScenario\u003c\/h2\u003e\n\n\u003cp\u003eCEO cần data-driven insights để cân bằng giữa tăng trưởng mạnh và bền vững tài chính. Chief of Staff agent sẽ:\u003c\/p\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCoordinate subagents\u003c\/strong\u003e chuyên biệt cho từng domain (finance, recruiting, strategy)\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAggregate insights\u003c\/strong\u003e từ nhiều nguồn dữ liệu\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eProvide executive summaries\u003c\/strong\u003e với recommendations cụ thể\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch2\u003eFeature 0: CLAUDE.md — Persistent Memory\u003c\/h2\u003e\n\n\u003cp\u003e\u003ccode\u003eCLAUDE.md\u003c\/code\u003e là file persistent memory cho agent. Khi có trong project directory, Claude tự động đọc và incorporate context này.\u003c\/p\u003e\n\n\u003ch3\u003eTại sao cần?\u003c\/h3\u003e\n\u003cp\u003eThay vì lặp lại project context, team preferences, hoặc standards trong mỗi interaction, define một lần trong CLAUDE.md. Đảm bảo \u003cstrong\u003econsistent behavior\u003c\/strong\u003e và giảm token usage.\u003c\/p\u003e\n\n\u003ch3\u003eCách dùng\u003c\/h3\u003e\n\u003cpre\u003e\u003ccode\u003e# chief_of_staff_agent\/CLAUDE.md\n\n## Company Context\n- TechStart: 50-person startup, Series A ($10M)\n- Monthly burn: $500K, Runway: 20 months\n- ARR: $2.4M, growing 15% MoM\n- Target: $30M Series B in 18 months\n\n## Available Scripts\n- scripts\/hiring_impact.py — Model hiring scenarios\n- scripts\/financial_forecast.py — ARR projections\n- scripts\/talent_scorer.py — Score candidates\n- scripts\/decision_matrix.py — Weighted decisions\u003c\/code\u003e\u003c\/pre\u003e\n\n\u003cpre\u003e\u003ccode\u003eoptions = ClaudeAgentOptions(\n    model=\"claude-sonnet-4-6\",\n    cwd=\"chief_of_staff_agent\"  # CLAUDE.md tự động được load\n)\u003c\/code\u003e\u003c\/pre\u003e\n\n\u003ch3\u003eData source preferences\u003c\/h3\u003e\n\u003cp\u003eKhi cả CLAUDE.md và CSV files đều có, agent \u003cstrong\u003eưu tiên data chi tiết hơn\u003c\/strong\u003e (CSV). Đây là behavior đúng — agent tìm nguồn authoritative nhất. Để ép agent dùng high-level context, dùng prompt: \u003cem\u003e\"sử dụng high-level financial numbers from context\"\u003c\/em\u003e.\u003c\/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eKiến trúc đúng:\u003c\/strong\u003e CLAUDE.md chứa context + strategy + pointers. Detailed files là source systems agent query khi cần precision.\u003c\/p\u003e\n\n\u003ch2\u003eFeature 1: Bash Tool — Chạy Python Scripts\u003c\/h2\u003e\n\n\u003cp\u003eAgent có thể chạy Python scripts trực tiếp — xử lý data, chạy financial models, generate visualizations.\u003c\/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Agent tự gọi script khi cần\n# \"Tính impact nếu hire 5 engineers?\"\n# → Agent chạy: python scripts\/hiring_impact.py --count 5\n# → Nhận kết quả: burn tăng $100K\/tháng, runway giảm 4 tháng\u003c\/code\u003e\u003c\/pre\u003e\n\n\u003cp\u003e5 scripts mẫu: hiring_impact, talent_scorer, simple_calculation, financial_forecast, decision_matrix.\u003c\/p\u003e\n\n\u003ch2\u003eFeature 2: Output Styles — Audience-specific\u003c\/h2\u003e\n\n\u003cp\u003eOutput styles cho phép format khác nhau cho audiences khác nhau — \u003cstrong\u003ekhông cần tạo agents riêng\u003c\/strong\u003e.\u003c\/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# .claude\/output-styles\/executive.md\n---\nname: executive\ndescription: Concise executive summary format\n---\n- Lead with the decision\/action needed\n- Use bullet points, not paragraphs\n- Include key metrics with trends\n- End with 3 specific recommendations\u003c\/code\u003e\u003c\/pre\u003e\n\n\u003cpre\u003e\u003ccode\u003eoptions = ClaudeAgentOptions(\n    settings={\"output_style\": \"executive\"},\n    setting_sources=[\"project\"]  # BẮT BUỘC để load styles\n)\u003c\/code\u003e\u003c\/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuan trọng:\u003c\/strong\u003e Output styles modify system prompt, bỏ phần software engineering mặc định — cho bạn control cho use cases ngoài coding.\u003c\/p\u003e\n\n\u003ch2\u003eFeature 3: Plan Mode — Lên kế hoạch trước khi hành động\u003c\/h2\u003e\n\n\u003cp\u003ePlan mode chỉ tạo execution plan, \u003cstrong\u003ekhông thực thi\u003c\/strong\u003e. Lý tưởng cho high-stakes decisions.\u003c\/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eoptions = ClaudeAgentOptions(\n    permission_mode=\"plan\"  # Chỉ lập kế hoạch\n)\n\n# Workflow:\n# 1. Agent tạo plan → save to file\n# 2. Stakeholders review plan\n# 3. Approve → chạy lại KHÔNG có plan mode\n# 4. Agent thực thi theo plan đã duyệt\u003c\/code\u003e\u003c\/pre\u003e\n\n\u003ch3\u003ePlan → Review → Approve → Execute\u003c\/h3\u003e\n\u003cp\u003eCycle này perfect cho: restructure tổ chức, infrastructure changes, acquisition decisions.\u003c\/p\u003e\n\n\u003ch2\u003eFeature 4: Multi-Agent Coordination — Subagents\u003c\/h2\u003e\n\n\u003cp\u003eChief of Staff điều phối 3 subagents chuyên biệt:\u003c\/p\u003e\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n\u003cth\u003eSubagent\u003c\/th\u003e\n\u003cth\u003eVai trò\u003c\/th\u003e\n\u003cth\u003eTools\u003c\/th\u003e\n\u003c\/tr\u003e\n  \u003c\/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n\u003ctd\u003e\u003cstrong\u003eFinancial Analyst\u003c\/strong\u003e\u003c\/td\u003e\n\u003ctd\u003eBurn rate, runway, ARR projections\u003c\/td\u003e\n\u003ctd\u003eBash (financial_forecast.py)\u003c\/td\u003e\n\u003c\/tr\u003e\n    \u003ctr\u003e\n\u003ctd\u003e\u003cstrong\u003eRecruiter\u003c\/strong\u003e\u003c\/td\u003e\n\u003ctd\u003eScore candidates, hiring pipeline\u003c\/td\u003e\n\u003ctd\u003eBash (talent_scorer.py)\u003c\/td\u003e\n\u003c\/tr\u003e\n    \u003ctr\u003e\n\u003ctd\u003e\u003cstrong\u003eStrategy Advisor\u003c\/strong\u003e\u003c\/td\u003e\n\u003ctd\u003eMarket analysis, competitive intel\u003c\/td\u003e\n\u003ctd\u003eWebSearch\u003c\/td\u003e\n\u003c\/tr\u003e\n  \u003c\/tbody\u003e\n\u003c\/table\u003e\n\n\u003cp\u003eChief of Staff nhận kết quả từ tất cả subagents, tổng hợp, và đưa ra executive summary với recommendations.\u003c\/p\u003e\n\n\u003ch2\u003eFeature 5: Hooks — Governance và Safety\u003c\/h2\u003e\n\n\u003cp\u003eHooks cho phép bạn intercept và validate actions \u003cstrong\u003etrước khi agent thực thi\u003c\/strong\u003e.\u003c\/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# PreToolUse hook — kiểm tra trước khi agent chạy script\nasync def validate_bash_command(input_data):\n    command = input_data.get(\"command\", \"\")\n    if \"rm\" in command or \"sudo\" in command:\n        return {\"decision\": \"block\", \"reason\": \"Dangerous command\"}\n    return {}  # Allow\u003c\/code\u003e\u003c\/pre\u003e\n\n\u003cp\u003eHooks types: \u003ccode\u003eUserPromptSubmit\u003c\/code\u003e (validate input), \u003ccode\u003ePreToolUse\u003c\/code\u003e (gate tool calls), \u003ccode\u003eStop\u003c\/code\u003e (post-process).\u003c\/p\u003e\n\n\u003ch2\u003eTổng kết: Features Cheatsheet\u003c\/h2\u003e\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n\u003cth\u003eFeature\u003c\/th\u003e\n\u003cth\u003eMục đích\u003c\/th\u003e\n\u003cth\u003eKhi nào dùng\u003c\/th\u003e\n\u003c\/tr\u003e\n  \u003c\/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n\u003ctd\u003eCLAUDE.md\u003c\/td\u003e\n\u003ctd\u003ePersistent context\u003c\/td\u003e\n\u003ctd\u003eProject context, standards, pointers\u003c\/td\u003e\n\u003c\/tr\u003e\n    \u003ctr\u003e\n\u003ctd\u003eBash Tool\u003c\/td\u003e\n\u003ctd\u003eChạy scripts\u003c\/td\u003e\n\u003ctd\u003eData processing, calculations\u003c\/td\u003e\n\u003c\/tr\u003e\n    \u003ctr\u003e\n\u003ctd\u003eOutput Styles\u003c\/td\u003e\n\u003ctd\u003eFormat theo audience\u003c\/td\u003e\n\u003ctd\u003eExecutive vs technical audiences\u003c\/td\u003e\n\u003c\/tr\u003e\n    \u003ctr\u003e\n\u003ctd\u003ePlan Mode\u003c\/td\u003e\n\u003ctd\u003eLập kế hoạch không thực thi\u003c\/td\u003e\n\u003ctd\u003eHigh-stakes decisions\u003c\/td\u003e\n\u003c\/tr\u003e\n    \u003ctr\u003e\n\u003ctd\u003eSubagents\u003c\/td\u003e\n\u003ctd\u003eMulti-agent coordination\u003c\/td\u003e\n\u003ctd\u003eComplex multi-domain tasks\u003c\/td\u003e\n\u003c\/tr\u003e\n    \u003ctr\u003e\n\u003ctd\u003eHooks\u003c\/td\u003e\n\u003ctd\u003eGovernance, safety\u003c\/td\u003e\n\u003ctd\u003eValidate actions trước khi thực thi\u003c\/td\u003e\n\u003c\/tr\u003e\n  \u003c\/tbody\u003e\n\u003c\/table\u003e\n\n\u003cp\u003eBước tiếp theo: Đọc \u003ca href=\"\/en\/collections\/nang-cao\"\u003eObservability Agent\u003c\/a\u003e để học cách tích hợp MCP servers, hoặc \u003ca href=\"\/en\/collections\/nang-cao\"\u003eSRE Agent\u003c\/a\u003e để xây agent có khả năng sửa lỗi hệ thống.\u003c\/p\u003e\n\n\u003chr\u003e\n\u003ch3\u003eBài viết liên quan\u003c\/h3\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"\/en\/products\/best-practices-cho-vision-t%E1%BB%91i-%C6%B0u-hinh-%E1%BA%A3nh-g%E1%BB%ADi-claude\"\u003eBest Practices cho Vision — Tối ưu hình ảnh gửi Claude\u003c\/a\u003e\u003c\/li\u003e\n\u003cli\u003e\u003ca href=\"\/en\/products\/extended-thinking-tool-use-suy-lu%E1%BA%ADn-sau-k%E1%BA%BFt-h%E1%BB%A3p-cong-c%E1%BB%A5\"\u003eExtended Thinking + Tool Use — Suy luận sâu kết hợp công cụ\u003c\/a\u003e\u003c\/li\u003e\n\u003cli\u003e\u003ca href=\"\/en\/products\/xay-d%E1%BB%B1ng-llm-agent-t%E1%BB%AB-d%E1%BA%A7u-reference-implementation\"\u003eXây dựng LLM Agent từ đầu — Reference Implementation\u003c\/a\u003e\u003c\/li\u003e\n\u003cli\u003e\u003ca href=\"\/en\/products\/claude-code-vs-github-copilot-vs-cursor-dau-la-ide-ai-t%E1%BB%91t-nh%E1%BA%A5t\"\u003eClaude Code vs GitHub Copilot vs Cursor — Đâu là IDE AI tốt nhất?\u003c\/a\u003e\u003c\/li\u003e\n\u003cli\u003e\u003ca href=\"\/en\/products\/claude-cho-data-xay-d%E1%BB%B1ng-dashboard-t%E1%BB%AB-d%E1%BB%AF-li%E1%BB%87u\"\u003eClaude cho Data: Xây dựng Dashboard từ dữ liệu\u003c\/a\u003e\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"Minh Tuấn","offers":[{"title":"Default Title","offer_id":47721723429076,"sku":null,"price":0.0,"currency_code":"VND","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0821\/0264\/9044\/files\/chief-of-staff-agent-di_u-ph_i-multi-agent-v_i-claude-sdk.jpg?v=1774521033","url":"https:\/\/claude.vn\/en\/products\/chief-of-staff-agent-di%e1%bb%81u-ph%e1%bb%91i-multi-agent-v%e1%bb%9bi-claude-sdk","provider":"CLAUDE.VN","version":"1.0","type":"link"}