I Built My Claude Code Subagents DREAM TEAM to Create Any AI Agent

Cole MedinAbout 5 min readAug 29, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

  • Claude Code Sub Agents: Specialized prompts within Claude Code that handle specific parts of a development workflow.
  • Archon: A tool used to provide knowledge to sub agents and split tasks between them.
  • Agentic Workflow: A structured process involving multiple AI agents (sub agents) working together to achieve a common goal.
  • Pydantic AI: An AI agent framework used in the agent factory.
  • Context Engineering: The process of providing the necessary information and instructions to AI agents to ensure they can perform their tasks effectively.
  • Markdown Files: Used for communication between sub agents and the primary Claude Code agent, as they don't share conversation history.
  • Global Rules (claw.md): Defines the workflow and order in which sub agents are invoked.
  • Slash Commands: Packaged workflows in Claude Code that can be used to trigger specific actions.

Sub Agent AI Agent Factory

Overview

The video demonstrates how to use Claude Code sub agents and Archon to build an AI agent factory. The user provides a high-level description of the desired agent, and Claude Code spins up an agentic workflow with specialized sub agents to plan, create, and validate the agent. The presenter provides a template available on GitHub.

Sub Agents and Archon

  • Sub agents are prompts that define specialized agentic coders for different parts of the development workflow.
  • Archon is used to provide knowledge to these sub agents and split tasks between them.
  • The user acts as the project manager, orchestrating the sub agents.

Agent Factory Template

  • The template is available on GitHub and includes a diagram in the README to illustrate the agentic workflow.
  • Sub agents are defined in markdown documents within the /cloud/agents folder.
  • The workflow is defined in claw.md, specifying the order in which sub agents are invoked and how Archon is used.

Workflow Phases

  1. User Request: The user's request is received by the primary Claude Code agent.
  2. Clarification and Task Setup: The primary agent asks clarifying questions, understands requirements, and sets up tasks in Archon, distributing them among sub agents.
  3. Planning: The Pydantic AI planner sub agent uses web research and Archon to create an architecture and best practices for the agent, outputting a markdown document (initial.md).
  4. Parallel Planning: Three parallel sub agents plan the system prompt, tools, and package/agent dependencies, outputting markdown documents for each.
  5. Implementation: The primary Claude Code agent writes the code based on the context gathered in the previous phases.
  6. Validation: The validator sub agent creates and runs unit tests, outputting a validation report.
  7. Delivery: The final agent is delivered.

Sub Agent Details

  • Specialized Expertise: Achieved through fine-tuned prompts in markdown files.
  • Reusability: Sub agents can be packaged and reused in different workflows.
  • Flexible Permissions: Tools and models (e.g., Opus, Sonnet, Haiku) can be defined for each sub agent.
  • Context Preservation: Sub agents do not share conversation history with the primary agent, requiring careful context passing and output.

Creating Sub Agents

  • /agents Command: The easiest way to create a sub agent is using the /agents command in Claude Code.
  • Archon Integration: The Claude Code documentation can be added to Archon, allowing Claude Code to create all sub agents at once.

Lindy: AI Agent Builder

  • Lindy is a no-code AI agent builder with features like an agent builder, team accounts, and autopilot.
  • The agent builder allows users to prompt the agent they want, and Lindy creates the full workflow as a Lindy automation.
  • Autopilot gives Lindy the ability to control your computer, unlocking integrations.

Communication Between Sub Agents

  • Markdown files are used to communicate between sub agents, as they don't share the same context.
  • Each sub agent is instructed to output a specific file (e.g., initial.md, prompts.md) within a designated folder.
  • The workflow defines the inputs and outputs for each sub agent.

Demo: Hybrid Search RAG Agent

  • The video demonstrates building a hybrid search RAG (Retrieval-Augmented Generation) agent using the template.
  • The agent uses Pydantic AI and Archon for knowledge retrieval and task management.
  • The demo shows the sub agents operating in real-time, including the planner, parallel agents, implementation, and validator.
  • The final agent is able to answer questions based on a knowledge base.

Archon Setup for Demo

  • The Pydantic AI documentation is added to Archon to improve the reliability of the implementation.
  • A new project is created in Archon to store tasks and documents related to the agent.

Notable Quotes

  • "With sub agents, we get specialized agentic coders to handle different parts of our development workflow."
  • "We become the project manager of our agents. And that my friend is the future of agentic coding."

Technical Terms

  • LLM: Large Language Model
  • RAG: Retrieval-Augmented Generation
  • MCP: Archon's Management Control Plane
  • PRP: Prompt Reflexion Pattern
  • BMAD: Behavior, Motivation, Action, and Design

Logical Connections

  • The video starts by introducing the concept of sub agents and their benefits.
  • It then explains how to use the agent factory template to build AI agents.
  • The workflow is broken down into phases, with each phase explained in detail.
  • The video demonstrates the process with a real-world example, building a hybrid search RAG agent.
  • The use of Archon for knowledge retrieval and task management is integrated throughout the demo.

Data and Statistics

  • The planner agent in the demo took 1 minute and used almost 30,000 tokens.
  • The Pydantic AI documentation in Archon includes about 430 code examples.

Conclusion

The video provides a comprehensive guide to building AI agents using Claude Code sub agents and Archon. The agent factory template simplifies the process by providing a structured workflow and specialized sub agents. The use of markdown files for communication and Archon for knowledge retrieval and task management enhances the reliability and efficiency of the development process. The demo showcases the power of this approach, demonstrating how to build a fully functional hybrid search RAG agent with minimal effort. The key takeaway is that sub agents, combined with tools like Archon, represent a significant advancement in AI coding, allowing developers to create complex agents with greater ease and control.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.