**Stop Writing Prompts | Claude Code Tutorial: AI Agent Loops, Subagents, Skills & Multi-Agent Systems — Transcript & Summary | SozAI**
Source: https://sozai.app/transcript/stop-writing-prompts-claude-code-tutorial/

Tutorial on Anthropic's Cloud Code explaining AI agent loops, prompt assembly, Cloud MD files, and multi-agent systems.

## Key Takeaways

- Cloud Code is more than a CLI; it integrates with multiple environments and supports local and web usage.
- Cloud MD files provide essential context to AI models, improving code generation accuracy and efficiency.
- Plan mode helps simulate a collaborative planning process with the AI before implementation.
- Understanding prompt assembly and context management is key to optimizing Cloud Code performance.
- Verification within the AI loop is crucial to maintain code quality and avoid errors.

## What the video covers

- Introduction to Cloud Code by Lydia from Anthropic, focusing on understanding its inner workings.
- Explanation of the agentic loop and how prompts are assembled for AI models.
- Overview of Cloud Code features including skills, plugins, subagents, and multi-agent systems.
- Discussion on Cloud MD files that summarize project context to improve AI model understanding and reduce unnecessary tool calls.
- Comparison of different AI models like Opus and Sonnet in the context of Cloud MD file usage.
- Importance of managing context window and token usage in Cloud Code workflows.
- Demonstration of plan mode in Cloud Code to encourage planning before coding.
- Emphasis on verification in the AI coding loop to ensure quality outputs.
- Use cases of Cloud Code across CLI, IDEs (VS Code, JetBrains), browser, and desktop app.
- Practical tips on personalizing Cloud Code to fit specific codebases and workflows.

Answers

## Questions about this video

What is the purpose of a Cloud MD file in Cloud Code?

A Cloud MD file summarizes the project’s codebase, technologies, and architecture to provide context to the AI model, reducing unnecessary tool calls and improving code generation accuracy.

Can Cloud Code be used outside the CLI?

Yes, Cloud Code can be used in IDEs like VS Code and JetBrains, in the browser, and through a desktop app, supporting both local and web-based workflows.

What is plan mode in Cloud Code and why is it useful?

Plan mode instructs the AI not to code immediately but to discuss and plan the approach first, mimicking a collaborative coworker and improving implementation quality.

## Full Transcript — Download SRT & Markdown

00:00

Speaker A

Hi, I'm Lydia. I'm on the Cloud Code team at Anthropic. [music] I created this course because I want to give you a better understanding of how Cloud Code works behind [music] the scenes so that you can truly personalize it to your codebase and your workflows. In this course, we'll be talking about the agentic loop, how your prompt is [music] assembled, and what the model actually sees. And then we'll be talking about the features in Cloud Code and why we use them. [music] Claude MDK. Uh, before that, I was at Vercel, and I was at Bun. Uh, Bun is the JavaScript runtime that Cloud Code uses. So we got acquired by Anthropic, and now I'm in the Cloud Code world at Anthropic. Uh, not going to lie, it was a bit scary. I, of course, don't have an AI background. I did use a lot of Cloud Code like during my time at Bun, but I felt like it's such a new world. I, I felt like kind of an impostor not knowing how even AI works, and I was working on this AI tool. But hopefully, in this workshop, I want to cover, you know, some of the fundamentals, and as you'll see for Cloud Code, like the stuff that we can use like skills and plugins, but I also want to go a little bit deeper, um, just to give you a better, like, mental model of how Cloud Code works, 'cause that always really helps for me, and I feel like with software engineering, that was so much easier to do. It was a bit more deterministic in that way, but Cloud Code is a, is a newbie. I want to talk about some of the foundational fundamental things that I'm sure if you've worked with Cloud Code, you've already used like Cloud MD, maybe some skills, but also subagents and plugins. [snorts] Um, and as I said, a little bit behind the scenes to give you a better mental model, and my goal is to kind of have each section build on top of the other one. I feel like it, it builds up pretty nicely. Um, it's, it's easy to just, you know, get prompting with Cloud Code but not really understanding what's going on. So hopefully that workshop might change yet. But first, like, what is Cloud Code for those of you who haven't used it yet? It's not just a CLI. I know most of us are using it in the CLI. Uh, but really, it's an agent that you can use in your terminal, but you can also use it in your IDE in VS Code or JetBrains. Uh, you can use it directly in the browser, and we also have the Cloud desktop app. Um, the only difference, like on our desktop app and of course in the CLI, you can run it locally on your device. Um, but you can also use Cloud Code on the web, and it's really nice if you have like a GitHub repo. You can just connect to it, and you can just use it in the browser. In the workshop, I'll mainly be using the CLI just because that's what I'm used to, but you can also definitely follow along. Kind of want to talk about here, I'm sure you've heard of it, is Cloud MD. And this is the, the first thing that gets added to our user prompt. We have this little demo here in GitHub. You can clone it if you want. If you have another project running locally that you prefer, that's also completely fine. Um, I do have it open here. Um, I just quickly want to show you just the easiest way to get a Cloud MD file in an already existing project. You may have used it. It's just init. And what init does is Cloud Code behind the scenes, see, it's trying to explore the codebase and understand all your conventions and structures, and then it creates a Cloud MD file based on that. Well, you can basically see it as if you have, feel like you have to repeat something in a prompt multiple times, put it in the Cloud MD file. Question for what model on the init is there any advantage to use an Opus here or would Sonnet do just fine since it's already known? Yeah, I mean, that's kind of how I see it. Everything that it's trying to generate here is stuff that's already in the codebase. It doesn't have to like think critically about like a deeper task that you're trying to ask it. The answer is already here. So using Sonnet here is completely fine. Um, yeah. Okay. So now we can see that it generated our Cloud MD file for us. So I just want to see what it actually generated. So you can see that it, like, talks about the entire project overview. It can see that or it sees the technologies that we've used, all of our commands, the architecture, um, drag and drop, we're using D&D kit, uh, that the data flow, which is very nice, any state management. So all of this is extremely useful for the model to know because if it didn't know this, it might send even more tool calls where it's like, hey, you're, you're asking to add a component to the dashboard, but I don't quite understand where the dashboard is or like what, what other components might depend on that. So in order to reduce the amount of tool calls, this Cloud MD file is very helpful just to give the model even more context. Something that is important to understand is the, um, the usefulness of the Cloud MD file. It kind of depends on the model. I think as models get better, they also get much better at understanding intent. Um, so I feel like a Cloud MD file was very important in our, um, or it still is, but it was especially more important in our prior models like Opus 45, which was very good, but it didn't quite understand intent as much as our newer models do. Um, [snorts] so my overall kind of workflow for Cloud MD is sometimes I just try to remove as much as possible and then see what happens. I, I still just want to see, uh, like where does the model still kind of get tripped. Um, then I'll add it back. But what you should understand is that this, this entire file, it does get added to the assembled prompt, and this also gets added to your context. Meaning if we have a really large Cloud MD file and most of it isn't even used by the model or it's useless, you'll go through your usage much faster. [snorts] Um, you can also see your current context by using context. And this is the context window that a specific model has. So for example, here we can see that we haven't used that many tokens yet. We've used like 21,000 out of a million tokens. Uh, you can use that the system prompt is using some of it. We cannot change that. So we just got to accept that. Later on, we'll see like skills but also our messages, and the messages is what we've sent back and forth to the model. So far, this is only 0.5%. So, so far, it's fine. Um, we'll see a bit more about the plugins and the skills later on. These will also kind of fill the context, but sometimes good to know like, okay, am I adding stuff unnecessarily to the context. Um, yeah, so right now we have our Cloud MD file. But another thing before I want to start kind of implementing the first thing is that we can use plan mode. Um, and I kind of how I see Cloud is just as any other coworker. Like before we start to implement something, you would always ask your coworker like, hey, what do you think about it? How should we do it? What are your thoughts? Uh, again, you kind of become more of the product manager. [snorts] So in Cloud Code, you can either turn on plan mode by heading shift tab in the CLI or like one of those select dropdowns in desktop app or whatever you're using, or you can just ask Claude, 'cause honestly, all that plan mode does is just add a little thing to the prompt being like, don't code anything yet, like you're in plan mode now. You can also just ask it, just prompt it. Um, so I kind of want to start with a quick demo, I guess, because something that I also want to make sure is that it's important to have verification in the loop of Cloud Code. So this simple demo, let me, let me first just start it back up. Um, I'm just going to open a new one. So this is just very ugly. Now again, one shot it with Claude. I made sure that, or I actually asked it, like, just make it ugly, make it nothing special. But it's kind of like a, a to-do list app. Uh, we can just drag it around, things like that. But now if we want to make it prettier, um, like how, how would you ask it that? Like, okay, I want to change the design. What, how can you?

00:10

Speaker A

it to your codebase and your workflows. In this course, we'll be talking about the agentic loop, how your prompt is [music] assembled and what the model actually sees. And then we'll be talking about the features in cloud code and why

00:22

Speaker A

we use them. [music] Claude MDK. Uh before that, I was at Versell and I was at bun. uh bun is the JavaScript runtime that claw code uses. So we got acquired by Anthropic and now I'm in the cloud

00:34

Speaker A

code world at Anthropic. Uh not going to lie, it was a bit scary. I of course don't have an AI background. I did use a lot of claw code like during my time at bun, but I felt like it's such a new

00:44

Speaker A

world. I I felt like kind of an imposttor not knowing how even AI works and I was working on this AI tool. But hopefully in this workshop I want to cover you know some of the fundamentals and as you'll see for cloud code like

00:56

Speaker A

the stuff that we can use like skills and plugins but I also want to go a little bit deeper um just to give you a better like mental model of how cloud code works cuz that always really helps

01:04

Speaker A

for me and I feel like with software engineering that was so much easier to do. It was a bit more deterministic in that way but cloud code is a is a newbie. I want to talk about some of the

01:13

Speaker A

foundational fundamental things that I'm sure if you've worked with cloud code you've already used like clot MD maybe some skills but also sub aents and plugins [snorts] um and as I said a little bit behind the scenes of to give you a better mental

01:26

Speaker A

model and my goal is to kind of have each section build on top of the other one. I feel like it it builds up pretty nicely. Um it's it's easy to just you know get prompting with cloud code but

01:37

Speaker A

not really understanding what's going on. So hopefully that workshop might change yet. But first like what is cloud code for those of you who haven't used it yet. It's not just a CLI. I know most of us are using it in the CLI. Uh but

01:49

Speaker A

really it's an agent that you can use in your terminal but you can also use it in your IDE in VS Code or Jet Brains. Uh you can use it directly in the browser and we also have the cloud desktop app.

01:59

Speaker A

Um the only difference like on our desktop app and of course in the CLI you can run it locally on your device. Um, but you can also use cloud code on the web and it's really nice if you have

02:08

Speaker A

like a GitHub repo. You can just connect to it and you can just use it in the browser. In the workshop, I'll mainly be using the CLI just because that's what I'm used to, but you can also definitely

02:16

Speaker A

follow along. Kind of want to talk about here, I'm sure you've heard of it, is cla MD. And this is the the first thing that gets added to our user prompt. We have this little demo here in GitHub.

02:26

Speaker A

You can clone it if you want. If you have another project running locally that you prefer, that's also completely fine. Um, I do have it open here.

02:37

Speaker A

Um I just quickly want to show you just the easiest way to get a cloudmd file in an already existing project. You may have used it. It's just in it. And what in it does is cloud code behind the

02:50

Speaker A

scenes. See it's trying to explore the codebase and understand all your conventions and structures and then it creates a cloudmd file based on that.

02:58

Speaker A

Well, you can basically see it as if you have feel like you have to repeat something in a prompt multiple times, put it in the cloud MD file.

03:05

Speaker A

Question for what model on the init is there any advantage to use an opus here or would sonnet do just fine since it's already known?

03:12

Speaker A

Yeah, I mean that's kind of kind of how I see it. Everything that it's trying to generate here is stuff that's already in the codebase. It doesn't have to like think critically about like a deeper task that you're trying to ask it. The

03:23

Speaker A

answer is already here. So using Sonnet here is completely fine. Um yeah. Okay. So now we can see that it generated our cloud MD file for us. So I just want to see what it actually generated.

03:35

Speaker A

So you can see that it like talks about the entire project overview. It can see that or it sees the technologies that we've used all of our commands the architecture um drag and drop we're using D&D kit uh

03:49

Speaker A

that the data flow which is very nice any state management. So all of this is extremely useful for the model to know because if it didn't know this, it might send even more tool calls where it's like, hey, you're you're asking to add a

04:04

Speaker A

component to the dashboard, but I don't quite understand where the dashboard is or like what what other components might depend on that. So in order to reduce the amount of tool calls, this cloud MD file is very helpful just to give the

04:16

Speaker A

model even more context. Something that is important to understand is the um the usefulness of the cloud MD file. It kind of depends on the model. I think as models get better, they also get much better at understanding intent. Um so I

04:32

Speaker A

feel like a cloudm file was very important in our um or it still is, but it was especially more important in our prior models like Opus 45, which was very good, but it didn't quite understand intent as much as our newer

04:45

Speaker A

models do. Um, [snorts] so my overall kind of workflow for CloudMD is sometimes I just try to remove as much as possible and then see what happens. I I still just want to see uh like where does the model still kind

04:59

Speaker A

of get tripped. Um, then I'll add it back. But what you should understand is that this this entire file, it does get added to the assembled prompt and this also gets added to your context. Meaning if we have a really large cloud MD file

05:13

Speaker A

and most of it isn't even used by the model or it's useless, you'll go through your usage much faster. [snorts] Um you can also see your current context by using context.

05:25

Speaker A

And this is the context window that a specific model has. So for example here we can see that we haven't used that many tokens yet. We've used like 21,000 out of a million tokens. Uh you can use that the system prompt is using some of

05:37

Speaker A

it. We cannot change that. So we just got to accept that later on we'll see like skills but also our messages and the messages is what we've sent back and forth to the model. So far this is only

05:47

Speaker A

0.5%. So so far it's fine. Um we'll see a bit more about the plugins and the skills later on. These will also kind of fill the context but sometimes good to know like okay am I adding stuff unnecessarily to the context.

06:01

Speaker A

Um yeah so right now we have our cloud MD file. But another thing before I want to start kind of implementing the first thing is that we can use plan mode. Um and I kind of how I see clot is just as

06:14

Speaker A

any other coworker like before we start to implement something you would always ask your coworker like hey what do you think about it? How should we do it?

06:21

Speaker A

What are your thoughts? Uh again you kind of become more of the product manager. [snorts] So in cloud code, you can either turn on plan mode by heading shift tab in the CLI or like one of those select dropdowns in in desktop app

06:32

Speaker A

or whatever you're using or you can just ask claude cuz honestly all that plan mode does is just add a little thing to the prompt being like don't code anything yet like you're in plan mode now. You can also just ask it just

06:43

Speaker A

prompt it. Um, so I kind of want to start with a quick demo, I guess, because something that I also want to make sure is that it's important to have verification in the loop of cloud code. So this simple

06:58

Speaker A

demo, let's me, let me first just start it back up. Um, I'm just going to open a new one.

07:06

Speaker A

So this is just very ugly. Now again, one shot it with Claude. I made sure that or I actually asked it like just make it ugly, make it nothing special.

07:14

Speaker A

But it's kind of like a a to-do list app. Uh we can just drag it around, things like that. But now if we want to make it prettier, um like how how would you ask it that? Like okay, I want to

07:24

Speaker A

change the design. What how can you make sure the cloud understands what you mean by pretty and what it means by design?

07:29

Speaker A

So in this specific case, I've actually used our new Claude AI design. I don't know if you've checked it out yet. It's it's extremely good. So I just asked one prompt. I took a screenshot. I was like, "Hey, make this." Okay. Uh, make this

07:42

Speaker A

beautiful dark mode modern design can cam. It's not even like a good pro cuz I have no design skill. I don't know what to ask it. But clad or claw design, it just created this entire thing which I

07:52

Speaker A

think looks pretty good in in like no time. But now from our cloud code, well, we can either share it in a cloud code session. But what I prefer is if I have a task, we need again verification in

08:04

Speaker A

the loop. And this can be an image, it can be a test, something that it can verify against. Um, so I kind of want to see if I can just export this. Actually, I'm just going to take a screenshot.

08:16

Speaker A

I'm going to present full screen. Take a screenshot. So now in cloud code, I'm going back to this one.

08:27

Speaker A

I'm going to do that. Actually, I'm just going to start a new one just to have a clear.

08:33

Speaker A

So I can just ask it like um I want to implement this design. How would you do that? Like don't code anything yet. Plan first.

08:46

Speaker A

I'm just going to hopefully there's nothing weird. Drop this screenshot in here. So again, this is just a nice part of the verification loop. It it can see the image. It can read the image even though in the CLI nothing will render.

08:58

Speaker A

Yes, Mark. Um what's the strategy for like monor repos if you have multiple projects in one repo which you have like claude MD files yeah so there is like um hierarchy so you can have a root cloudmd file even in

09:14

Speaker A

like your user directory and that cloudmd file will be used for pretty much every project um and then it goes all the way down and it depends on like where you like like initialize cla which file it will use if that makes sense. So

09:28

Speaker A

in our codebase um like the cloud MD file here is in the repo like the the main repo but if I had something like um monor repo one or like this would be like as a subreo and I add a cloud MD

09:40

Speaker A

file here you can also do that but if I like initialize or if I start cloud in this directory it will use this cloud MD file otherwise it will use that it will kind of like move its way up if that

09:50

Speaker A

makes sense. So if you have any project like shared project um settings like definitely just keep it in your in your project ND file but if you have any that you want to keep local you can just add

10:02

Speaker A

them to your to your root like to dash user Lydia cloud MD stuff like that. So right now um it just first add an an implementation plan and right now the the role of software engineering changed from okay writing code to kind of just

10:19

Speaker A

being the reviewer and being the PM. It's like hey does this plan match what we had in mind. So it noticed like oh there are some new fields that can need an issue number some labels priority all all this stuff that honestly I hadn't

10:30

Speaker A

even thought of cuz I just took the screenshot I didn't like oh yeah I guess there's new functionality in there. It needs to add some stuff to the store to actually make this design work. We need some new API routes, new components. It

10:41

Speaker A

all looks good, but if it didn't, I could just go back and forth with Claude here. I could be like like, "Does this match what you had in mind?" Like I could say like, "No, not really." Things like that. Just Yeah, treat it as your

10:53

Speaker A

coworker. Um, [snorts] so just to get hands-on a little bit because I know otherwise it's like kind of theoretical.

10:58

Speaker A

If you want to try this out, if you want to try init and then something with plan mode, have something with verification, you can use this design uh thing if you want. Let's see if I can actually open

11:08

Speaker A

it up and just see how Claude reacts with to you. The thing is like this workshop, okay, all the workshop I've given, it was so deterministic cuz like it was just easy. I had like an exercise and it was always the same. This was

11:18

Speaker A

right, this was wrong. I think everyone's claw code is going to do something different and that's why I'm like just try it out yourself. We'll see what happens. bit of something kind of behavior with cloud MD um and how we can

11:27

Speaker A

guarantee it with permissions but both of these are kind of passive um there's often like a lot of workflows or a lot of steps that we want to take in cloud code and we kind of want to do it

11:39

Speaker A

multiple times um and in that case we can use skills so a skill is just a markdown file with a specific procedure so something you'd otherwise have to like reexplain to claude every time it's just repeat it multi-step

11:54

Speaker A

And in this case, it's just specific to our to our project. So this could be anything like deployment or uh integrations, a Q&A loop, any anything that you want to do multiple times, but you just don't don't want to keep, you

12:07

Speaker A

know, typing the same prompt over and over. So in our or actually before I start typing it myself, a really nice prompt that I like to use is skill creator.

12:20

Speaker A

Um I believe this is built into cloud code. Sometimes I add different plugins to my environment and then I forget whether this was builtin or if I added it. I believe this one is builtin. And this one makes it super easy to add your

12:33

Speaker A

custom skills. So for this one, let's say what skill would you like to have worked on. I might just do like a very simple um like code reviewer skill.

12:46

Speaker A

I don't want it to do too much. I just want to see what it ends up with. Also, what I want to show here is like if you have um a question or an example, the first thing that should come to your

12:55

Speaker A

mind is like has claw code already automated this or do I really have to go into the codebase and code it myself?

13:00

Speaker A

For a lot of these questions, you could just ask claude and let it do it for you. Um so it's kind of like updating your mindset is like how much of my daily life can I claify that way. Uh

13:11

Speaker A

what should it review the simple the current SRC code base? It's asking me too many questions. I forgot which model I'm on now. Which effort level? This feels like Opus max.

13:26

Speaker A

There's always so much like downtime or not downtime but like wait time when it's generating something.

13:31

Speaker A

Uh effort level. Can you manage that at like the um organizational settings to set that for everybody or you can I don't know the exact that's also in I believe that's also in managed settings but yes you can also set the

13:44

Speaker A

max um like the highest it should go. So, if you don't want people on your team to use like max effort, you could you can set that. You have a lot of control as an enterprise over what your

13:54

Speaker A

team members can do and not do within club code. [snorts] Uh, okay. It's It's honestly trying too much. I'm just going to copy this and I'm just going to do it myself. I think we're still in like plan

14:05

Speaker A

mode here. So, we can do that by adding a skills folder. Not skill skills rename.

14:14

Speaker A

And then we add a skill.md. And this is just the expected um like it should be in a skills folder and then skill MD this is what cloud code expects.

14:24

Speaker A

Um so here this is just generated with cloud itself. So like name is review and then it says like description. So review the src codebase of the current project bugs and so on. Um so when we saw or

14:36

Speaker A

when we looked at the assembled prompt you could see that we also sent a list of skills and it had the name and the description. So by default this skill the markdown in this skill is also sent to the prompt but it's only the name and

14:47

Speaker A

the description. So if we had like a lot of markdown here of what the skill should actually do that doesn't matter that's not by default added to our prompt. So also not our usage um that will only be disclosed when the skill is

14:58

Speaker A

actually used and when is the skill used that is based on the description. So if in our prompt we say something like review this codebase and the model's like okay I don't know what to do but I do see that we have a skill called

15:10

Speaker A

review. it might call it um but we can also call it um explicitly as a user. We used to have spec or um separate skills and then we used to have commands. Now we've merged them into one. So skills is

15:23

Speaker A

also commands. [snorts] So just to see honestly I'm not sure if the skill will do very well. But first I'm going to do reload plugins which is required if we've added a new skill just so cloud code understands we've added something

15:35

Speaker A

new. So now we see review and this is the new skill that we've just added. So now we only have to run this instead of typing the entire prompts. Well, I mean this is short but you can imagine this might be

15:48

Speaker A

something a lot bigger. We just have to say this. Um and now it's running this open pull request. Why is it opening a pull request? Oh, maybe because this is the built-in one.

16:02

Speaker A

I'm not sure if like it just overwrote like an existing it did. Okay. Wait, wait. I'm just going to do I'm going to call it code reviewer cuz that one definitely doesn't exist. Okay, you might see that I haven't used manual

16:15

Speaker A

cloud code in a while. Do code reviewer skillmd there. So now it should work. Okay, reload plugins.

16:26

Speaker A

Code reviewer. Okay, so now we have it. So this is our custom skill. And this again could have been anything. Um but right now I just said like, okay, review this code real quick. And the nice thing also is that we have a lot of

16:36

Speaker A

configuration options within a skill. We can also set the model here. So in this case, it's just reviewing code. So I can just tell it always use sonnet. Even though I'm on opus, whenever this specific skill is invoked, I want to use

16:47

Speaker A

sonnet um or haiku in some cases. What's also nice is for example, if we never want our model to review our code, we just want to do it like a slash command, we can also like use disable model

17:01

Speaker A

invocation true. And in this case, by setting that, we're not sending it to the model. We're only keeping it locally. So the model could never invoke this skill, only us using it as a slash command. Um, if we want the opposite, if

17:16

Speaker A

we only ever want the model to uh do it, we can set user invocable false. And I know we honestly this should just be one front matter setting. It's two and they're kind of like negating each other. [snorts] Just accept it for now.

17:29

Speaker A

We might change it. Um, but by doing that, just adding this one, now it's no longer a as a a slash command like we've just run, only the model can do it. Um, so that's kind of how you get more

17:40

Speaker A

control over skills as well. Uh, another thing that's kind of nice is that you can pass arguments to it. Um, and that's just with the normal like arguments um syntax. So maybe if we had a skill like um find I don't know arguments bugs or

17:58

Speaker A

maybe if we had like a deploy skill maybe we could have like deploy and this is like uh deploys our envir or our code base to either staging or production.

18:10

Speaker A

Um yeah, we can use sonnet for that and we can just have like deploy maybe first it's like uh run the tests uh bundle the the app deploy to our environment again nothing is set up so I know when I will ask clut it will be

18:27

Speaker A

like what am I supposed to do there there are no tests and I can't deploy but here you can also say like deploy to for example arguments and now what I can do is if I ran Uh, we're just going to rename this real

18:42

Speaker A

quick. Rename this to deploy. Going to reload plugins. If I run deploy, I can just do like deploy staging for example. And now in our skills, it will always deploy the staging. So, this is I found very useful. You have a lot of control over

19:00

Speaker A

skills. Um, another thing you can do and I didn't add that to the slides, but I do want to show that in uh clock code doc skills. I dude because of CL code my typos have gotten so bad. I don't know

19:13

Speaker A

if I'm the only one but I just don't care about typos anymore and like clot will understand it. It's not it's not good. Um but another thing you can do that I wanted to point out is that you

19:24

Speaker A

can add these um these commands. So you can inject dynamic context and this is incredibly useful. So what happens is that this syntax it will um run this shell command before this skill content as you can see here is sent to claude.

19:41

Speaker A

So if we had like the GitHub CLI installed and we just want to add that to the skill injected before it gets sent this is really nice syntax using your skill if you ever want to like share this with your team stuff like

19:54

Speaker A

that. Super useful. We've also just added a setting that can disallow this because as you can imagine, we're running something. You know, people can install your skill and we're now running random like code on their device. If you

20:08

Speaker A

want to disallow that, that's also that's also a setting. But it's good to know that this is a thing.

20:24

Speaker A

Someone asked me like how I create most skills. Is it manual or is it with a skill creator? I almost always use skill creator. The nice thing also with skill creator that I actually should have shown. Um let's see. I feel like it's

20:36

Speaker A

not going to do very much for this specific skill um for the deploy skill. I'm just going to delete it. But I still want to show it is that you can use skill creator to check if your skill actually makes your

20:50

Speaker A

workflow better. Um when you run this um it will also automatically and it's just not set up correctly now but it will also automatically run evals on your skill. So it will test like okay how does your uh codebase perform with

21:04

Speaker A

and without the skill just to make sure that the skill you've just added will actually improve your code otherwise we're just adding a bunch of extra tokens that we don't want to use. So definitely a very a very useful one

21:16

Speaker A

that that's if you run that skill it'll do eval what skills you've used in that session or is it No no no no so it it will run the skills that you have in your repository um so you can run it on a specific on a

21:27

Speaker A

specific one and that will um it has like a little evo let me just see if I can actually show it in GitHub so this is a skill creator skill either you can just clone our skills repo and then you

21:36

Speaker A

can just like copy paste whatever is in here [snorts] um but yeah so here we have certain like um eval scripts that'll like run alongside your your skills to to see how that how that works. Um, it also

21:49

Speaker A

generates like a little report to tell you uh with like HTML how well the skill works. So check it out. Um, another little report is oh what is it called?

21:58

Speaker A

Um, uh, I always forget this one, but you get a little report of how well you've been doing with clot code. So you can run insights and if you ever want to see how well you're you're doing with cloud

22:09

Speaker A

code, I will I will wait till it's like generated little HTML. This is super useful. It's almost like your MyersBriggs but for claw code. You can see like what you're good at, what you still need to improve, all of that. Um,

22:20

Speaker A

also if you're very new to cloud code, I just want to show you real quick.

22:23

Speaker A

There's also I believe like what's new. I should keep up more with all of the the little commands that we're adding.

22:31

Speaker A

Um, it's a very nice Oh, yeah. Here it's power up. So with power up you kind of onboard yourself with clot. So it's like talk through your codebase. You can like tell it like oh type at anywhere in your

22:44

Speaker A

prompts and it'll like automatically attach a file. Um [snorts] this specific one is actually very useful because if you want claude code sorry I'm like off track now but this one is very useful.

22:54

Speaker A

If you want cloud code to reference a specific file use at in your prompt because that way it already includes it.

23:00

Speaker A

It attaches it in the prompt itself. Like we just saw with our test prompt with like add calcul and utils.ts. It was like where is utils? It wasn't added. So if you have specific files, make sure to at mention it because then

23:13

Speaker A

it's it just reduce or it it removes one tool call like read and write all that.

23:17

Speaker A

Um yeah. Anyway, if you ever feel like you want to you want to teach what's what's up with cloud, use uh use power up. It's actually very nice.

23:25

Speaker A

I believe we also, and I don't know this one, but we just added a new one that will tell you what's what's new in Claude Code ever since you last used it, but I still have to to use that one. Um,

23:35

Speaker A

we also just launched a new Twitter account called Claude Devs if you want to keep up with all that we're shipping.

23:39

Speaker A

And we added what's new to our docs as well. I'm like going completely off track now, but cloud docs.

23:46

Speaker A

So, we just added what's new for every week. So, if you ever feel like, oh, I don't know what's new, um, this is a super easy kind of page to see what else you can now do in in cloud code.

23:56

Speaker A

[snorts] Anyway, back to skills. Yeah. Are there any more questions around skills or how you can configure it or the permission levels with skills?

24:09

Speaker A

Um, one thing I also still want to add is that if in permissions you can also add like allowed tools. So if you and this is almost like permissions per skill. So if you only ever wanted to use

24:21

Speaker A

like um I don't know like bash npm run something you you can add that here as well in your allowed tools. So then it won't add it won't allow anything else.

24:32

Speaker A

Similarly we could we haven't talked about hooks yet but if you want to add specific hooks to your skill so only to that skill you can also have like a hooks array in here and then it would like post tool use all that stuff. But

24:44

Speaker A

this is only if you've already used hooks and you understand it. There's a lot of like configuration you can do within your skill. Um when we talk about sub agents, you can also see how it how you can use context fork in a skill so

24:55

Speaker A

it runs within a sub agent so it doesn't clutter your main context. Um yeah, all of that stuff.

25:02

Speaker A

Yes, Mark. Are skills making a new context or using the main one when using them?

25:08

Speaker A

Uh by default they're using the main one. um unless you use context fork. And this now runs your skill in a sub agent.

25:16

Speaker A

Um and yeah, we'll quickly cover sub aents in a moment, but basically so far everything we've been doing has just been in the main context. So when we uh use a skill and when like this is going back and forth, this is all appended to

25:29

Speaker A

our like user messages like user one, assistant one. If you don't want that, like if you're kind of just like a like getting sidetracked or kind of like a side quest where it's like also quickly do this, um you can instead run a skill in a sub

25:44

Speaker A

agent and a sub agent just runs like parallel kind of to your to your main conversation, but it's a brand new context. Um so in that case like your sub aent will run actually I think we're going to cover sub aents like after

25:56

Speaker A

this. I mean it's it's pretty much the same explanation. Oh, first we have hooks. Um but yeah, in that case the sub agent will run in its own context with that skill and the only thing that your main agent so your main conversation

26:07

Speaker A

gets back is the result. So everything in between all the tool calls and everything that happened that's not added to your conversation. And this can definitely help improve the quality of your of the model output because now the

26:19

Speaker A

context isn't cluttered with like stuff that didn't matter to the original task. Um yeah, if that makes sense.

26:27

Speaker A

Uh so are skills basically tool calls? No, a tool call is different. Um a tool call allows the model to call for a specific um like this is more what a tool call looks like. So this is just the model

26:45

Speaker A

being like hey I need to read something or I need to edit something. Um we can also add to tool calls if you want to.

26:52

Speaker A

You don't have to. Um, so the idea around tool calls is very different. Skills is just for you and like kind of like a more of a user experience thing that you don't have to retype the same prompts. You don't have to like remind

27:07

Speaker A

the model to keep certain things in mind. Whereas a tool call is necessary. Without tool calls, we would not have an agent. We would just have a chatbot that would just respond with text.

27:17

Speaker A

Um, so it's essentially a packaged prompt. Yeah, it's it's just markdown. It's a package prompt. Um, not much else. I mean, I guess the only difference is that, you know, with a prompt, you you're you cannot define like, oh, this

27:31

Speaker A

should run in a sub agent specifically if you haven't like updated your cloud code session before typing that. But yeah, it's it's pretty much just like a repackaged prompt that you can then with plugins share with teammates and with

27:43

Speaker A

anyone in the world. And is there a way to have Claude determine which skill to invoke automatically?

27:51

Speaker A

No. This also really depends on the model. Some models are really good at invoking skills. Others you kind of have to remind them. Um I saw this a bunch myself with Opus 46. I I had a bunch of

28:04

Speaker A

skills and a model just didn't use it. The the important part here is the description. So, as long as our description uh is very I mean like this one isn't too bad but or is pretty bad but like the one that Claude generated

28:18

Speaker A

first. Uh so this is why I even really like using our uh oh you can't see it anymore but our skill creator tool. It will create a description that is super um like precise. I mean I can still let

28:31

Speaker A

me see if I can like skill creator. Maybe it can make a better one for deploy. I feel like it's almost still in Oh, like it's now it's reading the existing deploy skill. Uh so another field that we have in the front matter

28:46

Speaker A

and I have to is um besides description we also have uh skills club code.

29:00

Speaker A

Let's see where is it when to use. And this is even more additional context for claude for when to invoke that skill. So the the description is already really helps the model but this is also more like userf

29:15

Speaker A

facing uh you can see that description when you load it in the CLI but if you want even more precision just for the model and like you don't want to clutter your users with it you can also have the

29:26

Speaker A

when to use field here which helps the model even more to like understand okay we we want to use this skill for this specific task I want to see If it's a demo only stub feel like I'm in the wrong like repo for

29:47

Speaker A

this one. Yeah, it's drafting it again. Yeah, I feel like Okay, I'm just in the wrong like session here, but it's fine. Um, what I wanted to show is just the front matter fields for a skill. they are they

30:01

Speaker A

allow a lot of um like personalization for your skills as well. Um also if we do use the arguments here like we saw with staging and with deploy you can even have like an argument hint here.

30:11

Speaker A

This is just um like CLI facing. So whenever your users are using that skill they might get that little hint uh for example like deploy and then staging or production. Um again yeah what we saw here with disable model invocation and

30:24

Speaker A

then user invocable to you know either make it a a command or what the model can do. Um, you can even add effort levels to skills as well. So, this is all like new because we just effort level levels are still pretty new. Um,

30:39

Speaker A

yeah, skills are again like there's a lot of tweets about how many SAS companies could have been skills and that sounds really sad, but honestly, it's not entirely false. I think skills when you have it set up correctly, they are

30:53

Speaker A

extremely powerful and you do have these repeating workflows that have access to the content that you want to give it.

30:59

Speaker A

Um, so I feel like we've gone more from like prompt engineering to like skill engineering. If you want to be useful in the industry now, create skills that we will that a lot of people can find useful and then share it through

31:11

Speaker A

plugins. Um, cuz yeah, I don't know. I like skills. They're great. And also, yeah, if you want to, these are just again, please read the documentation for skills. There's a lot of really valuable content in here cuz if you want to add

31:26

Speaker A

like a path like you can add like clot skill deer all these little things that make your skills super um like uh configurable and reused about hooks. So everything we've seen so far um it's still kind of in the model and of course

31:40

Speaker A

there was permissions but kind of the model deciding like when something's going to happen. But with hooks almost the same as get hooks, we can run this custom logic at specific points in this agentic loop in the agentic life cycle.

31:54

Speaker A

Uh you don't have to remember all of them but um you can configure this in your settings and you can make sure that a specific event happens at a specific point again in the loop and this could be you can define a prompt or an HTTP

32:08

Speaker A

endpoint or just a shell command doesn't matter. Uh so for example here it's session start fires when you open cloud code user prompt submit you know whenever you press enter. Um but I think the most useful ones are like pre-tool

32:21

Speaker A

use so after the model emits a tool call but before it runs and then post tool use all of that. So pre-tool use for example you can add even more um like details of whether you want that tool to

32:34

Speaker A

run or not cuz like again a tool call could like do a lot in your machine. Um, so if you want to block certain things, hooks are great. Um, I also like post tool use. Maybe after like a specific

32:45

Speaker A

tool succeeds. So again, this could be formatting or linting. There you go. It's a lot of them and we're only adding more I think. Um, yeah, you can see that here session start again when the CLI start then each turn and then this is

32:58

Speaker A

with the agentic loop. So here this is the first time we get some tool call back the permission request that we saw earlier where it's like do we want to do anything whenever the user denies their permission MCP all of that this is

33:11

Speaker A

actually when it executes in your machine um after the tools um has succeeded sub agents if we have any sub agents if it created a task stop. So yeah, we have control over the entire life cycle. Um, and where we can do this

33:25

Speaker A

is, oh, first, yeah, if you want to see which hooks are available, there's this nice little hooks thing. Uh, this doesn't create new hooks for you.

33:37

Speaker A

Honestly, I feel like we should add that here cuz it makes it so much easier, but you don't have to remember all all the hooks just by heart. You can just see them here. And you can also see like

33:46

Speaker A

when it starts if you press enter you just get a bit more information so you get more insights into the hooks that are available.

33:53

Speaker A

Um but you can add a hook in your settings JSON. So for example here we have the permissions that we just added but maybe also like after after post tool use like maybe if um if there was like an edit or write to any

34:09

Speaker A

of our files we want to run just like the run type check. And this is what cla added for me. people want to see. It can just be like this. So again, it's just a very simple prompt with a command bun

34:20

Speaker A

run type check. Um so this is how we can really again personalize and make sure that um claw doesn't do anything that we don't want.

34:30

Speaker A

So I do like let's just try to be a bit hands-on and try first the hooks command. And this in my demo repo has set up like this bun run type check. just try to edit yourself or try to wait find a way

34:44

Speaker A

to add ask Claude to do it. Um, and see what Claude comes up with. Like let's see if you can just ask Claude like hey please create a tool that runs the type check after um you know after a tool use

34:57

Speaker A

or just make it your own. Like how would you have asked Claude and see if something good comes out of that?

35:08

Speaker A

Is there a best practice for sharing hooks across your company? Plugins. Plugins there. Skills, hooks, MCP. So, a plug-in just packages everything. So, also, yeah, the next one here is also in the docs. We have plugins reference. Um, I don't know if

35:24

Speaker A

it's loading or not. So, just to already kind of show you, um, do we have plugins here? I create a plugin. Create plugin here.

35:44

Speaker A

Um, yeah. So, a plugin, we just talk about it real quick, like it is a separate like repo or separate like folder and you can add something called like clot-plugin and this is pretty much almost like what we see in a package.

35:59

Speaker A

JSON like it has the name of your plugin, the version, the author, all that kind of stuff. Um, and in the same directory where your like plugin is, you can add skills and hooks and all of that. Um, and then that would just be

36:12

Speaker A

packaged within that plugin. and to currently to um like publish that to a marketplace. It just has to go through like a form. We don't have like an npm like thing set up. Um but if you want to

36:26

Speaker A

get added to like the the cloud code marketplace, the thing that we saw when we ran like plugins um you yeah you just have to be accepted into the marketplace. I think here we see submit your plugin. So here you can see

36:41

Speaker A

more information about that, but that's still pretty manual. I just wanted to make sure people understand that there's no like distributed kind of system out there yet to to make it easier for for plugins.

36:52

Speaker A

There is uh for skills I know and I think that was like the vers Versel skill thing, the skillsh I think cuz then you can run like npx skills ad which makes it a lot easier to just add

37:05

Speaker A

specific skills over like plugins. And this is like industrywide. So whether you're in CL code or Okay, so now I want to talk a little bit about sub agents.

37:12

Speaker A

Um we've already kind of talked about it before with skills and everything but again everything that we've covered so far has been in the same loop in the same conversation. So every tool result every user message gets appended to that

37:27

Speaker A

to that messages array that we saw in the assembled prompt. Um, and as you can imagine, like the more kind of random content that we have in there, the the less detailed the model can be. You know, it has all these tool call results

37:41

Speaker A

now. It has like random files in there which all kind of deviate from our original task which might have been like just add a button or something.

37:49

Speaker A

So to kind of minimize the amount of like context pollution in that case, we can use sub aents. And just like a quick overview, so a sub agent is a separate loop and it has its own context, its own

38:01

Speaker A

tools, its own system prompt. Um, so the main agent can spawn um a sub agent. Um, and kind of in this just runs in the background in its own little like forked environment and it will only return to

38:15

Speaker A

the main agent with a result. So this makes sure that in the meantime all these tool call results, everything else won't get added to like the main conversation. Um, and you can also spawn them in parallel, which is very nice. So

38:28

Speaker A

you can have multiple processes in parallel. Um, they could be like touching the same file at once and then they just come back with the same result and then the main loop can be like, okay, which ones do I actually want?

38:40

Speaker A

Yeah. Um, yeah, you can see agents with the dash agents uh command as well. Um, we have a couple of built-in ones. I'm just going to run this again.

38:57

Speaker A

agents. So here you can see that we have a couple of built-in ones. Um we have claw code guide which has access to our doc.

39:06

Speaker A

So whenever you ask claw code about claw code it will actually use that sub agent to to know what it's doing. We have explore general purpose plan and then status line setup. So you can see that the explore agent honestly you will find

39:18

Speaker A

that pretty often in your sessions. Um, and you can also see that it's haiku and explorer will just kind of like try to find something in the codebase. There's no reasoning required, so we might as well just use haiku. Um, and it's also

39:29

Speaker A

of course very fast. Um, and yeah, if you're not sure even what what an agent is, each sub agent has its own context, custom system, specific tools, and even like try creating like code reviewer, code simplifier, tech lead, all that

39:43

Speaker A

stuff. So, we can create a new agent just in here as well. Let me see. Create new agent. So where do I want to create this agent? In my project or just personal. So here I'm going to say

39:54

Speaker A

project. If I do personal that just means that this agent will be reused across multiple projects, multiple repositories and so on.

40:02

Speaker A

Um yeah, I'm going to generate it with cloud code. So for example, I want an agent that's like yeah um code write an agent that performs code review.

40:17

Speaker A

and we're [snorts] going to see what it generates. And again, also this could be a skill, but if we just run like a code review skill in the middle of a session and it was a session that initially

40:28

Speaker A

started as like add a button and now we're also doing code review, it just adds so much like clutter to the context that it's sometimes better to have these agents for these kind of one-off tasks that we want to run. Um, so here you can

40:39

Speaker A

even be more like what tools should this agent have to honestly I'm just going to keep it like easy. Sure, this is all good. Which model do we want to use for a code review? Sauna is probably fine.

40:50

Speaker A

Uh, do we want a little color? I just choose pink. Uh, the memory itself. I'm just going to keep that for now. Uh, let's see. Let's Does this look good? So, the description uses agent when code has been written or

41:03

Speaker A

modified. Needs to be reviewed. Yeah. Okay. So, now we have code reviewer. I just want to see what it added to my So now it generated this this agent and as you can see it added a really good

41:17

Speaker A

description cuz it knows that the model might sometimes just need this much to actually have a good agent. So it it has like code reviewers that use this agent when code has been written or modified and needs to be reviewed for quality

41:28

Speaker A

correctness all that kind of stuff. It has the uh sonnet model um the memory itself. I won't talk too much about memory right now, but yeah, might just might as well remove that and then color pink.

41:40

Speaker A

Um, so you can see that it almost like creates a new little system for like you're an expert code reviewer, all that kind of stuff. We wouldn't really do that in a skill too much. Um, but a sub

41:50

Speaker A

agent is really just like its own little little tool that runs alongside it. So let's see if this agent I mean we can also invoke it um manually if you want to with like this syntax uh co- reviewer oh no not that one.

42:13

Speaker A

See co- reviewer agent like analyze code. So now it's launching an agent. Let's see. One second.

42:29

Speaker A

It's always scary to demo this. Oh yeah, now we have it. And it's also using our little pink color if you want to. So now you can see that it's reading all of these things. But again, and even though

42:39

Speaker A

this looks like it's happening in the main thread, it this is not appending to our main conversation like our main messages array if that makes sense. So everything that's happening here, the code reviewer itself here, you can see

42:51

Speaker A

it. It's just like running in that sub agent itself. Only when it gets a result will it go back to the main agent. Um you can also run it in the background if you want. See beep. Then we can go to

43:05

Speaker A

one local agent. You can see it's still running. You can see like the little agent is doing its thing. You can see the amount of tokens is used. All the tool calls.

43:17

Speaker A

So now the code reviewing is just running like nicely in the background. And you can you can keep coding here if you want. So you can just keep going on the main thread or in the main like conversation.

43:29

Speaker A

I kind of want to finish this now to see how it how it performs. If you don't want that, you can use like control X and Crl K to stop any agents if you have to, but I feel like at this point that's

43:38

Speaker A

like so the context is not shared between your main conversation and the agent. No. Um there is another thing called dashfork and in that case with fork um or it's called branch now apparently um we didn't have a conversation yeah but

43:59

Speaker A

if you had like a conversation before and then you do like branch or fork then that will inherit the other conversation but still run in a sub agent if that makes sense. So it still runs in parallel, but by default, sub aents

44:10

Speaker A

don't have that. They get their own custom system prompt from like the main agents that is a summarization of kind of like what the project is and what it needs to do. Um, but it doesn't share the same uh like like messages array as

44:27

Speaker A

the main agent, if that makes sense. So, it's kind of like a customized it. It It still has um like the information that it needs to know for the codebase, but not everything.

44:40

Speaker A

Okay, this this is running. There's a lot of code to review apparently. No. Yeah, try it out yourself. Just try running like agents and ask it uh to I mean, I kind of like this code reviewer one. It was pretty good at good at it.

44:58

Speaker A

Um and then also and just because this is so slow the next thing we could try to find out is if this agent will run automatically and ideally we have that right. So we have that in in the

45:08

Speaker A

description here we say that you know use this agent when code has been written or modified. So in that case the model would need to know like hey okay I I've just modified some code um so I need a sub agent to run. And where does

45:23

Speaker A

how does the model know that we have these sub agents? Well, it also has like agent tool calls.

45:27

Speaker A

So for an agent to run from the model, really what all that is is an agent tool call from the model to the harness. And that is when the harness decides like, okay, I'm going to run this sub agent.

45:42

Speaker A

Is that still running? My goodness. How is it going? How come we can't see the tokens that it's using as it's running.

45:58

Speaker A

You can it's right there. If that was the question. Yeah. So, I mean, of course, like sub agents will also use love tokens and actually sub agents it we've seen this sometimes. Um, let me see if I can use usage. No, it

46:13

Speaker A

doesn't. Okay. Um, we've just added um a new thing actually. I can show share that in what's new uh clock code docs.

46:22

Speaker A

Sub agents use a lot of tokens and sometimes people don't know that they are running sub agents. Um, and that's where a lot of their usage goes. Um, let's see. Oh, yeah. Is it in usage or was it? Oh, I guess it's not merged

46:43

Speaker A

yet. Um, we just tweeted about it. this one. Um, so and you can only really see this like summarization if you've had like a conversation where you could analyze. So that's why it's not working for me because I just started it. But if you

47:02

Speaker A

have a pretty like longgoing session, it can say things like uh you know where did most of my usage go? Well, 98% of your usage was in like four plus sessions ran in parallel. Um, but you can also see does this one say sub

47:14

Speaker A

agents? Yeah, like your usage came from sessions that ran three plus sub agents and then each sub agents runs its own requests, all that kind of stuff. Um, so it's important to like remember that sub agents are very good, but if you are

47:29

Speaker A

kind of like token conscious, you don't want to use too many. Um, sometimes run usage and see if there might be sub aents running in the background that you actually don't want to be running. Also, when you're creating one, make sure that you're

47:42

Speaker A

using the appropriate model for it. Don't just use opus with effort max for a code review. You really don't need that. And opus will opus will do its thing. It loves just going for it, but you are paying for it. So yeah.

47:55

Speaker A

Why do sub agents use a lot of tokens? Is it because they're reestablishing the base context?

48:02

Speaker A

Yeah, pretty much. That's the main thing. Um yeah, because kind of you're almost starting from scratch with less, but you're still starting from scratch.

48:10

Speaker A

So we we don't have any cached prompts at that point. Um yeah, and if you have multiple running, especially without knowing it. Um and you don't know what these sub agents are calling cuz sometimes especially I want to have like sub agents running for

48:25

Speaker A

longer running tasks cuz like I don't want to wait in my main conversation cuz then I'm blocked. So that's also mainly what sub agents are for and it's it's good but just make sure that they aren't running when you don't want them to run.

48:37

Speaker A

especially if um they're easily invoked by the model. Um you know like if in this case you know if the if code has been written or modified it needs to be re reviewed for quality if we didn't add

48:50

Speaker A

maybe this one and needs to be reviewed for quality and I'm just saying something now but like then this code code reviewer might run on every single file edit and unless we like check the CLI or something else to see like oh do

49:03

Speaker A

we see any sub aents running you don't always know. Um, oh here. So now our agent has completed. So again in the main conversation doesn't know much.

49:13

Speaker A

It just gets this this result from the sub agents and then it can do something with it or not. Doesn't matter.

49:20

Speaker A

Is it better to spin up sub agents or multiple sessions or work trees? I'm unsure what are the roles for the differences between sub aents versus sessions versus work trees. Um well a sub agent the nice thing is that it goes

49:35

Speaker A

back to your main conversation. So if it does relate somewhat and you want your main agent to do something with it like for example the code review like this could have been a new session in this specific case it really depends on the

49:46

Speaker A

type of sub agent. Um like I think the nice thing is that you can run so many in parallel within the same session. So part of it might also just be UX or like developer experience or user experience

49:57

Speaker A

is now same I guess. Um, when it comes to get work trees, I don't I know a lot of people use work trees. I I still have to use them too much. Uh, we use them by default in our desktop app and it's kind

50:10

Speaker A

of nice. What I don't like about work trees is that you just have to like So for Yeah, I don't even know how to like explain work trees if you haven't really worked with it. It pretty much just like

50:19

Speaker A

creates a small clone of your of your um your directory in your directory in a different like branch in Git. But that also includes your node modules. So this can be pretty heavy. It has to reinstall all your dependencies every time in a

50:34

Speaker A

work tree. I don't I don't know. I I I don't find the user experience to be that good for a work tree, but maybe I'm missing something. Um I know a lot of people do use work trees. Um but any to

50:45

Speaker A

get back to your point, um I think I I enjoy sub agents over a new session. And well a when it's like a repeatable task like if it's a new session and it might have to run a skill every time I find

50:57

Speaker A

that to be there's more friction there like I'd rather the model decides like okay this should this sub agent could run and then come back to the main thread which we can't do in a main session. Um where I was going earlier is

51:10

Speaker A

I feel like a lot of claw code is also building your own intuition. So, a lot of what I'm teaching here, I'm not trying to be like, "This is best practices. This is what you should do." But I've noticed that a lot of clot is

51:21

Speaker A

really just talking to it, seeing what it's good at, and what works for you.

51:25

Speaker A

And I know that's such an unsatisfying answer, and it's so stupid, but it really has been the case for me, and I feel like it has been the case for many people. The more you use Claude as a

51:34

Speaker A

really friendly co-orker that loves to work and you understand the difference that Opus is like your senior staff researcher MVP engineer that knows everything and really likes to do things and Haiku is more like the intern that's really like really good at repeatable

51:50

Speaker A

tasks. That has just changed my entire mindset towards cloud code. Um, and also often kind of reassessing your setup as I said earlier with cloud MD, but it could also be with skills whenever a new model comes out like like

52:06

Speaker A

I said, we just released Opus 47. Maybe you've noticed that it's better at certain things than others. Um, for example, it is in this specific case with Opus 47, we've noticed that it's much better at following instructions.

52:18

Speaker A

So in your cloud and D5 file what I saw a lot of people do is you know exclamation marks like do not do this like do this exclamation exclamation like just really because like Opus 46 wouldn't always have done that and Opus

52:30

Speaker A

47 does. Um but how would you know like even we don't know like often after a model's been released we're also still kind of like okay how are people using it? what like issues are they running into? Um, so it's unfortunately with a

52:44

Speaker A

lot of cloud code and models, it's also just growing with the product and growing with the models. Um, so yeah, a setup that worked two months ago might still work, it might just not be as efficient. Um, so yeah, a question like,

52:59

Speaker A

oh, should I use sub agents or work trees? I it can depend on so many different things that I unfortunately the answer is it depends and then whatever this is pretty much the same graph that you just saw right

53:12

Speaker A

like the main agent can spawn a sub agent they do some work independently then they get a result and that gets fed back to the main agent we've also recently released agent teams and this is very different let me see if I can

53:26

Speaker A

show you a video from my I created a demo for it at some Right.

53:31

Speaker A

Um, media. Sorry, there's a lot of Oh, yeah. This is agent teams and it's might look very similar, but we have a main agent here and it is running all of these different teammates on the side. Now, you might

53:50

Speaker A

think like, okay, this sounds a lot like sub agents, like the the main thread is launching something, and it's true, but the difference here is that with a teammate, they don't just get spawned from the main agent and then they run

54:04

Speaker A

independently. They actually talk to each other, which is very cute. So, like you can have, for example, a code reviewer, team agent, then you can have an implement agent, and then sometimes like the code reviewer is like, "Oh, I'm

54:15

Speaker A

waiting on the implement agent." And then like they really communicate with each other. they do the work and only when they when uh they have like a shared task list that's like created by the main agent and only when the task

54:27

Speaker A

list is complete which they kind of check every time then they end it. So I don't know if that makes sense as a different mental model. Um sub agents they run independently. If we have multiple parallel sub aents they cannot

54:39

Speaker A

communicate with each other. All we see or all the main thread sees is the final result with agent teams. And you can just enable this by just asking claw code use a team of five agents to run this. Um they really they do communicate

54:53

Speaker A

and then you get kind of this almost like AGI moment. I'm not sure if maybe I can pause it. Um like let's see if we see any so you can see like where messages come from. So like this is a message from

55:07

Speaker A

team lead. Let's build my model now. Um so in that case like the team lead is like the main agent that's really just running as a as a PM to all these like team agents. I can't let's see if I can

55:21

Speaker A

I kept on zooming in when you could like see. Is it kind of the same mental model as like promisedall or something like that?

55:29

Speaker A

Um, sort of. I mean, I guess the main value just comes from the fact that this happens. And of course with promises, they can't like communicate with each other. Um, it's more that um, yeah, I don't know why this arrow is

55:45

Speaker A

broken. We should fix that arrow as well. See that? Um yeah, it's more that with sub agents what we saw is like you can have them in parallel and then either they like yeah wrote to the same file and then we run into like merging

55:58

Speaker A

conflicts all that stuff. With teammates you just have that a lot less and also they can really be specialized so we don't um like with agents okay sorry another thing is that of course an agent is part of like the folder structure

56:12

Speaker A

teammates on the other hand are just kind of like created on the spot. So you can just ask clot like hey create a team of five agents to like um maybe one like VR agent, one implement agent, one UI or

56:23

Speaker A

designer um and then it will just do that for you and it will it will kind of understand what the system prompt to these teammates should be. With sub agents we need like a specific markdown file in in the codebase. Anyway, I just

56:37

Speaker A

wanted to show if you ever hear the the term team agents again for most things it's kind of like too much. This also of course uses a lot of tokens and in most cases a sub agent would do just fine but

56:49

Speaker A

it's a nice little feature like I like you really get the AGI feel when you see like multiple panels will talk to each other and then eventually you get the result. It feels really good and it looks really good but it's yeah depends

57:01

Speaker A

on your implementation I guess. Do you think like if you were to create a team has there been any success in creating almost like a QA teammate to like go and make sure everything is still working cuz I feel like when I've

57:11

Speaker A

built Nex.js JS applications and I'll have something get worked on and then it'll like break something else but it's myself catching it versus I think QA is or QA reviewer thing that is like the most that like used like

57:25

Speaker A

people use skills for that the most. Um, yeah, it's it's a very straightforward one and super nice and also for your specific QA process. Like it's not cuz it's almost like step space, right? It's like it needs to do this and this and

57:34

Speaker A

this. So having a QA skill. Um, yeah, and making sure that that gets invoked after every like change or whatever. Uh, you can even use Haiku for that if you want to, you know, if it's just like a

57:46

Speaker A

specific setup. But yeah, Q&A is perfect for that. with the team agent. I'm just curious, how would you like validate the output of the agent? Because they're checking against each other. Kind of reminds me of like a Oraorus situation.

57:59

Speaker A

Yeah. So, um No, it's a good Would you make another agent or [laughter] [clears throat] Yeah, you just keep going like this forever and then you're out of tokens.

58:07

Speaker A

No, do that. So, I think um No, it's a good question. I think a lot of this again also depends on plan mode. uh make sure that your plan is accurate and then you can still see the shared task list and I think

58:19

Speaker A

that is kind of your main point where it's like do I agree with this task list cuz that's what all the teammates will be running against and making sure that that's accurate. Um the output itself that that's honestly just like any other

58:31

Speaker A

sub agent or any other task like whether you like it or not that depended a lot on what your plan like how much context did you give them before starting this task. Uh and also how much verification did you add to the loop? Like if we talk

58:44

Speaker A

about design, did we add an image? Did we tell it to run against certain tests that we already have? Um so I think when it comes to like verification, that's still just manual, but you definitely set yourself up for success if you have

58:56

Speaker A

more verification in the loop itself. And then you can again check with the share task list. Um yeah, and also if you can if you see teammates going like off the rails, you can of course always like stop them as well individually. Um,

59:09

Speaker A

sometimes your main like team lead will freak out because it's like, "Oh no, my teammate quit." And it's like it's very cute because like it doesn't it's not in the same process, but it does notice that the process quit. Um, also in some

59:22

Speaker A

cases it notices that teammates are too idle and then it would quit them like on his behalf.

59:28

Speaker A

It's very fun to just see that work. It It truly is like a team. Um, but yeah, as you can imagine, for some cases, you don't need a whole team. You just need one good developer, which could be a sub

59:38

Speaker A

agent. Then there's also the Asian SDK. I'm not sure if people are familiar with it, but if you ever want to like use the CL code runtime without using any of our tools or the CLI or anything else. We do

59:48

Speaker A

have the Asian SDK. Um it it's still the same runtime. It's still the clock runtime. Uh runtime being like the runtime against the model. So it can still query. It can still, you know, do everything that we're used to in cloud

60:00

Speaker A

code. You can just programmatically create tools around this. Um you just need uh API key for it.

60:08

Speaker A

So it's pretty nice. Uh agent SDK is also what uh Co-work uses internally. So this is all running the agent SDK. This is also pretty nice. Uh what I really like to use in plan mode um is like

60:23

Speaker A

use like uh wait which repo am I in now? Okay, let me see one. [snorts] Let's just say that I want to add um actually let me go back to demo issue tracker claude. When I'm planning I kind of intentionally ask cla

60:40

Speaker A

to use the ask user question tool. So like I want to create um a system where what do I want to create? Uh where each issue has multiple owners priority and so on. Use the ask user question tool to

60:58

Speaker A

interview me thoroughly. Think about edge cases I may not have thought of yet. There's probably a better way to ask it. But the ask user question tool.

61:08

Speaker A

This is a specific tool call that will, you know, show that. I'm sure you've seen it, but that is like in the UI that shows up like this. This is the ask user question tool, but we also see that in

61:17

Speaker A

the CLI. And to me, this is a really nice way to go back and forth with Claude and really brainstorm your plan with it. Um, especially when you ask it.

61:26

Speaker A

Yeah. So, this is like the use ask user question tool. Um, and it sometimes like it just pops up by on its own, but it doesn't always do that to create a plan.

61:36

Speaker A

So, like which owner should we identify? I don't know. I'm just going to go through it real quick.

61:41

Speaker A

Oh, yeah. Okay. Next. Like, it thinks about a lot of things that I may not not have thought of yet, which I kind of like. UI placement.

61:52

Speaker A

Yeah, sure. chat about this. No, I don't want to do that. Come on. How do I H? Okay, I just escaped it. Well, anyway, I could have submitted it, but I pressed escape and it apparently escapes the whole thing.

62:05

Speaker A

Oh, add a client to answer questions. Um, but yeah, just like this overall this um kind of workflow to plan.

62:11

Speaker A

Whenever you create a plan, ask it to use the ask user question tool is very nice. But you just need to know that this exists, I guess. I mean, I'm sure that if you ask it like ask me about the

62:22

Speaker A

brand like thoroughly about any edge cases, it would just do it naturally as well. But I still like to be intentional to make sure I'm not wasting

Topics: Cloud Code Anthropic AI agent loops prompt assembly Cloud MD file plan mode skills and plugins multi-agent systems AI coding workflow verification loop


---
This is the markdown twin of https://sozai.app/transcript/stop-writing-prompts-claude-code-tutorial/ — the same content, without the markup.
Published by SozAI (https://sozai.app). Reuse and quotation are allowed with attribution and a link back.
Machine-readable index: https://sozai.app/llms.txt · data API: https://sozai.app/api/
