[00:01] little time to talk about my approach to software development using Cloud Code. And in the past two or three weeks, I think I've spent around 70 million tokens using Cloud Code. So, I've learned quite a few things that work for [00:15] me, and I want to share my workflow with you in this video. Here's my Cloud Code desktop, where you can see my token spend starting from June 4th, which is when I started using this. Today is June 22nd, so I've been using it for almost [00:28] three weeks. And that time, I've spent around 70 million tokens, give or take. Now, I've been using the $100 plan, which I believe is called 5x Max. I was on the 20x plan for a little while while Fable was available, but they took it [00:42] continuing on that plan, so I downgraded. Now, you can see some days were more useful than others, but in the past couple of days, I think I've dialed down the approach that works really well and produces good results for me. Here's [00:56] the workflow that I apply when using Cloud Code. So, number one, you need an idea. What are you going to work on, or what are you going to build? So, as I said, I start with an idea, and the first thing I want to do is produce a [01:10] design document. So, this just contains the high-level description of what I want to build in a little more technical detail. So, here I would define things like architecture, code style, and quality constraints, maybe infra [01:23] components if I'm adding something new to the system. We could also talk about the deployment approach, and whatever else I think is necessary to fulfill the design that I want to achieve. So, once we've got our high-level definition in [01:36] place, we can then take that and use it to break down our high-level feature into smaller subtasks. So, let's say we've got a couple of subtasks here, and these are my actual work units that I'm going to hand off to the agent. Now, [01:51] what I figured out that works really well for me is to hand off each of these well for me is to hand off each of these subtasks to a coding agent in a separate session. So now this becomes one session and I just expand across how many tasks [02:05] isn't all too different from how you would lead a software development team in the real world. So I'm effectively just replicating what already works in the real world using agents except with this our feedback loop is a lot faster [02:19] as we can produce a large amount of code in very short amount of time. Now this is also where I want on how you can actually rein in the AI and stop it from producing slop because it's very easy to fall into this trap of [02:32] because you're generating a large amount of code. That's very far from the truth. Now I do want to comment on how I actually get the agents to work on something until it's done and this is by using the goal command in Cloud Code. [02:48] Now I think this is an implementation of what's called a loop although there's also a loop command. It's all a bit confusing. Nonetheless, when I give it a goal, it's going to continue working on this until it satisfies the goal. This [03:00] is where you can actually make it produce the desired result. So what you produce the desired result. So what you do is you take your task description and feed it to the goal command and then it's really important that you come up [03:12] depending on your use case, these constraints can vary. What I do is tell the agent to work in a separate kit work tree. This is basically a copy of your repo on the file system. And then the agents can work in parallel on separate [03:27] resource intensive but it allows you to parallelize the work as much as possible. Now what I also tell it to do is write tests and make sure they pass and when everything's done, I want it to create a pull request that I can then [03:41] now have a lot of pull requests to review and make sure that everything is in order. Of course, if I'm working on something mission critical, I definitely want to go in and actually debug code, but if it's something trivial that I've [03:55] done myself dozens of time before, I'm going to just review the code and make place to be sure that this is working correctly. Now, a couple of trade-offs that you're going to make with this approach is code quality is going to [04:09] this is something that you are okay with. The benefit being that you're now able to iterate much faster and produce working solutions in less time. This also doesn't mean we're going to produce bad code, what people would call slop. [04:23] It's just that AI-generated code tends to be more on the verbose side, and if you don't spend quite a bit of time reeling it in and telling it to remove unnecessary parts, you're going to end up with a code base that's quite [04:35] verbose, full of comments, with possibly many unnecessary abstractions, for example, interfaces with just a single implementation that don't really do much except help unit testing using mocks, which in my opinion is not that valuable [04:47] where it's most critical use cases. Now, this entire approach can be described with a single word that I'm going to just call token maxing. I totally did used dozens of times, but it's effectively what I'm trying to achieve [05:02] here. I want to use the maximum number of tokens that's available to me while also one of the reasons why I've been less active on YouTube than usual. I've been working on a big project, as you can see by the token spend, that I hope [05:16] to talk about more in the coming weeks. I also became a dad past month, so sleep is now scarce, and finding time to work is even more difficult. And as you can apartments, and I'm still setting up the new studio. A lot of things going on at [05:30] the same time, and not enough time to work on videos. And hopefully, all of this gets better sooner rather than later. Now, I mentioned that this usage is subsidized. And I actually took my token spend and gave it to ChatGPT. I [05:44] didn't want to give it to Claude on purpose just to see what ChatGPT is going to tell me. And it took the input and output token costs from Anthropic's documentation. Now, these are API costs, mind you, and I'm using a subscription, [05:56] which is subsidized. And it came up with the figure of about $1,850 of token spent in the past 3 weeks. Now, mind you, I'm paying $100 a month, give or take, to get this much in token spent. And I'm not even maximizing my [06:10] only figured out how to properly do this in the past couple of days. Just to give you a reference, I've managed to use up about 75% of my weekly limit, which is in the past two cycles. So, this time around, I'm really leaning into it and [06:26] just trying to maximize my token usage on the 5x plan on Claude code. I've explained my high-level workflow. What about some low-level details? For example, some people are going to ask, "What about Claude skills?" I started [06:38] out not using them. After a week or so on working on this project, I just asked the agent, "What are some repetitive tasks that I keep asking you to do, and think that's how you produce actually useful skills. You figure out the pain [06:51] points while you work and turn those into repeatable skills that the agents can use. I also did not have a Claude MD or an Agents MD present when I started working on this. This is also something I asked Claude to generate for me. And [07:05] one thing that Claude also has is hooks. I wasn't aware of this, and it's something that it suggested I should add. And I'm using it just to run some extra heavy tests before every command, and this is coming in handy because it's [07:18] Actions because I was running into timeouts and resource issues with running so many agents in parallel. Now, another problem you're going to run into when using this workflow, and to give you an idea, I usually have like five to [07:31] 10 agents running in parallel working on different aspects of my code base. And one roadblock that I hit was the available RAM on my system. It turns out that coding agents are incredibly resource hungry. And right now I've got [07:43] 32 GB of RAM, and this forced me to do perform an upgrade. I opted for two 32 GB sticks, which is going to double my effective RAM, and you really don't want to know how much I spent on these. Like, the prices of RAM are basically insane. [07:57] What I can tell you is that the 32 GB that I bought, I think, 4 years ago, are now worth double the amount that I paid at the time, which is unheard of in the guess this is the sign of the times that we are living in. Also, here's what it [08:12] looks like when I get a bunch of results from my coding agents as pull requests that I now have to sit down and review. I think this is about nine or 10 pull by one, and almost all of these are based on some documentation I had wrote [08:28] the baseline to produce the actual pull request. Now, as I already mentioned, I got nearly $2,000 of usage out of a $100-a-month plan. And I don't think this is going to last for a while. We already lost GitHub Copilot subsidies, [08:43] and sooner or later the other providers going to have to follow. So, some people are exploring things like self-hosting large language models, and currently there's a popular DGX Spark machine, which is selling for almost $5,000, and [08:56] you can run some local models on here. But, in my opinion, this is currently not worth it, even with all the subsidies in place, because $5,000 is almost 2 years of cloud code usage on the 20X Max, which is $200 And don't [09:10] expect you're going to be running anything close to Opus or Fable level models, and even then, your local models are going to be just incredibly slow and actually be exploring this path? Well, as I said, privacy is a big concern when [09:25] using AI from popular providers, and running local models gives you a lot of autonomy, and obviously full control over where your data ends up. Now, to actually to able to run something useful in terms of a coding agent and then [09:38] scale that across a team, you're looking at a big spending bill to make that million or a million dollars to build a small data center, but you definitely need to spend multiple tens of thousands of dollars on hardware to be able to run [09:52] these models locally. Now, take all that with a grain of salt as I haven't really been into the self-hosting space, which is something I'm going to explore and make videos on. I'll all of that in due time. My conclusion is that with the [10:04] taking into account the subsidies, the cost of hardware, and the local models that we have available, it's still not worth it, at least to me. I'll be exploring this avenue, but I definitely think you should not be closing the door [10:18] privacy and owning your data. Hope that at least something I shared today with you is valuable and you can maybe use it in your own work. I'm definitely late to agents, so I'm still learning things [10:32] myself as I go and I'm going to be sharing them here with you as I gain more insights. If you found this video valuable, go ahead and smash the like button right below. Thanks a lot for watching. I really appreciate it and [10:44] watching. I really appreciate it and until next time, stay awesome.