Modern Creator Network
Mark Kashef · YouTube · 21:21

How I Built an AI Council with Claude Code Subagents

A 21-minute walkthrough of spinning up three competing AI agents that debate your ideas and write their reasoning to a shared file.

Posted
3 months ago
Duration
Format
Tutorial
educational
Channel
MK
Mark Kashef
§ 01 · The Hook

The bait, then the rug-pull.

The nontechnical use of sub-agents is the gap nobody is covering. While developers run parallel code reviews, Mark Kashef is spinning up a three-voice AI council to make better business and product decisions without inflating a single context window.

§ · Stated Promise

What the video promised.

stated at 00:51I'm also gonna show you a very low resolution trick that I use to monitor exactly what they're doing.delivered at 03:03
§ · Chapters

Where the time goes.

00:0001:14

01 · Cold open: the gap nobody covers

Sub-agents for nontechnical decision-making: brainstorming, planning, product decisions. Teases the monitoring trick.

01:1502:35

02 · Why sub-agents beat one long context

Hallucination climbs past 40-50% context fill. Each agent gets a fresh 200K window. Compaction is nondeterministic.

02:3604:40

03 · Architecture: the council + shared_reasoning.md

Optimist (best case), Devil's Advocate (stress-test), Neutral (synthesize). Shared file = paper trail of agent thoughts.

04:4106:29

04 · Terminal demo: /agents + Create new agent

Asks Claude to list built-in sub-agents. Navigates to /agents, manage configuration, create new agent at project level.

06:3008:50

05 · Building the Optimist Strategist

2-sentence brief, Claude writes the full system prompt. Assigns Sonnet, picks green. Agent file at .claude/agents/optimist-strategist.md.

08:5110:13

06 · Building the Devil's Advocate

Same flow: pessimistic but with nuance. Red color, Sonnet. Description: stress-testing, blind spots, hidden risks.

10:1412:36

07 · /initialize + CLAUDE.md + agents gather trigger

Claude writes CLAUDE.md documenting the council. Mark adds agents gather trigger phrase and shared_reasoning.md documentation requirement.

12:3714:38

08 · Adding the Neutral Analyst (blue)

Claude auto-reads existing agent files, writes neutral-analyst.md. Updated council: green/red/blue.

14:3917:26

09 · Critical: test in a fresh session

Context contamination from the build session causes false positives. Always open a new Claude Code instance before stress-testing CLAUDE.md.

17:2721:06

10 · Live demo: AI Avatar Academy

Real business idea submitted: cron job scrapes AI news, HeyGen clones avatar, auto-generates lessons. All three agents invoked in parallel.

21:0723:10

11 · Council report + convergence

Optimist: real-time AI literacy infrastructure. Devil's Advocate: HeyGen costs $60-80/min, ToS scraping issues, legal gray. Neutral: technical high, market low-medium. Consensus: validate-first.

23:1124:05

12 · Make them fight + shared_reasoning.md reveal

Agents debate each other in a second pass. shared_reasoning.md shows structured per-agent reasoning with confidence levels.

24:0624:41

13 · CTA

Agent MD files + prompts in description link 2. Paid community in link 1.

§ · Storyboard

Visual structure at a glance.

open
hookopen00:00
problem
promiseproblem01:05
architecture
valuearchitecture03:43
demo-start
valuedemo-start06:30
council-live
valuecouncil-live11:21
live-demo
valuelive-demo17:27
report
valuereport21:07
cta
ctacta24:06
§ · Frameworks

Named ideas worth stealing.

02:36model

The AI Council Pattern

  1. Optimist Strategist (green)
  2. Devil's Advocate (red)
  3. Neutral Analyst (blue)
  4. shared_reasoning.md audit log
  5. agents gather trigger phrase

Three complementary sub-agents run in parallel on any decision. Each documents reasoning in a shared file. Main session synthesizes without sycophancy bias.

Steal forproduct decisions, offer validation, any time you'd normally ask Claude 'should I do X'
02:36concept

Context Window Economics

Hallucination risk climbs past 40-50% context fill. Three agents at 50K tokens each = 150K total across three prime-condition sessions. One session doing the same work hits 80-90%.

Steal forjustifying sub-agent architecture to an audience skeptical of complexity
14:39concept

Fresh Session Stress Test

Always open a brand new Claude Code session before testing your CLAUDE.md orchestration. The build session has context in memory and will execute even with a broken config.

Steal forany tutorial teaching Claude Code agent setup
§ · Quotables

Lines you could clip.

02:36
Claude typically loses focus, starts its hallucination nation journey around 40 to 50% of the context window being used.
Memorable coined phrase + concrete statTikTok hook
02:03
Hire a sub agent the same way you would hire an employee if you were a bootstrap startup.
Business analogy reframes technical concept for non-dev audienceIG reel cold open
18:38
Make them fight each other. I told you. It's very scientific.
Self-aware humor, standalone punchlineTikTok hook
§ · Pacing

How they spent the runtime.

Hook length74s
Info densityhigh
Filler8%
§ · Resources Mentioned

Things they pointed at.

14:30productHeyGen API
00:00productClaude Code
§ · CTA Breakdown

How they asked for the click.

24:06link
I'll make them available to you in the second link in the description below

Dual CTA: free agent files + prompts in link 2, paid community in link 1. Clean and non-pushy.

§ · The Script

Word for word.

metaphoranalogy
00:00Most people who use Cloud Code almost never touch sub agents, and when they do, they don't use it the way I'm about to show you in this video. Typically, if they're a developer, they're doing it for reviewing pull requests, running tests, running different code actions in parallel, and doing technical tasks in general.
00:16But here's what nobody's really talking about. The fact that you can use sub agents for tons of nontechnical work and get it done that much faster, more efficiently, and more importantly, without bloating your context window.
00:29And I'm talking about brainstorming, planning, and all kinds of decision making. You can literally build yourself an AI council with different perspectives, with different intentions and goals so you can make the best decisions and the best plans possible, whether it's for a technical project or something personal or project management as a whole.
00:48And beyond just spinning them up and giving them instructions, I'm also gonna show you a very low resolution trick that I use to monitor exactly what they're doing. Because typically, if you spin them up, you don't really know what they're doing until you get the final result.
01:01So I'm gonna show you my way of spying on them. Let's dive in. Alright.
01:04So I'll first walk you through the mental model of using sub agents in the nontechnical way, and just know that if you are technical or you wanna apply this to technical circumstances, you absolutely can. I just wanna make it as business practical as possible, and you can take everything and just build on it from there.
01:20So the crux of the problem is typically most beginners, even intermediate, just use Claude code in a way they just treat it like chatty bitty, where you have a conversation. Once it fills up, you do some form of compaction.
01:32And if you don't know what compaction really does behind the scenes, in a way, it's somewhat random and nondeterministic what Claude chooses to prioritize when you compress your conversation.
01:42And when that happens, people start getting shocked, even though they shouldn't, that their conversations are degrading over time. So one of the most elegant ways to avoid this is creating a series of sub agents. Now as with everything vibe coding, some people are taking this to the next level where they have ten, fifty, a 100 sub agents that are all running in parallel.
02:01And while that sounds super cool, realistically, you should hire a sub agent the same way you would hire an employee if you were a bootstrap startup.
02:10When you feel like there's a task that deserves to run mutually exclusively and can run without any form of dependencies or run-in some order where the first agent goes first and baton passes it to the second, then this is where it makes the most sense.
02:23Because not only does it keep your main window clean and your context as clear as possible, but it also creates more focus between the agents. As of this recording, at least, it's well documented that Claude typically loses focus, starts its hallucination nation journey around 40 to 50% of the context window being used.
02:41Meaning, as you approach 80% or 90% of the context window being filled for that session before compaction, you'll notice a step down in quality. So my goal is to help you avoid that completely. Now like I said at the start of the video, the goal isn't just to spin them up, it's also to find an easy way to monitor them.
03:00If you've watched my other videos, then you know I have a tendency to go crazy mad scientist. But in this case, I came up with a very low resolution solution where I make this markdown file, and I just call it shared reasoning. And it's literally a file with a series of text where each agent makes its notes about what it did, what it thought, and how it came to its final conclusion.
03:21And the funny part is you can even have them simulate debating each other if you're doing something again more on the nontechnical side. Not only does this allow you to do things like create a optimist agent, a neutral agent, and a devil's advocate agent, like I'll show you shortly, but it gives Claude this ability to neutrally look at all the perspectives and without sycophancy, and what that means in plain English is without its tendency to always tell you you're absolutely right, it can look at those arguments and then through pattern recognition, give you a better decision making framework.
03:52So instead of just relying on the wisdom of one language model, you have the luxury of tapping into three brains that came to their own conclusions in separate sessions with fresh virgin blank context windows. So the result I'm going for is a shared reasoning file where you can see the optimist agent, how it thought through things, its key insights, recommendations, and same thing across the board.
04:15And, again, you can take this idea, create your own derivative of it, create a series of reasoning files, but the overall goal is I go on x a lot and I see very overengineered surveillance systems of agents. But if you as the builder and the user just wanna keep tabs on what your agents are doing, this is a pretty simple way to do that that's not intimidating to someone that's not technical.
04:36So with that, let's hop into the terminal. So you can use the Claude code extension, but because the terminal shows a lot more verbosity, which in plain English means, it shows a lot more of the intermediary steps of what's happening behind the curtains, I will go through and do this on the terminal itself.
04:51So I'm just gonna click out of the extension. I'll open the terminal in cursor. I will use my shortcut command to invoke the dangerously skip permissions as I usually do, and then we will just ask a basic question.
05:04Just because if you're not as acquainted with sub agents, it's helpful to really just ask Cloud Code what's happening underneath the hood. Okay. So can you just break down what sub agents you come up with or come with out of the box?
05:18So asking this is helpful because you can literally ask it how it's configured, what comes out of the box, and most importantly, what you can build on or invoke without having to rebuild yourself.
05:29And you can see here, have general purpose agents. I have explore agents. Those are great for code exploration or even file exploration.
05:36You have planning agents. You have feature explorers, code reviewers, even a mobile app builder agent.
05:43So you can create your own very easily, and all you have to do is just do slash agents, click on manage configuration.
05:50I have some that come out of the box. You can click on create a new agent. And in this case, we're gonna create it at the project level.
05:56Now the difference between this and this is one is gonna be global, meaning if you always want a sub agent to exist and persist in every project moving forward, then that's the option you're gonna pick.
06:09So we'll pick project, and we'll do generate with Claude. Even though you could just go to Claude on the outside, you could have a external Claude code session to help you create a very refined prompt yourself if you wanna be able to get into the nitty gritty.
06:23Alright. So I'm just gonna dictate in Claude the big picture, and it will write the instructions for the sub agent itself. Okay.
06:30So I'm creating a language model council, and on this council, I wanna create a optimist maximalist that always looks at the glass half full without doing it blindly. So not just a hype person or a hype agent, but something, someone that will take ideas, take suggestions, and extrapolate the best way that something could go and what would need to happen for that to be true.
06:55So pretty poetic, but this should be able to generate from that description our angel agent, and then we'll create our devil agent.
07:04Then eventually, we'll create our neutral agent. Now I'm not gonna worry about hooking it up with tools or MCPs, although I could do another video about sub agents where I go much deeper. Let me know down the comments below if you're interested.
07:16I can click on continue, and then we can assign it a cheaper model because I don't need some crazy complex thinking. So we'll do SONNET, and then we'll pick green for optimism. This is the prompt it's coming up with.
07:29It's called the optimist strategist. It tells you exactly where it's gonna be located, the description of the agent.
07:34So use this agent when you need a perspective that explores the best possible outcomes of an idea, proposal, or situation while grounding that optimism in actionable pathways. So that's exactly what I want. So I'll click on create.
07:47Now we have that ready to go. I'll create the devil agent or not the devil agent, the devil's advocate agent. So we'll send over a similar prompt.
07:55Okay. So I wanna spin up a devil's advocate agent, and the goal of this agent isn't to say no no matter what. It should be able to take into account some form of nuance.
08:05It shouldn't always look at the darker side, but it has a tendency to be more on the pessimistic side of things. So it's not unrealistically pessimistic, but it looks at situations or ideas in a way where it looks at the other side and really pushes back on pure maximalist optimism.
08:24So you'll notice yourself learning how to say poetic words to create these prompts because you have to describe the TLDR of what you're going for and then hope that Opus is smart enough to extrapolate off of that. Once again, we'll click on continue.
08:38I'll pick Sonnet, and this time, as you guessed it, we'll make it red toward devil's advocate. Use this agent. Let's just take a look here.
08:46Use this agent when you want a critical examination of ideas, plans, proposals, or assumptions. This agent excels at stress testing.
08:53That's exactly what we're going for. Optimistic projections, identifying blind spots, surfacing hidden risks, etcetera. So we're good to go.
09:01We'll create the neutral agent later. So all I'll do is I'll escape from here. And one pro tip is if you ever wanna invoke a specific one of these sub agents, all you have to do is do at and then do optimist right here, and you'll see that it invokes this specific agent.
09:17So if you wanna send a very specific request purely to the devil's advocate and you don't wanna leave it up to chance as to whether or not Claude realizes when to invoke which, then this is the best way to do that. Now that I have both, one shortcut I could do is just do slash initialize. This will create a Claude MD with the understanding of the existence of these different sub agents.
09:37Can we change it? Absolutely. And I will change it because I will tell it when to invoke them and how to make them work because we're missing one piece of the puzzle, which is creating this shared reasoning file where they're dictated to document what they're doing and how they're doing it.
09:51And you can see right there, it's written the Claude code file, and it gives you the TLDR right here. So it tells you that it understands the project purpose, agent configuration system for decision making, the architecture, file structure.
10:02So we have the eighty twenty good to go. Now we need to give it the 20. So let us basically give it the instruction now on creating this file and documenting in CloudMD that will act as our command center to steer the course of the conversation and how these sub agents are invoked.
10:19So let me do this. Okay. So now I wanna create a file that I called shared underscore reasoning dot markdown file.
10:27And what I want to happen is, and I want you to document this in the CloudMD, is when I ask for my counsel to gather, you can't even create a magic word that I can say, like, agents gather.
10:40I wanna be able to submit an idea and have both sub agents work on developing that idea, coming up with a base case where it could work or where it couldn't work. And depending on where that sub agent skews, I want it to come back with a full report, but also throughout that process, document its thinking and its decision making process, any key insights in this shared reasoning file.
11:03Essentially, even though these sub agents can work in parallel, I want them in parallel as well to document what they're thinking, how they're coming to their conclusions, so everything is maintained in this markdown file. And I want you to persist this behavior even if we add more agents to this very council.
11:21So this should be able to give us exactly what we're looking for. I'll send this off, and I'll show you the result. And you can see right here, it says, I will launch all council agents in parallel.
11:31Each agent will document their reasoning and shared reasoning. Each agent returns a full report with their perspective, and you get a balanced view with a persistent record of how each agent reached their conclusions, which is awesome because what we can do in the future, just as a spoiler, is we can have Claude itself look at the shared reasoning file, then come to its own conclusions without its natural bias to always be this yes person to say, you're so awesome, Mark.
11:57Your idea is so smart. You're absolutely right. In a way, we're trying to weight its opinion in the virgin opinions of someone that's supposed to be negative, someone that's supposed to be positive, and now we'll add someone that will be neutral.
12:10So since I'm lazy and now we have everything in context, I will just ask it to spin up a sub agent that is on the neutral side. So I'll say, cool. Can you spin up one more sub agent that you also persist in our dot clawed root folder as a sub agent MD?
12:25And we want it to be a neutral sub agent. So you can see how the positive one is configured, the more negative or pessimistic one, create a neutral one, and then update the clot MD and the rules accordingly. So now we can just offload because we have enough context within the session for it to know exactly what I'm looking for.
12:43And after a few minutes, it not only rereads the instructions that we had before, so both of the sub agents right here, it then creates another markdown file that's stored in our CloudMD as you could see right here, the neutral analyst. It comes up with a description without us even having to do the slash command agents, and then it updates the CloudMD to add the neutral analyst as well.
13:04So it says it provides objective analysis, maps trade offs, synthesizes perspectives, and anchors decisions to evidence. So that's exactly what we're looking for, and then even gives us a diagram.
13:15It came up with a color for blue for neutral. So that's how you know we have AGI. It came up with blue.
13:22Key characteristics, output structure, and now it shows you the updated council. So now you could be ready to go.
13:28You could add a few more because with this, unlike with the world of code, I can tell you working on production grade projects for clients, we don't use sub agents that often in production because and you can spin up even more if it makes you happy, but in most cases, of five or six, at least for this specific application, you might not need them.
13:47So now that everything's set up, I won't test it in the same chat because some people have this tendency to set everything up in a chat and then ask for x, and then x works perfectly. And when they go in a brand new chat, x doesn't work anymore.
14:01And the reason is you had this running conversation in context. So even if for whatever reason the sub agent wasn't set up properly, because the context is here, it will execute the task perfectly.
14:12So we wanna be able to stress test our CloudMD, our central brain, to make sure it knows exactly how to orchestrate all of our agents. So all I'll do is I'll open a brand new session.
14:22We'll re spin up Cloud Code, and we'll test out an actual idea. And now comes the fun part. So I'm actually gonna give a real idea that myself and my team have been working on as one of our 100 side projects, and it's for creating an AI avatar academy where anytime something new comes out in AI, it will use the Hegen API to create a series of lessons, and I'm curious to see if it would make sense to go head to head with other well known education companies that do async content, but have this platform that always auto updates, uses my likeness to see does it make sense, does it make business sense, is there longevity or not.
15:01Okay. So I had this crazy idea, and I want to align and invoke my entire council to give me their thoughts on this matter. So I wanna create a brand new platform.
15:11I wanna call it AI Avatar Academy. And the goal of the academy is there would be some form of scheduled cron job that would watch everything brand new that's coming out on the Internet. So if it's a brand new update from Google Gemini or Anthropic or OpenAI or something that's really trending on x related to GenAI, I would want it to go and scrape that information, go and look up the documentation, then use Hegen or similar and use the, let's say, the Hegen API to come up with a clone avatar of myself and then create and spin up tons of lessons.
15:46So when people go in, there is an ever growing library of AI generated content that they know is AI generated, but it also comes with this knowledge based chatbot that also has knowledge of those same things. So they have this ever growing portal of tutorials that they can watch.
16:03What do you think about this idea? So now I will try to inhale oxygen after that soliloquy while this hopefully invokes all of our sub agents.
16:11And you can see right here, it says, let me gather the full council to give you a comprehensive perspective on AI Avatar Academy, and you can see we have now invoked all three agents. We have the optimist, the devil's advocate, and the neutral one, and I will go into the future and come back once they're done. And this is still not done, but I wanted to show you a peek of what's happening.
16:30So the beauty of sub agents, as you can see right now, the token usage is around the same for all of them. And had they all run-in the same session, we would have had almost 80 to 90 already full because the denominator, as of this recording, is 200 tokens.
16:45So the fact that they're all running on their own, meaning they're still in their prime real estate of context window, they're not in the hallucination nation zone, and they can keep focusing on their specific task, which is taking our goal and just scrutinizing it with their perspective. And after five minutes, they finish up.
17:02They've all used around 50,000 tokens. We'll take a look at the shared reasoning file shortly. But you could see it comes back with a council report.
17:10It walks through each of their perspectives. So the visionary, the optimist naturally leans positive where it says it could become the definitive real time knowledge infrastructure for AI literacy where millions turn first to understand what's happening in AI.
17:23And then the devil's advocate, which I care more for, is it really scrutinize the API that I'm talking about that from a cost standpoint, it might not make sense unless we're not making enough revenue. Legal liability, so scraping likely violates the terms of service of major platforms, derivative content from copyrighted docs, legally gray, actually very solid points.
17:44And you have the neutral one that basically assesses the technical achievability, high, content quality achievable, medium, market viability, low medium, and then economic viability, uncertain. So now this gives you the ability to audit all of these different perspectives.
18:01It comes back with a consensus, and then Claude, neutrally, gives you a recommendation that says proceed with the validation first approach, curation algorithm, plus 50 high quality tutorials to prove the concept.
18:14And then the agent gives you the TLDR of the devil's advocate, high risk, validate demand, model economics. So what's cool is if you can imagine this Venn diagram, it's looking for what is shared in the middle.
18:26So if you're trying to make a hard decision in the business, in life, what you should sell in AI if you are selling AI solutions, then this could be super useful. And then just to finish things off, I just wanna show you one of the more complex, very scientific prompts I like to do once in a while.
18:41Make them fight each other. I told you. It's very scientific.
18:44So now what happens is we have them run-in parallel again, but this time to scrap each other instead of to independently just write in the same file what conclusion they come to. So then it comes back with a series of fights and the proclaimed winner.
18:58So round two, optimist fires back at critics, and it walks through exactly what their arguments were.
19:06So you're comparing apples to oranges for YouTube versus HeyGen powered learning. Um, I'm even gonna continue reading that. Devil's advocate dismantles the optimism.
19:15So it's like you're watching a play by play. Neutral analyst calls out both sides. So you get to and I mean this in serious terms.
19:23Look at different lines of reasonings. Naturally, I am making this more extreme to make this more entertaining and for you to get the point. But if you have actual mature decision making processes, you can do this to look at a scoreboard and see, alright.
19:36Where do the devil's advocate win versus the optimist and why? Then you can always take a look at our file, which I haven't shown you yet, but it really well organizes everything. So you could see this file captures the collective thinking process of the agent council.
19:51Each agent documents their reasoning, key insights, and decision making process. So you could see it dates the session. It looks at the overall idea under review, the neutral analyst reasoning, key considerations, analysis process, critical insight, optimist, uh, strategist reasoning, same thing.
20:10And then you have this all documented with also a confidence level when they come to their final conclusions. And, I actually use this a lot for running my business, prompt advisers, well as my community, making decisions, having my trusted council of folks in addition to my trusted council of human beings.
20:27So hopefully, this video not only entertained you, but gave you a brand new skill that you can put in your back pocket to help you be that much better of a decision maker. So if you want access to the prompts I sent, the markdown files for my devil's advocate agent, the optimist, and the neutral one, and the diagrams I showed you at the beginning just to break down the concept later on, I'll make them available to you in the second link in the description below.
20:49But after speaking to your AI council, if you decide that you wanna step things up and be in a community where we're doing much deeper dives on Cloud Code, delivering full systems, and giving you access to not just myself and my team, but coaches certified in cybersecurity, vibe coding, and software engineering, then maybe check out the first link in the description below, and I'll see you in my early adopters community.
21:11And for the rest of you, if you could leave me a like and a comment on the video, I would be infinitely grateful as it keeps this channel growing and keeps you more incentivized to do more weird stuff like this. I'll see you in the next one.
§ · For Joe

Three brains, zero sycophancy.

Steal the council pattern

The AI Council is the structural fix for the yes-man problem: three agents with opposing mandates, all writing reasoning to a shared file before the main session synthesizes.

  • Create three agent files: Optimist, Devil's Advocate, Neutral Analyst. Each gets a 2-sentence brief; Claude writes the full system prompt.
  • Add 'agents gather' as a trigger phrase in CLAUDE.md — maps to parallel Task-based launch of all three agents.
  • Require each agent to document its thinking in shared_reasoning.md as it works, not just at the end.
  • Always stress-test in a fresh session — the build session context will mask a broken CLAUDE.md.
  • Let them fight: a second pass where agents debate each other surfaces the convergence zone.
  • Apply to any product or offer decision before building — costs 150K tokens and 5 minutes.
§ · For You

A smarter way to pressure-test your own ideas.

If you want better decisions

Before committing to any big idea, use AI to give yourself three honest advisors: one who argues why it will succeed, one who stress-tests every assumption, and one who synthesizes the truth.

  • Write your idea down in one paragraph, then ask three separate AI conversations to evaluate it: best-case optimist, worst-case skeptic, neutral fact-checker.
  • Don't ask the same session all three questions — the AI drifts toward consistency. Fresh sessions per perspective.
  • Look for the convergence zone: what do all three agree on? That's your most defensible starting point.
  • The skeptic lens is the most valuable — it finds the legal, cost, and market risks you're too excited to see yourself.
  • Cost-and-viability questions belong in the skeptic pass, not the brainstorm pass.
§ · Frame Gallery

Visual moments.