Anthropic giới thiệu mô hình lập trình đỉnh nhất thế giới Claude Sonnet 4.5

Trong thế giới AI đang thay đổi từng ngày, các mô hình ngôn ngữ lớn (LLM — Large Language Models) không chỉ dừng lại ở khả năng hiểu – sinh văn bản, mà đang tiến sang khả năng tương tác thực tế, thực thi công cụ, duy trì trạng thái lâu, và hỗ trợ tác vụ đa bước. Claude của Anthropic là một trong những cái tên nổi bật nhất trong cuộc đua này — và phiên bản mới nhất Sonnet 4.5 được định vị như một bước nhảy quan trọng.

“Claude Sonnet 4.5 is the best coding model in the world. It’s the strongest model for building complex agents. It’s the best model at using computers.”Anthropic

1. Giới thiệu

Trong vài năm gần đây, các mô hình như GPT (OpenAI), Gemini (Google / DeepMind), Claude (Anthropic) đã trở thành xương sống của nhiều ứng dụng AI trong sản xuất, công việc hàng ngày và nghiên cứu. Nhưng mỗi dòng mô hình đều chọn hướng “cân bằng” giữa sức mạnh và an toàn, giữa khả năng sáng tạo và kiểm soát.

Claude, từ khi xuất hiện, đã xác định con đường của mình: ưu tiên an toàn, khả năng tương tác công cụ (tool use), kiểm soát nội dung xấu. Đặc biệt, dòng Sonnet của Claude được dùng như phiên bản “cân bằng” giữa các mô hình nhẹ hơn và các mô hình cực mạnh (Opus).

Vào ngày 29 tháng 9 năm 2025, Anthropic chính thức ra mắt Claude Sonnet 4.5, phiên bản được quảng bá là mạnh nhất trong dòng Sonnet, và là mô hình kết hợp tốt nhất giữa cấu trúc mã, khả năng dùng máy tính và agent phức tạp.

Thông báo chính thức khẳng định Sonnet 4.5 không chỉ là nâng cấp nhỏ mà là bước tiến lớn: nó cải thiện đáng kể khả năng lập trình, tương tác công cụ, reasoning & toán học, đồng thời giữ chi phí sử dụng không đổi với Sonnet 4 trước đó.

2. Những điểm nổi bật & cải tiến từ thông báo chính thức

2.1 “Most aligned frontier model” — Mô hình tiên phong có alignment cao nhất

Anthropic mô tả Sonnet 4.5 là mô hình hiện đại có alignment tốt nhất mà họ từng phát hành. Họ cho biết rằng so với các phiên bản Claude trước đây, Sonnet 4.5 đã giảm đáng kể các hành vi không mong muốn như:

  • Sycophancy (lấy lòng người dùng quá mức)
  • Deception (lừa dối hoặc đưa thông tin sai)
  • Power-seeking (tự nâng quyền lực)
  • Khuyến khích ảo tưởng hoặc suy nghĩ sai lệch (encouraging delusional thinking)

Ngoài ra, để đối phó với rủi ro khi mô hình tương tác với công cụ (agent, prompt injection), họ đã có những bước tiến cải thiện trong bảo vệ chống prompt injection — một trong những lỗ hổng nghiêm trọng nhất khi dùng mô hình kết hợp công cụ.

Sonnet 4.5 được phát hành dưới AI Safety Level 3 (ASL-3), theo khung bảo vệ của Anthropic, với các bộ lọc (classifiers) để phát hiện các input/output có nguy cơ cao — đặc biệt liên quan đến vũ khí hóa học, sinh học, hạt nhân (CBRN).

Họ cũng nói rõ: các bộ lọc đôi khi sẽ “cảnh báo nhầm” (false positives), nhưng Anthropic đã cải thiện để giảm tỷ lệ báo nhầm so với trước — kể từ phiên bản Opus 4, tỷ lệ nhầm được giảm mạnh.

Việc đưa thông tin này vào blog (với giải thích dễ hiểu) sẽ giúp độc giả thấy rằng Sonnet 4.5 không đơn thuần là “thêm mạnh hơn”, mà cũng là “thêm an toàn”.

2.2 Nâng cấp công cụ & trải nghiệm người dùng

Một loạt tính năng mới và cải tiến trải nghiệm được Anthropic công bố:

  • Checkpoints trong Claude Code: Bạn có thể lưu tiến độ và “quay lui” về trạng thái trước đó nếu kết quả không như ý.
  • Giao diện terminal mới & extension VS Code gốc: để người dùng phát triển dễ dùng hơn trong môi trường quen thuộc.
  • Context editing (chỉnh ngữ cảnh) & memory tool trong API: giúp agent chạy dài hơi, duy trì bối cảnh xuất hiện trong prompt, xử lý phức tạp hơn.
  • Trong ứng dụng Claude (trên web/app), tích hợp thực thi mã (code execution)tạo file (spreadsheet, slide, document) ngay trong cuộc hội thoại.
  • Claude for Chrome extension (cho người dùng Max) — giúp Claude tương tác trực tiếp qua trình duyệt, lấp đầy form, điều hướng web, v.v.
  • Claude Agent SDK: Anthropic mở nền tảng cho các nhà phát triển xây dựng agent dựa trên cơ sở mà Claude dùng. SDK này chứa các thành phần họ đã phát triển cho Claude Code: quản lý memory, quyền kiểm soát, phối hợp sub-agent, v.v.
  • Research preview “Imagine with Claude”: một chế độ thử nghiệm cho phép Claude tạo phần mềm “on the fly”, không dùng mã viết sẵn, phản ứng tương tác theo yêu cầu của người dùng — được mở cho người dùng Max trong 5 ngày.

Những điểm này là “chất” để bạn thêm vào blog khiến nó hấp dẫn và mang tính cập nhật kỹ thuật cao.

2.3 Hiệu năng & benchmark đáng chú ý

Anthropic cung cấp các con số benchmark để thể hiện bước nhảy lớn của Sonnet 4.5:

  • Trên SWE-bench Verified (benchmark chuyên về khả năng lập trình thực tế), Sonnet 4.5 được cho là state-of-the-art.
  • Họ dùng phép thử: 77,2 %, tính trung bình 10 lần thử nghiệm, không dùng thêm compute khi test, và budget “thinking” 200K tokens.
  • Với cấu hình 1M context, có thể đạt 82,0 %.
  • Trên OSWorld (benchmark thử AI sử dụng máy tính thực: tương tác máy tính, trang web, file, lệnh), Sonnet 4.5 đạt 61,4 %, vượt Sonnet 4 trước đó (42,2 %).
  • Trong các lĩnh vực chuyên môn như tài chính, y tế, luật, STEM, Sonnet 4.5 thể hiện kiến thức và reasoning tốt hơn so với các mô hình cũ (bao gồm Opus 4.1).
  • Anthropic cũng nói rằng người dùng đã thấy mô hình giữ “focus” trong hơn 30 giờ khi thực hiện tác vụ phức tạp đa bước.

Khi bạn đưa vào blog, bạn nên giải thích những con số này (ví dụ: SWE-bench là gì, OSWorld là gì), để độc giả không chuyên cũng hiểu giá trị của việc tăng từ 42 % lên 61 %, hay “giữ 30 giờ” là gì trong bối cảnh AI.

2.5 Ưu điểm về chi phí & khả năng chuyển đổi

Một điểm rất hấp dẫn mà Anthropic nhấn mạnh: giá sử dụng Sonnet 4.5 giữ nguyên như Sonnet 4 — không tăng phí, vẫn là $3 / $15 per million tokens (theo gói)

Họ cũng nhấn rằng Sonnet 4.5 là bản “drop-in replacement” cho Sonnet 4 — tức là nếu bạn đang dùng Sonnet 4 qua API hay ứng dụng Claude, bạn có thể chuyển sang Sonnet 4.5 mà không cần thay đổi nhiều.

Điều này làm tăng sức hấp dẫn của việc nâng cấp từ các phiên bản cũ lên Sonnet 4.5 — vì bạn được lợi nhiều hơn mà không phải trả thêm.

2.6 Thông tin kỹ thuật & lưu ý từ hệ thống (system card)

Trong thông báo, Anthropic cũng nhắc đến system card đi kèm Sonnet 4.5 — nơi họ công bố chi tiết hơn về các đánh giá an toàn, mitigations, phương pháp thử nghiệm, các chỉ số misaligned behaviors, cách họ đo lường prompt injection, v.v.

Ví dụ, trong system card có:

  • Biểu đồ “misaligned behavior scores” (hành vi lệch chuẩn) — càng thấp càng tốt — được đo qua hệ thống auditor tự động.
  • Phương pháp thử nghiệm và footnotes cho các benchmark: cách họ test SWE-bench, OSWorld, Terminal-Bench, τ2-bench, AIME, MMMLU, Finance Agent.
  • Ghi chú rằng các khách hàng trong ngành an ninh mạng, nghiên cứu sinh học, v.v. có thể được vào allowlist nếu cần vượt hạn chế CBRN.

3. Những cải tiến chính trong phiên bản 4.5

3.1 Hiệu năng lập trình & agent

Một trong những điểm mạnh lớn mà Sonnet 4.5 hướng tới là năng lực lập trình thực tế. Trên benchmark SWE-bench Verified, nó đạt ~ 77,2 % (khi test với scaffold, không dùng thêm compute), và ở cấu hình 1M context có thể lên đến ~ 82,0 %. Trong các thử nghiệm nội bộ, nó có thể giữ trạng thái làm việc liên tục hơn 30 giờ cho các tác vụ phức tạp.

Khi so sánh với Sonnet 4 trước đó, Sonnet 4.5 đạt 61,4 % trên benchmark OSWorld (AI thực thi máy tính thực tế), trong khi Sonnet 4 chỉ có ~ 42,2 %. Đây là bước nhảy lớn trong khả năng AI “dùng máy tính như người dùng thật”.

Ngoài ra, Sonnet 4.5 được thiết kế để thực thi nhiều lệnh song song (“parallel tool execution”) — ví dụ chạy nhiều lệnh bash trong một ngữ cảnh — giúp tận dụng tối đa “actions per context window” (số hành động trên khung ngữ cảnh) hiệu quả hơn.

3.4 Trải nghiệm người dùng & công cụ hỗ trợ

Sonnet 4.5 không chỉ mạnh mà còn dễ dùng:

  • Checkpoints trong Claude Code: cho phép người dùng lưu trạng thái, quay trở lại nếu cần.
  • Giao diện terminal mới, extension VS Code tích hợp gốc — giúp developer làm việc trong môi trường quen thuộc.
  • Context editing (chỉnh ngữ cảnh) và memory tool trong API: giúp agent theo dõi ngữ cảnh, nhớ các bước trước và hoạt động trong tác vụ dài hơn.
  • Trong ứng dụng Claude (app/web): hỗ trợ thực thi mãtạo file (spreadsheet, slide, document) ngay trong cuộc hội thoại — không cần chuyển sang công cụ ngoài.
  • Claude for Chrome: tiện ích mở rộng cho người dùng Max — giúp Claude tương tác trực tiếp với trang web: điều hướng, điền form, xử lý các tương tác web.
  • Claude Agent SDK: Anthropic mở mã để người dùng / developer xây agent dựa trên nền tảng mà Claude sử dụng — từ memory management đến phối hợp sub-agent, quyền kiểm soát, v.v.
  • Imagine with Claude: bản thử nghiệm (research preview) cho phép Claude “sáng tạo phần mềm on the fly” — nghĩa là không có phần mã viết sẵn, mà mô hình tự sinh & điều chỉnh theo yêu cầu người dùng. Được cung cấp cho người dùng Max trong 5 ngày.
3.3 An toàn và alignment

Sonnet 4.5 không chỉ mạnh mà còn chú trọng an toàn:

  • Áp dụng các bộ lọc (classifiers) để phát hiện các input/output nguy hiểm, đặc biệt trong các lĩnh vực CBRN — nhằm hạn chế khả năng sử dụng mô hình cho vũ khí hóa học, sinh học, hạt nhân.
  • Các bộ lọc này đôi khi “cảnh báo nhầm” (false positives), nhưng Anthropic đã cải tiến để giảm tỷ lệ này: so với trước, giảm 10× từ bản gốc, và giảm 2× so với Opus 4.
  • Việc phát hành ở mức AI Safety Level 3 (ASL-3) cho thấy Anthropic đặt giới hạn truy cập và bảo vệ bổ sung theo khả năng mô hình.
  • Biểu đồ “misaligned behavior scores” (điểm hành vi lệch chuẩn) được công bố — thể hiện mức độ giảm các hành vi như deception, sycophancy, power-seeking, khuyến khích ảo tưởng.
  • Bảo vệ chống prompt injection được cải thiện đáng kể, đặc biệt quan trọng khi mô hình dùng công cụ/agent.

Những yếu tố này rất quan trọng để người dùng tin tưởng dùng Sonnet 4.5 trong môi trường sản xuất, doanh nghiệp, ứng dụng thực tế.

3.4 Chi phí & chuyển đổi dễ dàng

Một điểm hấp dẫn là giá vẫn giữ như Sonnet 4: không tăng phí, vẫn là $3/$15 per million tokens (tùy gói)

Anthropic cho biết Sonnet 4.5 là drop-in replacement — tức nếu bạn đang dùng Sonnet 4 qua API hoặc ứng dụng, bạn có thể chuyển sang Sonnet 4.5 mà không cần thay đổi nhiều code hoặc cấu hình.

Đây là chi tiết quan trọng để độc giả của blog thấy rằng “nâng cấp” không đồng nghĩa “tăng chi phí lớn”.

4. Ứng dụng thực tiễn & tiềm năng nổi bật

Với những cải tiến kể trên, Claude Sonnet 4.5 có thể được ứng dụng mạnh trong nhiều lĩnh vực — phần này bạn có thể minh họa thêm bằng ví dụ thực tế trong blog của bạn.

4.1 Lập trình & phát triển phần mềm

  • Tạo mã (code generation) từ module nhỏ đến hệ thống lớn
  • Tự động sửa lỗi, refactor code, test, deploy
  • Phối hợp agent để quản lý dự án lập trình — chia nhỏ tác vụ, kiểm soát tiến độ
  • Hỗ trợ developer trong IDE (nhờ extension VS Code)

Ví dụ từ Anthropic: Sonnet 4.5 có thể hiểu mẫu mã code của một codebase lớn, thực hiện debug và kiến trúc theo ngữ cảnh cụ thể của dự án.

4.2 Ứng dụng doanh nghiệp & phân tích

  • Tự động hóa quy trình nội bộ: trích xuất, tổng hợp báo cáo, phân tích dữ liệu
  • Hỗ trợ phân tích tài chính, mô hình rủi ro, dự báo
  • Trong lĩnh vực pháp lý: phân tích hồ sơ kiện tụng, tổng hợp bản ghi, soạn bản nháp luật, hỗ trợ CoCounsel (như trích dẫn trong bài)
  • Trong an ninh mạng: red teaming, phát hiện lỗ hổng, tạo kịch bản tấn công (Anthropic trích dẫn việc Sonnet 4.5 được dùng cho các công ty an ninh mạng để giảm “vulnerability intake time” 44 % và tăng độ chính xác 25 %)

4.3 Trợ lý ảo – công việc văn phòng

  • Trong ứng dụng Claude: tạo slide, bảng tính, file văn bản trực tiếp từ cuộc hội thoại
  • Hỗ trợ xử lý email, lập kế hoạch, tổng hợp nội dung, viết báo cáo
  • Tương tác với nhiều hệ thống qua API, làm các tác vụ đa bước

4.4 Agent thông minh & tác vụ liên tục

Nhờ khả năng duy trì ngữ cảnh, nhớ lâu và tương tác công cụ, Sonnet 4.5 rất phù hợp để xây agent đa bước, làm việc liên tục qua nhiều giờ:

  • Quản lý dự án (lập kế hoạch → giám sát → báo cáo)
  • Agent giám sát, tự động hóa pipeline (CI/CD, triển khai sản phẩm)
  • Agent tương tác đa hệ thống (hệ thống CRM, ERP, API bên ngoài)
  • Agent tự điều chỉnh dựa trên phản hồi mới

Anthropic nhắc rằng Sonnet 4.5 có thể “giữ 30+ giờ tự chủ trong mã” — tức là trong tác vụ lập trình liên tục, mô hình vẫn giữ mạch lạc và không “rơi rụng”.

5. So sánh Sonnet 4.5 với các mô hình khác & ưu nhược điểm

Phần này giúp độc giả định vị Sonnet 4.5 trong “bản đồ AI” hiện tại.

5.1 So với Claude phiên bản trước (Sonnet 4, Opus 4)

Ưu điểm của 4.5 so với Sonnet 4 / Opus 4:

  • Nâng cao khả năng sử dụng công cụ & tương tác thực tế (OSWorld từ ~42,2 % lên ~61,4 %)
  • Tăng độ ổn định / duy trì trạng thái lâu hơn (“30+ giờ”)
  • Checkpoints, context editing, memory tool — các tính năng mà Sonnet 4 không có
  • Giá giữ nguyên so với Sonnet 4
  • Kích hoạt SDK agent, mở đường cho người dùng xây agent tùy biến
  • Cải thiện an toàn và alignment

Hạn chế so với Opus / mô hình cao cấp:

  • Có thể Opus 4 vẫn có lợi thế trong một số bài toán reasoning cực lớn
  • Sonnet 4.5 là phiên bản “cân bằng” — nếu bạn cần năng lực cực hạn, Opus có thể vẫn vượt trội
  • Dù giảm lỗi, Sonnet 4.5 vẫn có thể có sai sót trong môi trường thực, đặc biệt trong các domain ngoài dữ liệu huấn luyện

5.2 So với GPT-4 / GPT-5 / Gemini / các LLM khác

Lợi thế của Sonnet 4.5:

  • Khả năng dùng máy tính & thực thi công cụ nội tại — điểm mà GPT truyền thống cần mô hình kết hợp môi trường để làm
  • Agent lâu dài, giữ trạng thái dài, xử lý tác vụ đa bước
  • Tích hợp tính năng code execution, file creation ngay trong mô hình
  • Chi phí “không tăng khi nâng cấp” — tạo động lực để chuyển
  • An toàn & alignment là một trong các ưu tiên thiết kế

Thách thức so với GPT / Gemini:

  • Ecosystem plugin / cộng đồng hỗ trợ GPT / Gemini lớn hơn — nhiều tài nguyên, thư viện, ứng dụng kèm
  • GPT / Gemini có thể mạnh hơn về “ngôn ngữ tự nhiên / creative writing” trong nhiều tình huống
  • Tốc độ inference, độ trễ, khả năng mở rộng thực tế có thể là điểm yếu nếu triển khai không tốt

5.3 Ưu điểm & hạn chế tổng quan

Ưu điểm:

  • Kết hợp tốt giữa sức mạnh và khả năng dùng trong thực tế
  • Được cải tiến nhiều tính năng hữu ích (checkpoints, memory, chỉnh ngữ cảnh)
  • An toàn hơn — giảm nhiều loại hành vi không mong muốn
  • Giá ổn định, chuyển đổi dễ
  • Được phản hồi tích cực từ người dùng thật sự

Hạn chế & rủi ro:

  • Không hoàn hảo — vẫn có thể “bịa”, sai logic, đặc biệt trong domain mới
  • Khi agent liên tục tự hành động, nếu prompt hoặc giám sát không chặt có thể gây lỗi nghiêm trọng
  • Việc triển khai thực tế (cơ sở hạ tầng, độ ổn định, tài nguyên) là thách thức lớn
  • Mô hình mới nhanh chóng — Sonnet 4.5 có thể bị vượt nếu Anthropic hoặc đối thủ không tiếp tục đổi mới

6. Kết luận & lời khuyên cho người dùng

Claude Sonnet 4.5 là một bước tiến ấn tượng trong dòng Claude: nó mang lại năng lực cao hơn trong lập trình, tương tác công cụ, agent lâu dài và các ứng dụng thực tế. Nếu được sử dụng đúng cách, nó có thể là trợ thủ đắc lực cho lập trình viên, nhà phân tích, đội phát triển sản phẩm, và nhiều lĩnh vực khác.

Tuy nhiên, không có mô hình AI nào hoàn hảo. Người dùng cần hiểu đúng điểm mạnh, điểm yếu, luôn giám sát kết quả, thiết lập kiểm soát và luôn cập nhật khi có phiên bản mới.

Nếu bạn là nhà phát triển, nhà phân tích hay người chủ doanh nghiệp, Claude Sonnet 4.5 có thể là lựa chọn đáng cân nhắc cho các nhiệm vụ có tính logic cao, cần tương tác công cụ, hoặc muốn xây agent thông minh.

Getting Started with Claude Code Spec Workflow: A Practical Guide to Spec-Driven Development

In modern software development, one of the biggest challenges is keeping requirements, design, and implementation aligned. Too often, teams jump straight into coding without a solid specification, leading to rework, misunderstandings, and bugs. That’s where spec-driven development comes in — an approach that places clear specifications at the heart of the workflow.

1. What is Spec-Driven Development?

Before diving into the tool, let’s clarify spec-driven development. This is a software development approach where specifications play a central role. They are created clearly before coding begins, and every step afterward (design, task breakdown, implementation, testing) follows those specifications.

1.1 Core Principles

  • Clear specifications before coding: Requirements, acceptance criteria, architecture, and tasks must be defined before writing any logic.

  • Traceability: Each piece of code and each task can be traced back to the original spec — from requirements → design → tasks → code → testing.

  • Role clarity: Business analysts, product managers, architects, and developers contribute to specs and follow them.

  • Automation & tooling: To reduce errors and repetitive work, tools can generate tasks, skeleton code, and tests directly from specs.

  • Spec-driven testing: Verification/validation is built around acceptance criteria defined in the specs.

   Advantages:

  • Reduced risk of misinterpreting requirements

  • Easier maintenance and scalability due to clear documentation

  • Transparency between business and dev teams

  • Supports automation

   Challenges:

  • Requires discipline and upfront time to write good specs

  • Demands strong design/translation skills

  • Can feel rigid if specs are frequently changing


2. Introducing Claude Code Spec Workflow

This toolkit, built on Claude Code (Anthropic), automates workflows for spec-driven development — both feature development and bugfix processes. See GitHub: claude-code-spec-workflow.

2.1 Goals & Vision

  • Provide structured workflows for both new features and bug fixes

  • Create scaffolding with slash commands, agents, templates, and dashboards

  • Optimize context sharing to reduce token costs

  • Zero-configuration support for multiple languages (Node.js, Python, Java, etc.)

  • Real-time dashboards to monitor specs, tasks, and bugfixes

2.2 Key Features

Feature Description
Zero Configuration Detects project type (Node.js, Python, Java, etc.) automatically.
Interactive Setup User-friendly CLI prompts and error handling.
Smart File Management Generates .claude/ folder with subfolders for commands, specs, bugs, templates, agents.
Feature Workflow /spec-create feature-name "Description" generates requirements → design → tasks → implementation steps.
Bugfix Workflow Commands like /bug-create, /bug-analyze, /bug-fix, /bug-verify.
Specialized Agents AI agents for executing, validating, and analyzing specs/tasks.
Context Optimization Shares context smartly across steps, reducing token usage by 60-80%.
Real-Time Dashboard Web interface to track progress with WebSockets.
Dashboard Sharing Securely share dashboards via HTTPS tunnel with optional password.
Steering Documents Project-wide guidance docs: product.md, tech.md, structure.md.
CLI Commands ~10 slash commands for spec/bug workflows, task execution, status checks.
Claude Integration Designed for Claude Code (Opus for specs, Sonnet for implementation).

Note: This version will see fewer updates, as the author is moving toward the MCP-based version.


3. Trying Claude Code Spec Workflow

3.1 Requirements

  • Node.js ≥ 16

  • Claude Code installed & configured

  • A project directory to initialize

3.2 Installation

  1. Install globally:

    npm install -g @pimzino/claude-code-spec-workflow

  2. Check version:

    claude-code-spec-workflow --version

  3. Run setup in your project:

    cd /path/to/project
    claude-code-spec-workflow

    → Creates .claude/ folder with subfolders for specs, bugs, commands, etc.
    setup

  4. (Optional) Generate steering docs:

    /spec-steering-setup

3.3 Workflows

   a. Feature Workflow

  • Create a spec:

    /spec-create feature-name “Description”

    → Generates requirements, design, tasks. Eg: /spec-create signup “Create a REST API for signup with JWT”
    spec excute

  • Execute tasks:

    /spec-execute <id> <feature-name>

    or individual auto-generated task commands. Eg: /spec-execute signup
    spec excute

  • Check status:

    /spec-status
    /spec-list

   b. Bug Workflow

  • Create bug:

    /bug-create issue-name “Description”
    Eg: /bug-create validate-password “Password must be 8 characters long and
    include lowercase letters, uppercase letters, numbers, and special characters”

    bug create

  • Analyze: /bug-analyze
    bug analyze

  • Fix: /bug-fix
    bug fix

  • Verify: /bug-verify

  • Status: /bug-status

3.4 Behavior (per docs)

  • /spec-create calls Claude to draft requirements, designs, and tasks.

  • With task agents enabled, code or skeleton implementations are auto-generated.

  • Optimized context caching saves tokens.

  • claude-spec-dashboard launches a real-time dashboard, optionally shareable via HTTPS.


4. Observations

Strengths

  • Enforces spec-driven discipline

  • Automates repetitive steps (specs, tasks, code skeletons)

  • Improves project traceability and transparency

  • Real-time dashboard for progress tracking

  • Token-efficient context handling

Considerations

  • Depends heavily on Claude’s quality and your prompts

  • Critical architecture/design still requires human review

  • Specs need careful versioning, especially in dynamic teams

  • This Claude Code version will be less updated than the MCP one

Claude Code Spec Workflow: Hướng Dẫn Thực Hành Spec-Driven Development

Claude Code Spec Workflow: Hướng Dẫn Thực Hành Spec-Driven Development

Giới Thiệu

Trong thế giới phát triển phần mềm hiện đại, việc kết hợp AI vào quy trình coding đang trở thành xu hướng không thể tránh khỏi. Tuy nhiên, phương pháp “vibe coding” – viết code dựa trên cảm hứng và prompt ngẫu nhiên – thường dẫn đến kết quả không nhất quán và thiếu cấu trúc. Claude Code Spec Workflow ra đời như một giải pháp để biến việc phát triển phần mềm với AI trở nên có hệ thống và chuyên nghiệp hơn.

1. Spec-Driven Development Là Gì?

Định Nghĩa

Spec-Driven Development (SDD) là một phương pháp phát triển phần mềm mà trong đó specification (đặc tả) trở thành trung tâm của toàn bộ quy trình engineering – từ planning và design đến implementation, testing và documentation. SDD nhấn mạnh việc viết specifications rõ ràng và có cấu trúc trước khi bắt đầu implementation.

Nguyên Lý Cốt Lõi

Thay vì “vibe coding” – phương pháp mô tả mục tiêu và nhận về một khối code có vẻ đúng nhưng thường không hoạt động chính xác, SDD đối xử với coding agents như những pair programmers nghiêm túc. Chúng xuất sắc trong pattern recognition nhưng vẫn cần hướng dẫn rõ ràng và không mơ hồ.

Quy Trình 4 Giai Đoạn

SDD hoạt động qua 4 giai đoạn với các checkpoint rõ ràng:

1. Specify (Đặc Tả): Tạo ra contract về cách code nên hoạt động, trở thành source of truth cho tools và AI agents.

2. Plan (Lập Kế Hoạch): AI agent phân tích spec và tạo ra kế hoạch chi tiết về architecture, constraints và cách tiếp cận.

3. Tasks (Nhiệm Vụ): Chia nhỏ spec và plan thành các công việc cụ thể, có thể review được, mỗi task giải quyết một phần cụ thể của puzzle.

4. Implement (Triển Khai): AI agent thực hiện từng task một cách có hệ thống, với developer review những thay đổi tập trung thay vì những code dump hàng nghìn dòng.

Ưu Điểm Của SDD

  • Giảm đoán mò: Spec rõ ràng giúp giảm thiểu sự bất ngờ và đảm bảo chất lượng code
  • Dễ thay đổi hướng: Chỉ cần update spec, regenerate plan và để AI agent xử lý phần còn lại
  • Phù hợp với dự án phức tạp: Đặc biệt hữu ích cho greenfield projects và feature work trong hệ thống hiện có

2. Claude Code Spec Workflow – Tổng Quan

Giới Thiệu Tool

Claude Code Spec Workflow là một toolkit tự động hóa được phát triển bởi Pimzino, cung cấp quy trình spec-driven development có cấu trúc cho Claude Code. Tool này transform các ý tưởng feature thành implementation hoàn chỉnh thông qua quy trình: Requirements → Design → Tasks → Implementation.

Các Tính Năng Chính

🎯 Quy Trình Phát Triển Có Cấu Trúc

  • Requirements Generation: Tạo user stories và acceptance criteria sử dụng định dạng EARS (WHEN/IF/THEN statements)
  • Design Creation: Tạo technical architecture và design với Mermaid diagrams để visualization
  • Task Breakdown: Chia design thành các atomic coding tasks tập trung vào test-driven development
  • Systematic Implementation: Thực hiện tasks một cách có hệ thống với validation dựa trên requirements

🛠 7 Slash Commands Chính

  • /spec-create <name> <description> – Tạo specification mới cho feature
  • /spec-requirements – Generate requirements document
  • /spec-design – Tạo design document
  • /spec-tasks – Generate implementation tasks
  • /spec-execute <task-number> – Execute specific tasks
  • /spec-status – Check status của specification hiện tại
  • /spec-list – List tất cả specifications

🏗 Cấu Trúc Project Tự Động

Sau khi setup, tool tự động tạo:

  • 📁 .claude/ directory: Chứa commands, templates, specs, và config files
  • 📝 7 slash commands: Để thực hiện complete workflow
  • 📋 Document templates: Đảm bảo formatting nhất quán
  • ⚙️ Configuration files: Cho workflow automation
  • 📖 CLAUDE.md: Với comprehensive workflow instructions

✨ Tính Năng Nâng Cao

  • Triple optimization commands: get-steering-context, get-spec-context, và get-template-context
  • Smart document handling: Bug documents sử dụng direct reading, templates sử dụng bulk loading
  • Session-based caching: Intelligent file change detection và cache invalidation
  • Real-time web dashboard: Monitor specs, tasks, và progress với live updates
  • Bug workflow system: Complete bug reporting và resolution tracking

3. Hướng Dẫn Cài Đặt và Sử Dụng

Yêu Cầu Hệ Thống

  • Node.js: 16.0.0 hoặc cao hơn
  • Claude Code: Đã cài đặt và configure
  • Bất kỳ project directory nào

Cài Đặt Claude Code (Prerequisite)

bash
# Install Claude Code
npm install -g @anthropic-ai/claude-code

# Verify installation
claude doctor

# Navigate to your project
cd your-awesome-project

# Start Claude Code (first time login required)
claude

Cài Đặt Claude Code Spec Workflow

Phương Pháp 1: Cài Đặt Nhanh (Khuyến Nghị)

bash
# Cài đặt trong current directory
npx @pimzino/claude-code-spec-workflow

# Cài đặt trong directory cụ thể  
npx @pimzino/claude-code-spec-workflow --project /path/to/project

# Force overwrite existing files
npx @pimzino/claude-code-spec-workflow --force

# Skip confirmation prompts
npx @pimzino/claude-code-spec-workflow --yes

# Test setup
npx @pimzino/claude-code-spec-workflow test

Phương Pháp 2: Global Installation

bash
# Install globally
npm install -g @pimzino/claude-code-spec-workflow

# Use anywhere
claude-spec-setup

Phương Pháp 3: Development Dependency

bash
# Install as dev dependency
npm install --save-dev @pimzino/claude-code-spec-workflow

# Run via package.json script
npx claude-spec-setup

Cấu Trúc Được Tạo Ra

your-project/
├── .claude/
│   ├── commands/
│   │   ├── spec-create.md
│   │   ├── spec-requirements.md  
│   │   ├── spec-design.md
│   │   ├── spec-tasks.md
│   │   ├── spec-execute.md
│   │   ├── spec-status.md
│   │   └── spec-list.md
│   ├── templates/
│   │   ├── requirements-template.md
│   │   ├── design-template.md
│   │   └── tasks-template.md
│   ├── specs/
│   │   └── (your specs will be created here)
│   └── spec-config.json
└── CLAUDE.md (created/updated)

4. Hướng Dẫn Sử Dụng Chi Tiết

Workflow Cơ Bản

Bước 1: Khởi Tạo Claude Code

bash
cd my-awesome-project
claude

Bước 2: Tạo Specification Mới

bash
# Trong Claude Code terminal
/spec-create user-dashboard "User profile management system"

Bước 3: Generate Requirements

bash
/spec-requirements

Output: User stories với EARS format (WHEN/IF/THEN statements) đảm bảo comprehensive requirement coverage.

Bước 4: Tạo Design Document

bash
/spec-design

Output: Technical architecture với Mermaid diagrams, plans components, interfaces, và data models.

Bước 5: Generate Implementation Tasks

bash
/spec-tasks

Output: Atomic coding tasks với focus vào test-driven development, references specific requirements.

Bước 6: Execute Tasks

bash
/spec-execute 1

Executes tasks systematically với validation against requirements, ensures quality và consistency.

Bước 7: Monitor Progress

bash
# Check current status
/spec-status

# List all specifications  
/spec-list

Web Dashboard (Tính Năng Nâng Cao)

bash
# Basic dashboard
npx -p @pimzino/claude-code-spec-workflow claude-spec-dashboard

# Dashboard with tunnel (share externally) 
npx -p @pimzino/claude-code-spec-workflow claude-spec-dashboard --tunnel

# Full tunnel configuration
npx -p @pimzino/claude-code-spec-workflow claude-spec-dashboard \
  --tunnel \
  --tunnel-password mySecret123 \
  --tunnel-provider cloudflare \
  --port 3000 \
  --open

5. Ví Dụ Thực Hành: Phát Triển Game Asteroids

Mô Tả Dự Án

Một developer đã sử dụng claude-code-spec-workflow để tạo một game 2D đơn giản where player controls spaceship để tránh falling asteroids. Score được tính dựa trên survival time.

Quy Trình Thực Hiện

bash
# 1. Tạo specification
/spec-create asteroids-game "A simple 2D action game where the player controls a spaceship to avoid falling asteroids. The score is based on survival time."

# 2. Generate 3 types of specs
- Requirements document (요구사항 정의서)
- Design document (설계서)  
- Task list (타스크 리스트)

# 3. Implementation using SDD methodology

Kết Quả

Developer đã thành công tạo ra một asteroids avoidance game hoàn chỉnh sử dụng:

  • LLM: Claude Sonnet 4
  • Frontend: HTML, CSS, JavaScript
  • Development Tools: Claude Code, claude-code-spec-workflow

Kỹ Thuật Sử Dụng

Trong video demonstration, developer đã sử dụng:

  • /spec-status để check workflow status
  • /spec-list để view tất cả specifications
  • /spec-create để tạo các specs với detailed content
  • Cuối cùng là gameplay video của completed game

6. Troubleshooting và Best Practices

Common Issues

❓ Command Not Found After NPX

bash
# Make sure you're using correct package name
npx @pimzino/claude-code-spec-workflow

❓ Setup Fails với Permission Errors

bash
# Try with different directory permissions
npx @pimzino/claude-code-spec-workflow --project ~/my-project

❓ Claude Code Not Detected

bash
# Install Claude Code first
npm install -g @anthropic-ai/claude-code

# Show verbose output
DEBUG=* npx @pimzino/claude-code-spec-workflow

# Check package version
npx @pimzino/claude-code-spec-workflow --version

Best Practices

1. Project Setup

bash
# Setup multiple projects efficiently
for dir in project1 project2 project3; do
  npx @pimzino/claude-code-spec-workflow --project $dir --yes
done

2. Testing Setup

bash
# Test setup trong temporary directory
npx @pimzino/claude-code-spec-workflow test

3. Workflow Efficiency

  • Auto-detects project type: Node.js, Python, Java, etc.
  • Beautiful CLI: Với progress indicators
  • Validation: Claude Code installation check
  • Safety: Preserves existing CLAUDE.md content

7. So Sánh Với Các Công Cụ Khác

Claude Code Spec Workflow vs GitHub Spec-Kit

  • GitHub Spec-Kit: Toolkit chính thức từ GitHub cho SDD với support cho multiple AI agents (GitHub Copilot, Claude Code, Gemini CLI)
  • Claude Code Spec Workflow: Chuyên biệt cho Claude Code với workflow tự động hóa và dashboard

Ưu Điểm Của Claude Code Spec Workflow

  • Dễ cài đặt: One-command setup
  • Tự động hóa cao: 7 slash commands có sẵn
  • Dashboard tích hợp: Real-time monitoring
  • TypeScript implementation: Comprehensive error handling

8. Tương Lai và Phát Triển

Xu Hướng SDD

Spec-driven development đang trở thành popular trong developer community như một cách để build software với structure hơn và ít “vibes” hơn. Nó đặc biệt phù hợp với greenfield projects và mid-to-large-sized features.

Limitations

  • UI-heavy work: Non-visual spec không hữu ích cho UI work
  • Small features: Tạo full-blown spec có thể overkill cho small features hoặc bug fixes
  • Overengineering risk: Có thể dẫn đến solutions phức tạp hơn cần thiết

Future of SDD

“Specs are the new code” – Sean Grove từ OpenAI team cho rằng 80-90% công việc của programmers là structured communication, và specs là cách tốt nhất để communicate về software functionality.

9. Kết Luận

Claude Code Spec Workflow đại diện cho bước tiến quan trọng trong việc kết hợp AI vào quy trình phát triển phần mềm một cách có hệ thống. Tool này không chỉ đơn thuần là automation mà còn là methodology giúp developers:

Lợi Ích Chính

  1. Cấu trúc hóa quy trình: Từ vibe coding thành systematic development
  2. Tăng chất lượng code: Thông qua spec-driven approach
  3. Cải thiện collaboration: Giữa developers và AI agents
  4. Giảm rủi ro dự án: Với clear specifications và validation

Khi Nào Nên Sử Dụng

  • Greenfield projects: Starting từ zero với clear vision
  • Feature development: Trong existing complex systems
  • Team collaboration: Cần consistent development approach
  • Quality-focused projects: Khi code quality là priority

Khuyến Nghị

Claude Code Spec Workflow là tool xuất sắc cho developers muốn áp dụng SDD methodology với Claude Code. Tuy nhiên, hãy nhớ rằng tool chỉ là means, methodology và mindset mới là điều quan trọng nhất.

Hãy bắt đầu với những dự án nhỏ, làm quen với workflow, và dần mở rộng sang những dự án phức tạp hơn. Spec-driven development không phải là silver bullet, nhưng chắc chắn là một powerful approach trong arsenal của modern developers.


Demo:

Sử dụng claude cli + claude-code-spec-workflow test tạo workflow cho chức năng  user-authentication

Kết quả :
Tạo ra code và spec cho chức năng  user-authentication

————————————————————————————————————————————————————————————————————————————–

Sử dụng claude cli + claude-code-spec-workflow test 1 game đơn giản bằng html

Kết quả :

 

Claude Code và Tương Lai Lập Trình Với AI Agent

Trong vòng một năm trở lại đây, cách chúng ta viết code đã thay đổi nhanh đến mức chóng mặt. Nếu như trước kia AI chỉ dừng ở mức autocomplete vài dòng trong IDE, thì nay các công cụ như Claude Code đã tiến hóa thành những “người đồng hành” thực sự: có thể đọc hiểu toàn bộ project, viết, sửa, refactor, và thậm chí xây dựng ứng dụng từ đầu đến cuối.

Bài viết này tổng hợp những ý chính từ buổi trò chuyện giữa Alex và Boris (Anthropic) về Claude Code, đồng thời chia sẻ thêm vài góc nhìn cá nhân.

Link video: https://www.youtube.com/watch?v=iF9iV4xponk

Claude Code là gì?

Để hiểu Claude Code, hãy bắt đầu từ Claude. Đây là mô hình ngôn ngữ (LLM) do Anthropic phát triển, nổi tiếng nhờ khả năng suy luận tốt, trả lời an toàn và viết code khá mạnh. Tuy nhiên, nếu chỉ có một mô hình ngôn ngữ thì vẫn còn thiếu nhiều thứ để làm việc trong môi trường lập trình thực tế.

Ví dụ: nếu bạn thả Claude “chay” vào một dự án, nó có thể viết code hoặc trả lời câu hỏi, nhưng sẽ gặp khó khăn khi:

  • Không biết trạng thái repo hiện tại.

  • Không có quyền chỉnh sửa file.

  • Không thể chạy test hoặc commit.

  • Không tích hợp được vào workflow của team.

Đây chính là khoảng trống mà Claude Code ra đời để lấp đầy.

Claude Code = “Agentic IDE”

Anthropic gọi Claude Code là agentic IDE (một môi trường phát triển dựa trên agent). Nó giống một IDE thông minh, nhưng có khả năng tự hành động chứ không chỉ gợi ý.

Cấu trúc Claude Code gồm nhiều thành phần:

  1. Harness – Lớp điều phối giữa mô hình, ngữ cảnh project, và người dùng.

    • Harness giống như “bộ não phụ” để nối Claude với codebase.

    • Nó đảm bảo Claude có cái nhìn đầy đủ về repo, không chỉ một file rời rạc.

  2. Tools & Permissions – Cơ chế kiểm soát.

    • AI có thể thực hiện hành động thực sự: chỉnh sửa file, chạy script, cài dependency, commit.

    • Nhưng mọi hành động đều trong phạm vi cho phép, tránh “AI phá repo”.

  3. MCP Servers (Model Context Protocol) – Hệ thống plugin/API.

    • Cho phép mở rộng Claude Code ra ngoài: kết nối tới database, API, CI/CD, issue tracker (GitHub, Jira…).

    • Đây là điểm giúp Claude Code không chỉ làm code “trên máy”, mà còn tham gia vào toàn bộ pipeline.

  4. Settings, Hooks & Slash Commands – Tùy biến workflow.

    • Dev có thể định nghĩa shortcut (ví dụ: /fix-tests, /deploy) hoặc viết hook để AI làm việc theo cách riêng.

    • Tính năng này khiến Claude Code hackable, khác biệt so với nhiều công cụ AI coding “đóng hộp”.

  5. CLAUDE.md – Tài liệu hướng dẫn dành riêng cho AI.

    • Bạn có thể tạo file này trong repo để mô tả project, convention, style guide.

    • Claude sẽ đọc và hiểu ngữ cảnh như một dev mới join team.


Điểm khác biệt với AI coding khác

So với GitHub Copilot hay Cursor, Claude Code không chỉ dừng ở gợi ý code trong editor, mà là:

  • Có trí nhớ dài: hiểu và thao tác trên codebase lớn.

  • Có quyền hành động: sửa file, chạy lệnh.

  • Có khả năng mở rộng: thông qua MCP và plugins.

  • Có thể hack/tùy biến: lập trình viên điều chỉnh workflow theo ý mình.

Sự tiến hóa: từ autocomplete đến agent

Trong vòng một năm qua, AI coding đã thay đổi nhanh đến mức khó tin. Điểm đáng chú ý là sự tiến hóa không chỉ đến từ bản thân mô hình (model), mà chủ yếu nằm ở cách chúng ta đóng gói và sử dụng nó trong workflow thực tế.

  • Trước đây – thời kỳ autocomplete
    AI chỉ đóng vai trò như một “bộ gợi ý thông minh” trong IDE. GitHub Copilot (ra mắt 2021) là ví dụ điển hình: nó dự đoán vài dòng code tiếp theo, giống như autocomplete trong Gmail, nhưng dành cho lập trình viên. Rất tiện, nhưng vẫn giới hạn trong phạm vi vài dòng code.

  • Hiện tại – AI như đồng nghiệp
    Với các công cụ mới như Claude Code hay Cursor, AI không chỉ gợi ý từng dòng, mà có thể:

    • Đọc và phân tích toàn bộ repo.

    • Sửa lỗi và refactor hàng loạt file.

    • Review Pull Request (PR) và đưa ra nhận xét.

    • Hiểu ngữ cảnh project (nhờ cơ chế long context window như Claude 3.5 Sonnet với 200k tokens).

    Điều này biến AI từ một “công cụ hỗ trợ viết code” thành một trợ lý phát triển phần mềm thực thụ.

  • Tương lai gần – AI hiểu ý định (intent)
    Anthropic mô tả tầm nhìn tiếp theo: AI sẽ không chỉ viết code theo prompt, mà còn quản lý mục tiêu của lập trình viên.
    Ví dụ: bạn nói “Xây API thanh toán với Stripe”, Claude Code sẽ:

    1. Thiết kế cấu trúc.

    2. Tạo endpoint.

    3. Viết test.

    4. Deploy và thông báo kết quả.

    Ở giai đoạn này, AI giống một “agent” thực sự – tự động hóa toàn bộ chu trình dựa trên ý định của con người, thay vì chỉ thao tác cục bộ trên từng file.


Điều gì thúc đẩy sự tiến hóa này?

Theo chia sẻ từ Boris Cherny (Anthropic), chính feedback thực chiến từ dev nội bộ đã dẫn dắt sản phẩm. Anthropic không xây Claude Code trong phòng lab, mà cho chính nhân viên sử dụng hàng ngày để làm việc thật. Model và công cụ đồng tiến hóa:

  • Dev phản hồi về điểm yếu (ví dụ AI refactor chưa sạch → cải tiến).

  • Model mạnh hơn lại mở ra use case mới (ví dụ context dài → đọc cả repo).

Đây là lý do tại sao Claude Code không chỉ “mạnh về lý thuyết”, mà còn thực sự hữu dụng trong quy trình phát triển phần mềm.


Hackability là gì và vì sao quan trọng?

Một trong những điểm khác biệt khiến Claude Code nổi bật so với nhiều công cụ AI coding khác chính là tính hackability – tức khả năng tùy biến, mở rộng, và “bẻ cong” công cụ theo cách mà lập trình viên mong muốn.

Vì sao hackability quan trọng?

Trong thế giới phần mềm, mỗi đội và mỗi dự án có workflow riêng:

  • Có team ưu tiên CI/CD tự động, để code merge là deploy ngay.

  • Có team lại yêu cầu review thủ công và check kỹ lưỡng.

  • Một số lập trình viên thích command-line tool, số khác muốn UI trực quan.

Nếu một công cụ AI bị “đóng khung” theo một quy trình cứng nhắc, nó sẽ không thể đáp ứng được sự đa dạng này. Do đó, tính hackable là yếu tố then chốt giúp AI coding trở thành công cụ thực sự linh hoạt, thay vì chỉ là demo đẹp.

Hackability trong Claude Code

Claude Code được thiết kế để cực kỳ hackable với nhiều cơ chế:

  • CLAUDE.md: file cấu hình cho phép mô tả project, hướng dẫn AI hiểu ngữ cảnh (giống như README nhưng dành riêng cho AI).

  • Configurable workflows: bạn có thể cấu hình lại workflow qua settings, hooks hoặc script tùy chỉnh.

  • MCP servers (Model Context Protocol): cơ chế mở rộng theo kiểu “plugin/API”, cho phép AI tương tác với tool, service hoặc dữ liệu riêng của bạn.

  • Slash commands & sub-agents: tạo lệnh chuyên biệt (ví dụ: /generate-tests, /lint*) hoặc định nghĩa agent con để xử lý tác vụ hẹp.

Ví dụ thực tế

  • Một công ty fintech có thể viết MCP server riêng để Claude trực tiếp đọc dữ liệu từ hệ thống nội bộ, thay vì copy-paste code.

  • Một startup game có thể tạo slash command /render để AI gọi engine dựng hình trong quá trình phát triển.

  • Team backend có thể thêm CLAUDE.md để AI luôn tuân thủ chuẩn code style và kiến trúc microservices của họ.

👉 Chính vì vậy, hackability quan trọng ở chỗ: nó giúp AI không chỉ phù hợp với lập trình nói chung, mà còn thích nghi với phong cách làm việc riêng của từng lập trình viên và từng đội ngũ.


Tương lai của lập trình với AI agent

Bức tranh được Alex và Boris vẽ ra khá rõ:

  • Ngắn hạn: dev vẫn viết code thủ công, nhưng AI sẽ gánh phần “text manipulation” (refactor, đổi tên biến, viết test, v.v.).

  • Trung hạn: AI sẽ review code, đề xuất thay đổi, và có thể merge PR.

  • Dài hạn: dev chỉ cần nói “Xây API thanh toán với Stripe”, AI sẽ tự thiết kế, viết, test, deploy. Lập trình viên sẽ dần trở thành người định hướng, review và tư duy giải pháp thay vì “người gõ từng dòng code”.


Suy nghĩ cá nhân

Thật sự thì khi nhìn vào những gì Claude Code (và các agent AI khác) đang làm được, mình có cảm giác việc viết code không còn khô khan và đã trở nên dễ dàng hơn rất nhiều. Trước đây, để tạo ra một ứng dụng, chúng ta phải bỏ ra hàng tuần hay thậm chí hàng tháng để gõ từng dòng code, fix bug, rồi refactor. Nhưng giờ, AI có thể giúp sinh ra hàng nghìn dòng code chỉ trong vài phút.

Điều đó có nghĩa là: giá trị thật sự không còn nằm ở việc bạn viết được bao nhiêu dòng code, mà nằm ở việc bạn muốn xây dựng cái gì, thiết kế ra sao, và giải quyết vấn đề gì cho người dùng.

Điều này cũng kéo theo sự thay đổi lớn trong kỹ năng mà một developer cần. Thay vì chỉ tập trung vào “gõ code”, lập trình viên trong tương lai sẽ phải biết cách:

  • Đặt câu hỏi và mô tả yêu cầu rõ ràng cho AI. Đây giống như việc ra đề thi: đề càng rõ, đáp án càng đúng.

  • Hiểu và review code mà AI tạo ra, vì cuối cùng trách nhiệm với sản phẩm vẫn là của con người.

  • Kết hợp nhiều công cụ và agent để đạt được mục tiêu nhanh và hiệu quả hơn.

  • Có thể sẽ hình thành 2 nhóm nghề: người phát triển sản phẩm (product developer) và người lập trình ở mức thấp hơn (low-level developer) để xây dựng module cốt lõi.

Nếu nghĩ kỹ thì kỹ năng này khá giống với vai trò của một technical architect hơn là một coder thuần túy: định hình giải pháp, kết nối các mảnh ghép, và đảm bảo hệ thống hoạt động ổn định.

Về cơ hội và thách thức thì mình thấy rõ ràng:

  • Cơ hội: thời gian từ ý tưởng → sản phẩm rút ngắn cực kỳ nhiều. Một cá nhân giờ đây có thể làm được những thứ mà trước kia phải cần cả một team. Điều này mở ra rất nhiều cơ hội cho sáng tạo và khởi nghiệp.

  • Thách thức: nếu chỉ dừng lại ở việc “biết code”, bạn sẽ nhanh chóng bị thay thế. AI có thể viết, sửa, refactor code rất nhanh, nhưng AI chưa thể giao tiếp và thấu hiểu con người. Những kỹ năng như trao đổi với khách hàng, lắng nghe nhu cầu, đàm phán, thuyết phục, hay đơn giản là xây dựng niềm tin vẫn là phần không thể thiếu – và chỉ con người mới làm được.

Exploring Claude Code Subagents: A Demo Setup for a RAG-Based Website Project

1. Introduction

Recently, Anthropic released an incredible new feature for its product Claude: subagents — secondary agents with specific tasks for different purposes within a user’s project.

2. Main Content

a. How to Set It Up:
First, install Claude using the following command in your Terminal window:

npm i @anthropic-ai/claude-code

If Claude is already installed but it’s an older version, it won’t have the subagent feature.

to update claude, command : claude update

Launch Claude Code in your working directory, then run the command:
/agents

Press Enter, and a management screen for agents will appear, allowing you to start creating agents with specific purposes for your project.

Here, I will set it up following Claude’s recommendation.

After the setup, I have the following subagents:

I will ask Claude to help me build a website using RAG with the following prompt:

The first subagents have started working.

The setup of the RAG project has been completed.

However, I noticed that the subagent ‘production-code-reviewer (Review RAG system code)’ didn’t function after the coding was completed. It might be an issue with my prompt, so I will ask Claude to review the code for me

After the whole working process, Claude Code will deliver an excellent final product.
Link: https://github.com/mhieupham1/claudecode-subagent

3. Conclusion

Through the entire setup process and practical use in a project, it’s clear how powerful and beneficial the Sub-agents feature introduced by Anthropic for Claude Code is. It enables us to have AI “teammates” with specialized skills and roles that operate independently without interfering with each other — allowing projects to be organized, easy to understand, and efficient.

Intelligent Automation with Claude Code Hooks: A New Leap in Software Development

Claude Code has been revolutionizing how we interact with source code, but what if we could make it even smarter and more autonomous? The answer lies in Claude Code Hooks – a powerful feature that allows you to customize and extend Claude Code’s behavior by executing shell commands at specific points in its lifecycle.

In this blog post, we’ll explore Claude Code Hooks, understand how they work, and provide some practical ideas to make the most of this feature.


1. What are Claude Code Hooks and What Can We Do With Them?

Claude Code Hooks are essentially user-defined shell commands that automatically execute at various “trigger points” (hook events) during Claude Code’s operation. This provides deterministic control over Claude Code’s behavior, ensuring that certain actions are always performed without relying on the choices of the large language model (LLM).

You can configure hooks in Claude Code’s settings files (~/.claude/settings.json, .claude/settings.json, or .claude/settings.local.json).

The main types of hook events include:

  • UserPromptSubmit: Triggers immediately when a user submits a prompt (before Claude processes it). This is excellent for prompt validation, adding context, or security filtering.
  • PreToolUse: Runs before any tool is used (e.g., Edit, Bash, Git). This is a critical control point to block dangerous commands, enforce formatting rules, or check permissions.
  • PostToolUse: Activates after a tool successfully completes its operation. Useful for analyzing results, logging commands, automating code formatting, or running tests.
  • Notification: Runs when Claude Code sends a notification (e.g., when waiting for input or requesting permission). Can be used to create custom notifications (Slack, sound).
  • Stop: Triggers when Claude Code finishes its response. Used for performing final checks or generating reports.
  • SubagentStop: Triggers when a sub-agent’s task completes.

2. Experimenting and Understanding How Claude Code Hooks Work

To better understand, let’s consider a simple example: automatically formatting code after each time Claude edits a file.

Step 1: Open the Hooks Configuration In Claude Code, type /hooks to open the configuration interface.

claude code hooks

Step 2: Select the PostToolUse Hook Event We want the hook to run after Claude edits afile, so select PostToolUse.

claude code hooks

Step 3: Add a Matcher Select + Add new matcher… and enter Edit|MultiEdit|Write. This will ensure the hook only runs when Claude uses editing or file-writing tools.

claude code hooks

Step 4: Add a Hook Command Select + Add new hook and enter the following command (example for a TypeScript file):

Bash

jq -r '.tool_input.file_path' | { read file_path; if echo \"$file_path\" | grep -q '\\.ts$'; then npx prettier --write \"$file_path\"; fi; }

This command will extract the edited file path, check if it’s a .ts file, and then run npx prettier --write to format it.

Step 5: Save the Configuration Select Project settings to apply this hook your projects.
claude code hooks

Step 6: Test the Hook Ask Claude to edit a TypeScript file, and you’ll see Prettier automatically format the code once the edit is complete. If the hooks are not triggering as expected, try restarting Claude. Restarting usually helps the system recognize and apply the new configuration settings.Below is a demo video showing how it works:

3. Practical Ideas for Claude Code Hooks

 

The possibilities with Claude Code Hooks are endless. Here are some practical ideas to integrate this feature into your workflow:

 

  • Code Quality Enforcement:

    • Automated Linting and Formatting: As in the example above, run Prettier, ESLint, Black, Ruff, gofmt, etc., after every file edit. This ensures code consistency throughout the project.
    • Type Checking: Automatically run TypeScript, MyPy, or other type-checking tools after file edits to catch errors early.
    • Custom Coding Rules: Enforce team- or project-specific coding rules by running custom scripts to check structure, naming conventions, or design patterns.
  • Automated Testing:

    • Run Unit Tests: Automatically run unit tests (e.g., pytest, jest) after Claude edits files in src/ or tests/ directories.
    • Lightweight Integration/E2E Tests: For minor changes, a subset of integration tests can be triggered to ensure no regressions.
  • Optimization and Security:

    • Prevent Dangerous Commands: Use a PreToolUse hook to block dangerous shell commands like rm -rf or access to sensitive files (.env).
    • Pre-commit Checks: Similar to Git hooks, run quality checks (e.g., searching for API keys, security checks) before Claude is allowed to execute git_commit.
    • Code Optimization: Run static analysis tools to suggest or enforce performance optimizations.
  • Notifications and Logging:

    • Custom Notifications: Send notifications to Slack, Discord, or use desktop notification tools (e.g., ntfy) when Claude needs your attention, completes a long task, or encounters an error.
    • Command Logging: Log all commands Claude executes for tracking, debugging, or auditing purposes.
    • Progress Tracking: Update progress status to a file or database to monitor long-running tasks.
  • Workflow Management:

    • Automated Report Generation: After a major task is completed, automatically generate a report summarizing changes or outcomes.
    • Documentation Updates: If Claude edits specific parts of the code, a hook can trigger automatic updates of related documentation sections.
    • Flow Control: UserPromptSubmit and PreToolUse hooks can block actions if conditions are not met, forcing Claude to rethink or ask you for more information.

4. Conclusion

 

Claude Code Hooks transform Claude Code from a powerful coding assistant into a comprehensive and deterministic development partner. By defining simple yet powerful rules, you can automate mundane but crucial parts of your work, freeing up time and energy to focus on the more creative and complex aspects of software engineering.

Start experimenting with Claude Code Hooks today and discover how they can revolutionize your development process, leading to greater efficiency and better code quality!

Gemini CLI vs. Claude Code CLI: A Comprehensive Comparison for Developers

1. Introduction to the Launch of Gemini CLI

Recently, Google launched Gemini CLI – an open-source AI agent that can be directly integrated into the terminal for work. In previous articles about Claude Code CLI, we already saw its powerful features. Now, with the interesting arrival of Gemini CLI, users have even more options when choosing which agent to use. In this article, we’ll explore and compare the different criteria between Claude Code CLI and Gemini CLI to see which agent might best suit your needs.

2. Comparison Criteria Between the Two CLI Agents

a. Platform Support

  • Claude Code CLI: This tool has certain limitations when it comes to operating system support. It works well on MacOS and Ubuntu, but for Windows users, it requires extra steps such as installing an Ubuntu WSL virtual machine. Even then, there are still some restrictions and a less-than-ideal user experience.

  • Gemini CLI: Google’s new tool supports all operating systems, allowing users on any platform to set up and use it quickly and easily.

b. Open Source

  • Claude Code CLI: This is a closed-source tool, so its development is entirely controlled by Anthropic.

  • Gemini CLI: Google’s tool is open source, licensed under Apache 2.0, which enables the user community to access and collaborate on making the tool more robust and faster.

c. AI Model

  • Claude Code CLI: Utilizes powerful Anthropic models such as Claude Opus 4 and Claude Sonnet 3.7, both highly effective for coding tasks.

  • Gemini CLI: Gives access to Gemini 2.5 Pro and Gemini 2.5 Flash, each useful for different needs.

d. Context Limitations

  • Claude Code CLI: This is a paid tool. Users can access it through their Claude account with various tiers, each offering different token limits (from 250K to 1M tokens per model). Users can also use Claude’s API key to pay based on token usage.

  • Gemini CLI: Google’s tool provides a free version, which allows access to Gemini 2.5 Pro, but can quickly hit the limit and drop down to Gemini 2.5 Flash.

e. Community and Extensibility

  • Claude Code CLI: As a closed-source tool, only the developer (Anthropic) can improve and maintain it.

  • Gemini CLI: Being open source, it has a large and vibrant community contributing to its rapid improvement and greater capabilities.

3. Gemini CLI

  • Link: https://github.com/mhieupham1/Flashcard_GeminiCLI

  • Prompt Example:

    • Please make for me a website about using flashcard for learning English with HTML, CSS, Javascript, do the best for UI/UX

    • A flashcard set can archive many words, user can add more word to a new set or existed set

    • Function for folder that can add existed flashcard sets or remove it

    • Function for flashcard set that can edit transfer user to a web to practice in this flashcard set

    • Dashboard need to have more eye-catching, good layout

    • And many prompts to ask Gemini CLI to fix their own bugs

    • Make the web has layout, functions like an official website with better CSS, JS, HTML

  • Strengths:

    • Can handle large token requests and good at reading context

    • Cost: Free version can access Gemini 2.5 Pro, but may quickly hit limits and fall back to Gemini 2.5 Flash. Sometimes, after logging out and back in, it works normally again with Gemini 2.5 Flash. A pro account offers a one-month free trial, after which users can cancel or continue with the stated price.

  • Weaknesses:

    • Requires a very large number of tokens (1M tokens for pro, 11M for flash) to build the website (even when incomplete)

    • Prone to repeated error loops, wasting tokens

    • Codebase is still weak and doesn’t always fully understand user intentions or basic web concepts, so prompts need to be very detailed

4. Claude Code CLI

  • Link: https://github.com/mhieupham1/Flashcard_ClaudeCodeCLI

  • Prompt Example:

    • Please make for me a website about using flashcard for learning English with HTML, CSS, Javascript, do the best for UI/UX

    • A flashcard set can archive many words, user can add more word to a new set or existed set

    • Function for folder that can add existed flashcard sets or remove it

    • Function for flashcard set that can edit transfer user to a web to practice in this flashcard set

    • Dashboard need to have more eye-catching, good layout

  • Strengths:

    • Understands user ideas very well, outputs high-quality, efficient, and minimal code without missing features

    • Only required 30K tokens for the flashcard web demo

    • Good, user-friendly UI/UX

    • Produced the demo with a single request (using only a pro account, not the max tier)

  • Weaknesses:

    • Requires a paid account or API key (tokens = dollars), but the code quality is worth the price

5. Conclusion

With the comparison above, it’s clear that Gemini CLI is currently much stronger than Claude Code CLI. However, a deeper dive into their practical efficiency and benefits for different use cases is still needed.

a. Gemini CLI

  • Strengths:

    • Free to use with high token limits, suitable for large projects needing a large context window

    • Highly compatible across platforms and easy to set up

    • Open source, ensuring rapid improvement through community contributions

    • Fast code reading and generation

  • Weaknesses:

    • Can randomly hit usage limits, dropping from Gemini Pro 2.5 to Gemini Flash 2.5, reducing effectiveness

    • Prone to repeated errors/loops, which can be difficult to escape’

    • Codebase may not be as efficient, often needing very detailed prompts

b. Claude Code CLI:

  • Strengths:

    • High-quality, thoughtful, and efficient codebase generation

    • Highly suitable for commercial projects thanks to token optimization

  • Weaknesses:

    • Requires a paid account, with different tiers for different performance levels; top tier is expensive

    • Limited cross-platform compatibility, making it less accessible or offering a poorer experience for some users

6. Which Should You Use? Summary of Best Use Cases

When is Claude Code CLI most convenient?
Claude Code CLI is the better choice if you prioritize high-quality, efficient, and minimal code output, especially for commercial projects that require clean UI/UX and robust functionality. It is also ideal when you want to achieve your result in a single, well-phrased prompt. However, you need to be willing to pay for a subscription or API access, and set up the tool on a supported platform.

When is Gemini CLI more convenient?
Gemini CLI is perfect if you need a free, open-source tool that works across all major operating systems and is easy to install. It’s best for large projects that require handling a lot of data or context, and for those who want to benefit from fast community-driven improvements. Gemini CLI is especially suitable for personal, experimental, or learning projects, or when you need flexibility and cross-platform compatibility—even though it might sometimes require more detailed prompts or troubleshooting.

Best practice of Claude Code

In the ever-evolving landscape of software development, AI-powered tools are no longer a novelty but a necessity for staying competitive and productive. Among these, Anthropic’s Claude Code has emerged as a transformative force, empowering both seasoned developers and non-technical professionals to build, debug, and innovate faster than ever before.

This guide goes beyond the surface-level tips and delves deep into the best practices that Anthropic’s own teams have honed through their daily use of Claude Code. Whether you’re a data engineer wrestling with complex pipelines, a product designer bridging the gap between vision and reality, or a marketer looking to automate your workflows, these insights will help you unlock the full potential of this powerful AI assistant.

claude code

 

The Foundation of Success: Universal Best Practices

 

Before we explore the team-specific strategies, it’s crucial to understand the fundamental principles that underpin successful collaboration with Claude Code:

  • The Art of the Prompt: The quality of your output is directly proportional to the quality of your input. Be clear, specific, and provide as much context as possible. Think of yourself as a project manager delegating a task to a talented but literal-minded assistant.
  • Iterative Collaboration: Don’t expect a perfect solution on the first try. Treat Claude Code as an iterative partner. Start with a simple prompt, review the output, and then refine your request with additional instructions. This back-and-forth process is where the magic happens.
  • Embrace Autonomous Workflows: For many tasks, you can set Claude Code to work autonomously and check in periodically. This is especially effective for prototyping, writing tests, and other non-critical path activities. You’ll be amazed at what it can accomplish while you focus on other priorities.

 

Team-Specific Strategies for Maximum Impact

 

Data Infrastructure: Automating and Securing Your Data Pipelines

 

The Data Infrastructure team at Anthropic relies on Claude Code to manage the massive datasets that fuel their research and development. Their best practices are a masterclass in efficiency and security:

  • The Power of Claude.md: Create a comprehensive Claude.md file in your project directory. This file should act as a “user manual” for Claude, outlining your team’s specific workflows, preferred tools, and coding conventions. A well-crafted Claude.md can transform Claude from a general-purpose assistant into a specialized team member.
  • Security First: When dealing with sensitive data, always prioritize security. The Data Infrastructure team recommends using MCP servers instead of the BigQuery CLI to ensure that you have granular control over data access and permissions.
  • Knowledge Sharing is Key: Regularly hold team sessions to share and demonstrate new Claude Code workflows. This not only helps to disseminate best practices but also sparks new ideas for how to leverage the tool in innovative ways.

 

Product Development: Building a Self-Sufficient Development Loop

 

The Claude Code team is at the forefront of using their own product to build, test, and deploy new features. Their best practices are a testament to the power of “dogfooding”:

  • The “Test-First” Approach: One of the most effective ways to ensure code quality is to have Claude generate tests before it writes the actual code. This forces a clear definition of the desired functionality and makes it easier to verify the final output.
  • Task Triage: Sync vs. Async: Develop an intuition for which tasks are best suited for asynchronous work and which require your direct supervision. Prototyping a new feature? Let Claude run wild. Fixing a critical bug in your core business logic? Keep a close eye on its work.
  • Clarity is King: When working in a complex codebase with multiple components that have similar names, be extra specific in your prompts. The more context you provide, the less likely Claude is to get confused and the more you can trust it to work independently.

 

Security Engineering: Hardening Your Defenses with AI

 

The Security Engineering team at Anthropic uses Claude Code to proactively identify and mitigate security vulnerabilities. Their strategies are a blueprint for building a more secure software development lifecycle:

  • Custom Slash Commands for the Win: Don’t be afraid to create your own custom slash commands to automate repetitive security tasks. The Security Engineering team has created over 50 custom commands to streamline everything from dependency scanning to vulnerability patching.
  • Let Claude Take the Wheel: For complex security investigations, resist the urge to micromanage. Instead, provide Claude with a high-level goal and let it work autonomously. You might be surprised by the creative and effective solutions it comes up with.
  • Documentation on Autopilot: Claude Code is a powerful tool for generating and synthesizing documentation. Provide it with a few writing samples and your preferred formatting, and it can create high-quality documentation that you can use in your wikis, READMEs, and other internal resources.

 

Data Science and ML Engineering: From Raw Data to Production-Ready Dashboards

 

The Data Science and ML Engineering teams use Claude Code to bridge the gap between research and production. Their best practices are a guide for anyone looking to turn data into actionable insights:

  • The “Slot Machine” Strategy: For complex refactoring tasks, don’t be afraid to take a chance. Save your current state, let Claude work its magic, and if the result isn’t what you’re looking for, simply roll back and try again. Sometimes a fresh start is the fastest path to a solution.
  • The Power of “Simpler”: If Claude provides a solution that is overly complex or difficult to understand, don’t hesitate to ask for a simpler approach. The model is often capable of generating more elegant and efficient solutions when prompted to do so.

 

API Knowledge: Navigating the Unknowns of a Large Codebase

 

The API Knowledge team is responsible for ensuring that Claude has access to the information it needs to answer user queries accurately. Their best practices are a must-read for anyone who works in a large and complex codebase:

  • Embrace the “Beginner’s Mind”: When tackling a bug or investigating an incident in an unfamiliar part of the codebase, let Claude be your guide. It can help you ramp up quickly and make meaningful contributions without a lot of prior knowledge.
  • Start Small, Think Big: Instead of overwhelming Claude with a massive amount of information upfront, start with the bare minimum and let it ask for more context as needed. This more natural, conversational approach can often lead to better results.

 

Growth Marketing: Automating Your Way to Success

 

The Growth Marketing team uses Claude Code to automate repetitive tasks and create sophisticated, multi-step workflows. Their strategies are a goldmine for anyone looking to do more with less:

  • Identify Your Automation Opportunities: Look for tasks that are repetitive, rule-based, and involve tools that have APIs. These are the low-hanging fruit for automation with Claude Code.
  • Divide and Conquer: For complex workflows, break them down into smaller, more manageable sub-tasks and create specialized sub-agents for each one. This makes it easier to debug problems and improves the overall quality of the output.
  • Plan Before You Prompt: Before you write a single line of code, take the time to map out your entire workflow. This will help you to create a more comprehensive and effective prompt for Claude Code.

 

Product Design: From Static Mockups to Functional Prototypes

 

The Product Design team uses Claude Code to bridge the gap between design and engineering, turning static mockups into interactive prototypes with unprecedented speed. Their best practices are a game-changer for any design team:

  • Don’t Go It Alone: The initial setup for Claude Code can be a bit challenging for non-developers. Don’t be afraid to ask for help from your engineering colleagues. A little bit of upfront investment will pay huge dividends down the road.
  • The Power of the Paste: One of the most powerful features of Claude Code is the ability to paste images directly into the prompt. This allows you to turn static mockups into functional code with just a few clicks.
  • Custom Memory for the Win: Create a Claude.md file with specific instructions on how you want Claude to behave. This is especially helpful if you have little to no coding experience, as it can help to guide the model and improve the quality of its responses.

 

RL Engineering: Supercharging Your Reinforcement Learning Workflows

 

The RL Engineering team uses Claude Code for everything from writing small features to debugging complex reinforcement learning algorithms. Their strategies are a must-read for anyone working in this cutting-edge field:

  • The One-Shot Approach: For many tasks, it’s worth giving Claude a quick prompt and letting it attempt the full implementation in one shot. If it works, you’ve saved yourself a ton of time. If not, you can always switch to a more collaborative, back-and-forth approach.
  • Checkpoint Your Work: When you’re experimenting with new ideas, it’s always a good idea to commit your work frequently. This makes it easy to roll back to a known good state if things go wrong.

 

The Future is a Collaboration

 

The best practices outlined in this guide are not just a set of rules to be followed blindly. They are a starting point for your own journey of discovery with Claude Code. As you become more comfortable with the tool, you will undoubtedly develop your own unique workflows and strategies.

The key is to approach Claude Code not as a vending machine for code, but as a true collaborator. By combining your own creativity and expertise with the power of AI, you can unlock new levels of productivity, innovation, and fun in your work. So go ahead, dive in, and start building the future, together.

Combining tmux and Claude to Build an Automated AI Agent System (for Mac & Linux)

1. Introduction

With the rapid growth of AI, multi-agent systems are attracting more attention due to their ability to coordinate, split tasks, and handle complex automation. An “agent” can be an independent AI responsible for a specific role or task.

In this article, I’ll show you how to combine tmux (a powerful terminal multiplexer) with Claude (Anthropic’s AI model) to build a virtual organization. Here, AI agents can communicate, collaborate, and work together automatically via the terminal.

 

2. What is tmux?

tmux lets you split your terminal into multiple windows or sessions, each running its own process independently. Even if you disconnect, these sessions stay alive. This is super useful when you want to run several agents in parallel, each in their own terminal, without interfering with each other.

 

3. What is Claude?

Claude is an advanced language AI model developed by Anthropic. It can understand and respond to text requests, and it’s easy to integrate into automated systems—acting as a “virtual employee” taking on part of your workflow.

 

4. Why combine tmux and Claude?

Parallel & Distributed: Each agent is an independent Claude instance running in its own tmux session.

Workflow Automation: Easily simulate complex workflows between virtual departments or roles.

Easy Debug & Management: You can observe each agent’s logs in separate panes or sessions.

 

5. System Architecture

Let’s imagine a simple company structure:

PRESIDENT: Project Director (sets direction, gives instructions)

boss1: Team Leader (splits up tasks)

worker1, worker2, worker3: Team members (do the work)

Each agent has its own instruction file so it knows its role when starting up.

Agents communicate using a script:

./agent-send.sh [recipient] “[message]”

Workflow:

PRESIDENT → boss1 → workers → boss1 → PRESIDENT

 

6. Installation

Since the code is a bit long, I’ll just share the GitHub link to keep things short.

tmux:
Install guide: tmux Installing Guide

Claude:
Install guide: Claude Setup Guide

Git:
Install guide: Git Download

Clone the project:

bash
git clone https://github.com/mhieupham1/claudecliagent

 

Inside, you’ll find the main folders and files:

CLAUDE.md: Describes the agent architecture, communication, and workflows.

instructions/: Contains guidance for each role.

.claude/: JSON files to manage permissions for bash scripts.

setup.sh: Launches tmux sessions for PRESIDENT, boss1, worker1, worker2, worker3 so agents can talk to each other.

agent-send.sh: Script for sending messages between agents.

 

7. Deployment

Run the setup script:

bash
./setup.sh
This will create tmux sessions for PRESIDENT and the agents (boss1, worker1, worker2, worker3) in the background.

To access the PRESIDENT session:

bash
tmux attach-session -t president


To access the multiagent session:

bash
tmux attach-session -t multiagent


In the PRESIDENT session, run the claude command to set up the Claude CLI.

Do the same for the other agents.

Now, in the PRESIDENT window, try entering a request like:

you are president. create a todo list website now
PRESIDENT will start the to-do list. PRESIDENT will send instructions to boss1, boss1 will assign tasks to worker1, worker2, and worker3.

You can watch boss1 and the workers do their jobs, approve commands to create code files, and wait for them to finish.

Result:

8. Conclusion

Combining tmux and Claude lets you create a multi-agent AI system that simulates a real company: communicating, collaborating, and automating complex workflows. Having each agent in its own session makes it easy to manage, track progress, and debug.

This system is great for AI research, testing, or even real-world workflow automation, virtual team assistants, or teamwork simulations.

If you’re interested in developing multi-agent AI systems, try deploying this model, customize roles and workflows to your needs, and feel free to contribute or suggest improvements to the original repo!

Introducing Claude 4 and Its Capabilities

Claude 4 refers to the latest generation of AI models developed by Anthropic, a company founded by former OpenAI researchers. The most powerful model in this family as of June 2024 is Claude 3.5 Opus, often informally called “Claude 4” due to its leap in performance.

Claude Opus 4 is powerful model yet and the best coding model in the world, leading on SWE-bench (72.5%) and Terminal-bench (43.2%). It delivers sustained performance on long-running tasks that require focused effort and thousands of steps, with the ability to work continuously for several hours—dramatically outperforming all Sonnet models and significantly expanding what AI agents can accomplish.

Claude Opus 4 excels at coding and complex problem-solving, powering frontier agent products. Cursor calls it state-of-the-art for coding and a leap forward in complex codebase understanding. Replit reports improved precision and dramatic advancements for complex changes across multiple files. Block calls it the first model to boost code quality during editing and debugging in its agent, codename goose, while maintaining full performance and reliability. Rakuten validated its capabilities with a demanding open-source refactor running independently for 7 hours with sustained performance. Cognition notes Opus 4 excels at solving complex challenges that other models can’t, successfully handling critical actions that previous models have missed.

Claude Sonnet 4 significantly improves on Sonnet 3.7’s industry-leading capabilities, excelling in coding with a state-of-the-art 72.7% on SWE-bench. The model balances performance and efficiency for internal and external use cases, with enhanced steerability for greater control over implementations. While not matching Opus 4 in most domains, it delivers an optimal mix of capability and practicality.

GitHub says Claude Sonnet 4 soars in agentic scenarios and will introduce it as the model powering the new coding agent in GitHub Copilot. Manus highlights its improvements in following complex instructions, clear reasoning, and aesthetic outputs. iGent reports Sonnet 4 excels at autonomous multi-feature app development, as well as substantially improved problem-solving and codebase navigation—reducing navigation errors from 20% to near zero. Sourcegraph says the model shows promise as a substantial leap in software development—staying on track longer, understanding problems more deeply, and providing more elegant code quality. Augment Code reports higher success rates, more surgical code edits, and more careful work through complex tasks, making it the top choice for their primary model.

These models advance our customers’ AI strategies across the board: Opus 4 pushes boundaries in coding, research, writing, and scientific discovery, while Sonnet 4 brings frontier performance to everyday use cases as an instant upgrade from Sonnet 3.7.

 

 


Key Strengths of Claude 4

 1. Superior Reasoning and Intelligence

Claude 4 ranks at the top in benchmark evaluations such as:

  • MMLU (Massive Multitask Language Understanding)

  • GSM8k (math problem solving)

  • HumanEval (coding)
    It rivals or exceeds OpenAI’s GPT-4-turbo and Google Gemini 1.5 Pro in complex reasoning, long-context understanding, and task execution.

 2. Massive Context Window (Up to 200K Tokens)

Claude 4 can read and reason over hundreds of pages at once, making it perfect for:

  • Analyzing lengthy legal or scientific documents

  • Comparing large codebases

  • Summarizing long texts or reports

 3. Advanced Coding Support

Claude 4 excels in:

  • Writing and explaining code in multiple languages (Python, JS, Java, etc.)

  • Debugging and understanding large code repositories

  • Pair programming and iterative development tasks

 4. Natural and Helpful Communication

  • Responses are clear, polite, and structured

  • Especially strong in creative writing, professional emails, and educational explanations

  • Can follow complex instructions and maintain context over long conversations


Safe and Aligned by Design

Claude is built with safety and alignment in mind:

  • It avoids generating harmful or unethical content

  • It is more cautious and transparent than most models

 


 How to Access or Use Claude 4

Claude is a cloud-based AI model, so you don’t install it like software — instead, you access it via the web or API.

1. Use Claude via Web App

 Steps:

  1. Go to: https://claude.ai

  2. Sign up or log in (you need a US/UK/Canada/EU phone number).

  3. Choose from free or paid plan (Claude 3.5 Opus is available only in Claude Pro – $20/month).

 Claude Pro Includes:

  • Claude 3.5 Opus (latest, most powerful)

  • Larger context

  • Priority access during high demand

 Currently, Claude is only available in select countries. If you’re outside the US/UK/Canada/EU, you may need to use a VPN and a virtual phone number to sign up (unofficial workaround).


2.  Use Claude via API (For Developers)

 API Access:

  1. Go to: https://console.anthropic.com

  2. Sign up and get an API key

  3. Use the API with tools like Python, cURL, or Postman

 Example (Python):

import anthropic

client = anthropic.Anthropic(api_key="your_api_key")

response = client.messages.create(
model="claude-3.5-opus-20240620",
max_tokens=1024,
messages=[
{"role": "user", "content": "Explain quantum computing in simple terms"}
]
)

print(response.content)


Can I Install Claude Locally?

No. Like ChatGPT or Gemini, Claude is not open-source or downloadable. It’s only available via:

 

Feature Claude 4 (Claude 3.5 Opus)
Developer Anthropic
Model Type Large Language Model (LLM)
Reasoning & Math Top-tier performance
Context Length Up to 200,000 tokens
Code Assistance Strong support for multiple languages
Language Style Human-like, calm, professional
Best Use Cases Analysis, writing, coding, dialogue
Access claude.ai or API