Setup · 9:03
Advanced system prompts
An advanced course from someone running a business on AI agents; system prompts and CLAUDE.md.
- The course comes from heavy daily business use.
- CLAUDE.md is your system prompt.
- Advanced prompts shape every session.
| CLAUDE.md section | Purpose |
|---|---|
| Identity | Who you are |
| Rules | How to work |
| Learnings | What worked/failed |
Do this in your own tools, step by step. Ticks are saved on this device.
What acts as the system prompt?
CLAUDE.md.
What section helps long-term?
Learnings.
0:00 I use Claude code and AI agents in my own business every day to generate over $4 million a year in profit. I also teach around 2,000 people how to use Claude code and other tools to improve their lives, both personally and in business. Okay, so this course is going to assume a foundation of Claude code experience. It's not for total beginners, but if you are a total beginner and you happen to stumble on this course, that's okay.
0:20 Just look over my left shoulder here, click that button and then I have a four-hour guide that will walk you through everything you need to get to the point where you understand what I'm about to say. Assuming you still here, no fluff, here's what we're going to cover. We'll start with an advanced look at Claude.MDs and system prompts, and learn how to optimize these to actually improve quality, which is simpler than you think. We'll then cover agent harnesses and how to build larger projects with Claude code.
0:50 After that, we'll chat agent teams and other examples of extreme task paralization. Then we'll do skills, sub agents, and other forms of organization. After that, I'll cover Carpethi's auto-research approach for improving stuff progressively over time, and if you actual use cases you can apply this to, not just fancy demos. We'll then talk browser automation, the major players. We'll do computer use, browser use, and which tools to apply to different use cases depending on what you want.
1:20 I'll then cover how to deal with performance fluctuations in Claude code, because they do happen, as well as some alternatives that you guys could use and ways to bundle in multi-agent orchestration into your workflow. We'll then cover workspace organization, so for personal, business, and then even client projects, assuming you're selling this sort of thing as a service. Security for larger projects, we'll chat stuff like the recent auto mode. We'll talk a little bit about Oauth. And at the end, I'll finally wrap it out with a discussion about where I think Claude code is going, and the future of work more generally.
1:50 Hope you're as excited as I am to level up your Claude code skills. Please use the bookmarks and chapter headings as needed to jump around the course. Subscribe to the channel, and let's get into it. So for most of the course, I'm going to be building directly using the Claude code extension inside of Anti-gravity. That's this over here. If you don't have Anti-gravity installed, this is an installation tutorial, but get that from Google's official Anti-gravity.google website.
2:30 Then head over to extensions, click on Claude code for VS code. Give that an install. And then everywhere you go, you'll have this little Claude logo that you can use to spin things up. After a brief login, you'll have more or less the exact same layout that I do. I want you to know, though, that the Claude desktop app is also getting better and better by the day. And because Claude is attempting to get you, obviously on their infrastructure as opposed to on your own.
3:00 They're just continuously adding new cool features that allow to do things like mobile development, and so on and so forth. So everything I'm going to show you today works in both the Claude code tab of the Claude desktop app. It also works natively inside of Claude code's extension within Anti-gravity or some other, you know, IDE-like thing. So if you're intimidated at all by the way that I've laid things out, what all these different folders mean, and how they collaborate in order to improve your workflow.
3:30 I'm going to cover all that in this course. First, though, we're going to cover Claude.MD and other advanced system prompts. Basically, how to set up your system prompts in a very efficient and effective way, but the save you. Financially, but also to improve the quality of your outputs and significantly minimize the amount of time it takes to build anything. So what is a Claude.MD really? Well, as far as I could tell, it's four things. The first is, it's a form of knowledge compression.
4:00 Okay. And when I say knowledge compression, what I mean is, instead of Claude having to read through your entire workspace, you know, file by file, like for instance, over here. Instead of it having to open up every single folder here, every single one here, read through all of the files and so on and so forth, to be able to reason and then make high-level declarations about your codebase or folder. What your Claude.MD does, okay, is it basically just compresses all of that down into a highly succinct summary of what the heck is going on in your freaking folder.
4:20 So that the next time you say, hey, what was that file I made a couple of weeks ago about X, Y, and Z? Claude doesn't have to look through every single file in your codebase. You don't have to spend a tremendous amount on tokens, and you also don't have to wait a long time. It's just sort of baked into the Claude.MD or at least a reference to where the file lives is baked into the Claude.MD. And so you can actually like reason with it, um, at a superficial level, at a bird's eye level as opposed to actually going down through the weeds.
4:50 So that's sort of like the very first thing that I'd say, you know, a Claude.MD is. The second thing that a Claude.MD is, is it's obviously your own preferences as a user. And what you'll find is, you know, more or less every time Anthropic updates Claude code, you have better and better baked-in native preferences and conventions for things like, you know, delivering you file paths or how to deal with like documentation or debugging or how to update itself and so on and so forth.
5:30 But obviously, Claude code lags behind these preferences, a little bit, um, because they have to see what users are actually using it for and and, you know, like they collect that information and figure out what ways to make things more effective. So if you're an advanced user, as I am, you'll have a list of these preferences and conventions that improve your user experience. And advanced users will always have just some better preferences that kind of adapt their own workflow, as well as, you know, programming conventions, ways to organize information, structures, and then that sort of thing.
5:50 Okay? So it's both a form of knowledge compression, but it's also preferences and conventions that are not natively baked in that you get to, um, to. the third thing that Cloud and MD is, is it's a declaration of capabilities. Now, I don't know how many times this has happened, but if you do not have a substantiated enough Cloud and MD and then you have, let's say a skill somewhere in your your workplace where you have just some knowledge of sort of floating around and a few files.
5:18 And you say, hey Cloud, do XYZ thing for me. Go, you know, find some knowledge on XYZ person or go do some research or, you know, compile a plan using XYZ framework. Half the time, okay, if it's not in your Cloud and D, Cloud will just look at you, metaphorically obviously, it doesn't have eyes yet. Uh, and it will say like, oh, like I don't have a built-in way to do this. I'm sorry, what were you referring to?
5:40 Do you want me to build something from scratch? I'll happily do it. And this, this sort of slowdown loop is completely unnecessary. And so what Cloud and MD allows you to do is basically allows you to itemize, okay? Uh, you know, everything that your agent can currently do within your workspace. And you can make that really clear. You could say, hey, you currently have access to this functionality. You can do this. Hey, uh, you know, you can build a, a full step plan then last 10 or 15 minutes and then execute it on an autonomous.
6:12 And in fact, that's my, that's my preference or the convention that we're using. You know, you can call this API, you can call this database, you can retrieve all this information. You can act autonomously using browsers and so on and so forth. The reason why that's important is because as agentic as Cloud is, hopefully we're all still on the same page here, um, about this fact, Cloud still lacks a lot of agency, okay? If you ask it to, you know, help you do something or if you ask it how long it'll take to do something.
6:41 It'll often significantly underestimate or overestimate because it's not really factoring in its own agency to capabilities. Like I asked, like the other day, um, hey, you know, how long is would this XYZ thing take to build? And then it was like, about three months or so, because you would have to build this, you'd have to build that, you'd have to build that. And it's obviously like, no, I don't have to build that. I'm asking you to build it.
7:05 You could build it in five seconds. So why don't you just go ahead and do it? Or, you know, you're having it do some API stuff and then it sends you a, a little command line interface prompt and it's like, hey, just prompt this into the terminal. It, it sort of needs reminders that no, I don't have to do this. That's why I'm asking you to do it. So you can actually do all of this stuff, Cloud.
7:28 Declaring capabilities in this way, whether it's through personal, like tooling or workflows or whatever, or it's, um, you know, a Cloud understanding that it has the ability to do things that it might not realize at first glance, is pretty important. And then finally, the fourth thing that a Cloud and MD is, is it's a log of failures and successes. What I mean by this is, as you accumulate various files, as you accumulate, you know, bits of code through your project and stuff like that.
7:55 Every single one of these things is hard won. You didn't get them for free. Realistically, you spent tokens, and then your time, which are soon to be, to the world's most valuable resources. And so, because you've spent all this time and energy, it is more efficient for you to take all of the learnings, basically from every single piece of development or every single action Cloud does. And then insert it into its next system prompt, then just have it restart kind of from scratch every time.
8:23 You know, viewed another way, um, mathematically, if this is the total space of all the different possible things that Cloud could do when you say, hey, do X. What this log of failures and successes is doing is it's basically carving out big chunks of this theoretical solution space. And it's saying, hey, no, you, you don't do anything over here, because we've already tried all this stuff over here. It looks like a planet. Meaning the only things that you can actually try, the only things that you should try are kind of the things that exist in between.
8:55 Okay? So basically what this log of failures and successes does, is it just allows you to immediately cross out like 80% of all possible things Cloud could do, because it knows it's actually tried that in the past. This is exactly what I would do step by step. So first of all, you need to open up a folder. Um, I was just lurking about to Mattias earlier, that is sort of embarrassing. But, uh, anyway, an anti gravity, you just go open recent and then I'm just going to open up something.
6:00 Why don't I do, you know, anti gravity example right over here. And, you know, when I'm in this folder, right over here, obviously there's a bunch of different files and, you know, configurations. This thing was using Gemini for a while. So what I'd like to do next, I'd like to open up a Claude code. And so, uh, click on that button over here, let's close out the agent window because I'm team Claude, at least for the moment.
6:40 Thank you, space invader. And really like the first thing that you do is, you know, you develop on your own. I always recommend just like don't try baking in any opinions into a Claude.md until you've at least developed without a Claude.md or some sort of advanced system prompt for a little bit. And the reason why is because, like, you'll find Claude is actually really good out of the box. As mentioned, they're incorporating more and more of these features natively within it.
7:20 And so like, it's, it's great. It's not like the harness that makes the intelligence. It's obviously the intelligence inside of it. But sort of, you know, communicates with your system prompt to get good. But right now, it's already fantastic. Anyway, after you've done some developing for a while, this is obviously some sort of website here. It's like a template using Vete. Just go slash and it, just like that. And basically slash and it will go through, read every single file in your workspace, which I'm currently doing with fast mode.
8:00 If you're wondering why this is probably faster than then what you're doing. And then at the end of it, it'll come up with basically like a highly optimized Claude.md file. That's the succinctly and effectively summarizes the placement of everything here. Can you can see it just generated one called Claude.md. So comes with the built dev lint commands, note that no test framework exists, some architecture review, key dependencies and their roles, then some style conventions as well.
8:40 So now I'm going to open up this Claude.md, okay, and why don't we just move this over to the main window? So it's a little bit easier to see. And you can see that more or less it, it just at a very high level summary, takes every single line in my entire workspace. That's not very efficient. So parallelization allows us to reduce the total amount of time by a factor of at least a few. From 15 minutes, maybe a couple of minutes, so it'll be able to work on smaller, more, more self-contained things.
6:00 Uh, the two and I'll also just get power quality. Another thing is that many tasks feature independent steps that can be broken down. So for instance, let's say I'm doing some sort of task, okay? And this is just like how long it would normally take if we go serially. And so the option A is just to do what most people do, which is where they'll do, I don't know, they'll do step one, and then they'll do step two, and then they'll do step three, and then they'll do step four.
6:40 So there's one, two, three, four. This task over here takes five minutes. This task over here takes five minutes. This task over here takes five minutes. And this task over here takes five minutes. What's the total amount of time, collectively? Well, it's 20 minutes, right? So that's sort of A, um, you know, the serial way that most other people do things. Well, guess what? Turns out a lot of tasks don't need to necessarily be like that.
7:20 If I just copied all of this stuff over, okay? And then instead, ran a couple of these in parallel. So I actually had, uh, I don't know, three of these simultaneously, and then kind of combined all of them. If I did something, maybe more akin to this, instead, hopefully you guys could see. Um, now, okay, instead of everything taking, you know, five minutes, five minutes, five minutes, and five minutes. Maybe what I'm capable of doing realistically is this takes five minutes.
8:10 This takes five minutes, and then the integration step of all these three, which were two, three and four. But really, the fourth and final reason is because model performance degrades as context increases. So the shorter and the cleaner your context windows are, typically the better the results are as well. What I mean by this is, you know, because the parallelization aspect typically involves sub-agents, which I'm going to show you guys a little bit about, you get to avoid the problem where the increasing length, number of tokens, um, leads to poor performance.
6:28 And so, you know, if like on average, or this is more or less the relationship between the number of things in your context window and then the performance of the model, we're gonna, we're gonna end up just almost always staying right around here. Which is the zone of good. By the way, I just made that up, it's not actually called the zone of good. Hopefully you guys understand the distinctions there though. Um, when you parallelize and then feed tiny chunks of a problem to multiple agents, they can all be at the zone of good.
6:50 You don't actually have to like go all the way down here. It's not just one agent that's doing all the work. Okay, so, so what are examples of how to parallelize in the first place? Well, there's like a built-in function called Agent Teams now in Cloud code, which does a fair amount of this. So I'm going to be showing you guys some ways to do that. But I just wanted to chat a little bit more generally without even going into Agent Teams first before I show you some demos.
7:40 Um, of like Next, I want to chat debate and stochastic consensus because it's kind of simpler, similar, but um, you know, it's also a little bit different. These debate and stochastic consensus to basically like hammer out nuanced arguments and nuanced quality discussions. You know, earlier how I said we had one agent come up with ABC, another one come up with CDE. Another one come up with like ABQ and so on and so forth. Well, basically with stochastic consensus, and then later debate, what we're doing is we're having different sub agents come up with different, um, lists of solutions.
6:24 And then we have something else go through, identify all of the mode. Identify the mode, which is the frequency of, you know, the number of times that a solution pops up. So let's say solution A pops up twice. Okay, this synthesizer agent would say, okay, there's two A's. Uh, B pops up twice, so we'd go to B. C pops up twice, so we go to C. D pops up, how many times? One, so we'd go D.
7:06 Then counts E, and it also counts Q. And so in this way, you could see statistically speaking, uh, you know, a lot of agents think these three are great solutions. One agent thought this was a good solution. Another agent thought this was a good solution. And finally, another agent thought this was a good solution. Basically, the votes of confidence here are fewer. And then what you can do is you can use this. This is almost like um, like a weighted average to tell you what approach to take.
7:49 You know, if it's like an equation where like my final, uh, I don't know, decision, which we'll just say decision is kind of like this, it would equal to A plus two B plus two C plus D plus E plus Q. And I know this is math, but don't get scared here. The the point is not to actually calculate the final solution. The reality that I'm attempting to convey to you is that because so many models came up with A.
5:32 But the idea is, you know, one is a conservative, tradition-minded chef. The other is an adventurous boundary-pushing chef. The other challenges conventional wisdom, the other reasons from first principles and so on and so on and so forth. Now, because, you know, it's a pretty simple and not very intellectually difficult exercise, all 10 agents have actually already already finished. And you can see that. With the ability to modify colors, we have 1X, 2X, and then 4X downloads, which I don't think you guys could see because my face is in the way.
5:40 But if you just, um, look down over here, you can see that there's significantly more functionality. Um, we can download a PNG at 4X as well. We have simple like space bars to reload and change things. We could change the the speed and so on and so forth. Um, ultimately this is just a better app, right? And so we did this by basically just exchanging a couple of my dollars in tokens for, you know, a bunch of different agents, all coming up with their own ideas and then ultimately executing on them.
6:20 Hopefully you guys could see you can apply the same approach to more or less anything. There are obviously optimal token tradeoffs, but, um, when you spawn the sub agents that are a little bit less capable, um, like Sonnet versus. Capitalized as called an MD. These are actually just two flavors of the exact same thing. What they are is they're just different ways of organizing your markdown files. And so, just like in my case, we ran a model dash chat skill earlier for me to show you guys how, you know, models debate and stuff like that.
5:54 Okay? We had a skill.md within it that stored a bunch of information that was like hyper specific to that skill. We had model dash chat.py, which was a tool that this skill could use. So too are sub agents organizing basically the same way. I guess what I'm trying to say is like, okay, if we take sub agents on the left hand side. What was one of the main reasons why we like using sub agents? Okay? It's because it's a clear or fresh context window, right?
6:33 All right, awesome. So that's one. How about the fact that it's specialized? Awesome, that's another. How about the fact that the sub agent is probably more reliable at sub agent specific tasks, right? That's another one. And then how about the fact that it's written in, you know, markdown format. With tool use. Well, fantastic. That's another one. If we look at like how that equates to skills, honestly, the only thing that's missing is the fact that the context window is not entirely clear or fresh.
5:36 The point that I'm making is, obviously we're being pragmatic here. Like you should probably predominantly use the best model out there because, you know, it's not like, it's not like, uh, it's not a linear thing. If a model is like 1% better than another model, that 1% once you get smart enough is like the difference if like a gulf, right? Einstein is like 1% smarter than a, uh, a normal human being or something like that. And he was able to come up with the theory of relativity or something something along those lines.
6:06 Obviously don't take me at face value there. I'm sure his IQ is through the roof. But the point that I'm making is like when you get to this point with these weird galactic intelligence, even like a small little increase in the, the intelligence, the model might lead to like a big downsized difference, right? So, if you have the ability to use the best model, just use the best model. Just use the best model. But don't put all your eggs in that basket because if that occurs, then what'll basically happen is like as the performance of Claude over time, goes up assuming Claude is orange.
6:47 Your total productivity in blue here, will also go up, basically in lock step. And so if the performance of Claude goes down, so too is your entire productivity. If the performance of Claude goes up, so too does your entire productivity. Instead, diversify. Okay, so that's number one, right? Number two is you can use something like, um, MCP servers to distribute your load across multiple different models. So for instance, there's this Codex MCP server, which, you know, technically lives in cloud codes.
5:50 So if cloud code does go down or something like that, you won't necessarily be able to use it. Keep that in mind. Um, but, you know, if it's just one of the cloud models or whatever, it's a little bit different. Basically what you do is you download an MCP server that allows you to communicate back and forth with Codex. And so that one's a very straightforward and easy. There's there's a get repository right over here. It's very straightforward.
6:17 All you do is you literally just like install the Codex CLI, okay, using NPM I-G at open as slash Codex. And then you just give it your open AI API key. Then you just add it to cloud code, then you can actually just like have a conversation with them. So for simplicity's sake, I'm actually just going to do that because that's a lot faster. I'm just going to go back to my antigravity instance or just right over here.
6:48 You can see I got a search back a little while ago from something that I was working on. I'm just going to open this up and I'll say, install this. I'll say keys in.env. Don't share. This is a demo. Let me know when done, so I can restart. And what it'll go through is it'll go and install the Codex MCP server. And then I can just go here and I can say, hey, ask Codex, how it's going.
7:28 So now what it's going to do is, is rather than just, you know, kind of operating on its own thread. It'll literally just run through like a thing, pinging Codex and saying, hey man, what's going on? It echoed back the message successfully. Dub video links, CA dentist, auto research, Hindi source, you know, when I was dubbing my stuff, bunch of different, um, screenshots and stuff like that. You want to periodically clean up this workspace. So you periodically want to say something along the lines of, hey, clean up my active slash folder.
6:10 Anything in the sub folders are fine, but anything that's just loosely in the in the folder, like any text files, PY files, JPEGs and related. I want you to clean up by either deciding if it's necessary, if it's just a temp file, just get rid of it. Otherwise, store it in a folder that makes sense. You're going to want to run something like this reasonably often. Um, the reason why is because you just don't want to have to, you know, scroll again through like a quadrillion different things.
7:00 And you also want to make sure that any future model that comes around can just like very logically look at some sort of organizational hierarchy and then make decisions based off of that. So that's what's going on here with all these docs for I closed, right? It's deciding what to do here. It's going to download them into different folders. This is actually going to get rid of a couple files here. Like hey, this is a file, this is an incomplete download.
8:00 This is a bunch of unnamed temp snapshots, right? And and what you'll find is within like two seconds, it just does the whole thing. So now my active folder is much, much cleaner and I don't have to worry about this sort of thing, um, ever again, which is nice. Um, and you know, in my case, I also have a couple of these web design projects. Enumerate all the web design projects in active. Um, these are things like Volta, Aura, and so on and so forth.
5:33 Because you also don't want that implementer agent to be biased by the security audit, kind of overly constrained nature of it. So in that case, you can use a sub agent or some other model itself, like Codex, Gemini or whatever. And then, you know, ultimately you can have it reviewed by Claude because I think Claude is the best model. But in this way, you're basically like diversifying. Similarly, how we were diversifying by putting seven out of 10 of our eggs in the Claude basket, but three out of the 10, you know, spread across other models.
5:56 You're diversifying against any sort of inherent risk or bias that Claude has, uh, to work that is generated by other Claudes versus, you know, Codex or Gemini or whatnot. So the best solution would actually involve multiple runs through all of them. Okay, hopefully that makes sense. I mean, I didn't want this to be a big deal. Obviously, security, as mentioned, is only a as big of a deal as you are willing to make it because of pre-existing assets and what you have to risk and stuff like that.
6:32 So if you just understand
Get the other 14 chapters, the exam and your certificate for LinkedIn, plus all 700+ AI courses.