Skip to content

Blog

Creating Distinct AI Entities with Claude's Subagents

Creating Distinct AI Entities with Claude's Subagents | Mission
5:50

 

Have you ever built a team from scratch? 

Getting it right is difficult, and a lot of the challenge is related to clear roles and responsibilities and clarity of purpose. 

A deftly assembled, trusting team is far greater than the sum of its parts. A strong Product Manager makes Frontend Engineers more effective. An experienced Architect enables Developers to iterate more quickly with confidence. Each person on the team knows what their job is, how they can support their team, and can focus the majority of their attention on being an expert in their craft.

A Thought Experiment

What if we could split ourselves into separate minds and/or bodies? Could we build a team without having to hire anyone at all? There have been several ridiculous movies and TV series with some variant of this question at their core. 

One part of us could focus on chores, another on going to meetings, and even one that handles sleeping, so we can be well-rested and focused on things that we enjoy. Now, this obviously isn’t reality, but the fact that it’s a thought experiment that has shown up so many times in popular culture points to a kernel of truth in the desire for empowering ourselves to do more.

While we can’t split our own brains, we actually can split the brain of AI, with a surprising degree of efficacy. 

See where I’m going with this?

Claude Code’s Split Personalities

Claude Code’s relatively new “subagents” feature allows you to create distinct AI entities with their own areas of expertise, access to specific information and tools, and critically, their own context. Subagents are easy to create, as under the hood, they’re just prompts. Want a Senior Backend Developer to work with? How about a Business Analyst? Create a subagent that describes your ideal candidate profile, and voila!

LLMs, like people, are incredibly powerful, but they have a limited capacity. It would be lovely if the entirety of knowledge would fit inside of an LLM's context window, but it’s just not feasible. Subagents to the rescue! Each subagent is given a very focused and specific area of expertise. Because they have their own dedicated context capacity, their limited scope allows them to make the most of the context, going deep without polluting or reducing the main context.

To illustrate what a team of subagents looks like, let’s explore a fun and surprising use case that has that trademark 💥CloudHustle flavor💥.giphy (10)-1

A Weirdly Relevant Aside

My twelve-year-old son is extremely interested in AI, and I was trying to explain agents in terms that he would understand. He doesn’t have the experience of working with a team in a professional context, but he does have a weekly Dungeons & Dragons group. Every Sunday, he meets with a cast of characters, each with a detailed background, race, class, skill set, and origin story. There is a Dungeon Master with deep knowledge of the rules and an ability to craft a storyline and operate a game.

My son loves his D&D group, but he’s very interested in running his own games. The issue is that he’s never been a Dungeon Master, and while he has some knowledge of the rules and lore, he doesn’t have enough to craft deeply engaging storylines or “campaigns.” I was discussing this with my son when I had a realization. Subagents could be a way for him to learn more about AI in a way that is meaningful to him.

I found a GitHub repository containing an open source version of the D&D core rules, broken down into useful categories, like Classes, Races, Dungeon Mastering, Character Creation, Monsters, and more. Time to build a D&D super team! I created a subagent called “D&D Rules Council Chairman,” and empowered them with a team of "Council Member" subagents, each with an area of specialization informed by the D&D documentation. I also created a "Dungeon Master" subagent, with expertise in crafting campaigns with the aid of the Rules Council. Before long, I had a team of twelve subagents covering every aspect of D&D.

To put the team to the test, I had a short back-and-forth conversation in Claude. Incredibly, I was able to create five characters with deep back stories, including secret connections to one another, and two entire campaigns with compelling storylines spanning dozens of sessions that are perfectly tailored to the characters. As our conversation unfolded, I could see multiple subagents working simultaneously and in concert with one another. My son was blown away, and frankly, so was I.

(I wasn't planning on sharing the output, but if any readers are the right type of weird to find this interesting, don't hesitate to reach out.)

Back to Work

With this experience in hand, I decided to replicate the process, but this time with the Product Development organization at Mission. We have a small, but mighty team of Product Managers, Software Engineers, Product Designers, and Architects. At Mission, our job descriptions are published to the entire company, so I downloaded all of the JDs for the roles on the team and asked Claude to make subagents for each role. I then pointed Claude at the codebase of our platform, Mission Control, and instructed it to map the dependencies and tools used in the code to the appropriate roles, further tuning each agent to our needs.

While it's early to provide you with concrete results from this exploration, I will be spending time over the next few months working with our team to iterate, refine, and improve these subagents, providing them as a shared utility for our team. I'm optimistic that this approach will make our use of AI for software development even more effective. Here's hoping that their new virtual team members can empower them to keep building amazing things.

Author Spotlight:

Jonathan LaCour

Keep Up To Date With AWS News

Stay up to date with the latest AWS services, latest architecture, cloud-native solutions and more.