
Lesson Description
The "Project Boundaries & Reference Files" Lesson is part of the full, Cursor & Claude Code: Professional AI Setup course featured in this preview video. Here's what you'd learn in this lesson:
Steve shares tips for specifying project boundaries in the CLAUDE.md file. Reference files with product or feature requirements are discussed, and Steve demonstrates how to leverage a detailed plan while using Claude Code to refactor a messaging feature in the repo.
Transcript from the "Project Boundaries & Reference Files" Lesson
[00:00:00]
>> Steve Kinney: Let's look at like a Cloud MD file that is legit, like the one that I've just been kind of like playing around with, right. Does it really like respond to my threats? I'm not totally sure, right? Am I trying to stop it from doing enterprise fizzbuzz? In a lot of cases, yes.
[00:00:22]
Right, I'm not saying all of this works all the time, but you can kind of see at least like I will learn in public here and show it because a lot of times I'm just trying to spec out does this work at all. And I don't need a full internationalization setup for finding out if this project has any legs.
[00:00:46]
And so some of this is a work in progress to figure out. And honestly some of it is working. Which one? Not entirely sure. But these are the things that actually do truly work. I have another command when we get to commands that I'll show you in a second.
[00:01:04]
I get as many details as I can give it about exactly what I'm doing. Some of this is. And I'll show you I will pull in project requirements, so on and so forth. But go look for if we have a utility function before. [LAUGH] Must have been really angry for doing his technical vandalism to make another function, right?
[00:01:35]
But crawl through repo, only edit files on the ticket. Again, trying to put a lot as possible, right? If a constant is only used by one file, use dependency injection so I can test it easier. There's some. That's an otherwise reasonable looking markdown table about what the rules for a Chrome extension is and what scripts can go where, so on and so forth.
[00:02:01]
But I don't need polyfills for everything because I'm building a Chrome again the more details you can put in here, the better you are to get where I can use service worker stuff, the more details you can give it. I've got the eslint rules that we talked about earlier.
[00:02:16]
This is a project that has my 600 line Eslint config that we were talking on those earlier slides. And you begin to kind of like, I'm trying to figure out the way to message passing. I have not truly figured it out myself just yet, but I have these abstractions so don't use Chrome's because I have this whole retry policy and you begin to kind of over time explain to it what to do.
[00:02:41]
I have this other thing which I can use with local storage where I choose to use lit web components versus svelte components and different concepts and you begin to fully start to explain what you're doing here. And honestly, it seems ridiculous, but I got a lot fewer problems.
[00:03:06]
And here, as you build it up, the other thing I think I said before is you can start to build out these reference files. I said before not only from pulled in docs from the APIs from that context 7 service we saw earlier, so I could have it reference those docs.
[00:03:31]
I can pull in what I'm trying to build and I use this for something I call. I don't know, maybe other people call it. Sometimes we talk a lot about conserving the context window. Sometimes literally this file's existence is. So I can remind you what project we're building.
[00:03:50]
It's like I'm putting this into context on purpose as well as I want to use HAR files so I don't keep hitting the OpenAI, like APIs all the time. I will pull in these markdown files as I need them. And then these are research, and plans that I am literally working on a lot of times.
[00:04:14]
And like when I think they are ready, right, I will reference them like, okay, this is what we're building today and I'll kind of show you, like, here, let's try this. We'll go into Claude. Yes, we've been in here before. Let's just make this biggerize this all the way.
[00:04:39]
There are a few modes in claude, like I said, we have the models and we have that CloudMD file and we can reference any of these files. But we have a few different modes that we can go into. If you hit Shift tab, you can switch from the normal mode where I approve everything to auto accept edits to plan mode.
[00:05:09]
Plan mode, my friends, is the moneymaker. Plan mode is like, let's go through everything and you come up with a plan and we will workshop it together. Plan mode by itself, I will almost always use in CLAUDE code. And this is arguably why I use CLAUDE code more than Cursor right now.
[00:05:28]
Wait until cursor drops. The same feature in a week. But I use this a lot in conjunction with any of these other files I think I was talking about. I haven't decided that I'm going to do TRPC or JSON RPC for messaging or what the gap analysis is.
[00:05:47]
But I will be working on these. So a number of different tools I'll talk about at the end. Let's say we wanted to do TRPC messaging. This is going back and forth and what I have and what I want to do and so what I will do in a lot of these cases I will have these plans or product requirements like this if I wanted to build a color contrast inspector or whatever where I've got these requirements for what I want to build.
[00:06:25]
And in a lot of cases I will also have one do I have it here along with what is the technology stack that I want to do. And I will write out a lot of these plans. Yeah, I'm spending a lot of time in markdown, right? Because arguably coming up with the plan of how it should work again, if we want to do TRPC for communication, whatever, what have you.
[00:06:48]
Working through all this stuff and getting to a plan where I will edit it, I will refine it until I get a place where I like this is a good plan. And then what I will do is I will go into plan mode and I will say let's find that one and product summary and come up with a plan.
[00:07:18]
Again, this plan has got like several hundred lines of markdown on it, right? Come up with a plan to refactor messaging system to use trpc. Okay, so I'm actually going to get to show you a bunch of things all at the same time because I don't know what model I'm on right now.
[00:07:45]
Also copy and pasting out of this box is a pain. So I don't want to do that because it's not like a real UI box. What I'm going to do is I'm going to hit it, but then I'm going to frolicking. That was good. I'm gonna hit Escape which just stops what it's doing.
[00:08:03]
And I can actually interject again where I'm just going to say model is opus. In this case, I can hit up and go back to where it was. What's gonna happen is it's going to now read through that entire plan. It's going to then find the files that were referenced in there it is reading those files and again I'm doing like this part I will do in opus.
[00:08:28]
All right, so check it out. So I had to read the entire thing and before it did anything, I should definitely start a new branch. I can go do that in another terminal window in a second. But you can go ahead and read through its entire plan on what it plans on doing, right?
[00:08:50]
It's gonna install some dependencies. It is gonna say that Zod is already available. It's gonna use Zod V4. Great, it's gonna do this in four. All these LLMs are obsessed with giving you timelines in weeks.
>> Speaker 2: So weird.
>> Steve Kinney: It's like it divides it across four sprints depending on the day.
[00:09:12]
Sometime I'll be like, I will edit it to like phases. Sure. The weak thing I love, I mean maybe it's right. Maybe I have bad expectations, honestly. And so it's gonna tell you the entire plan and what it's going to do. And again, I'm a little hand waving because I'm talking.
[00:09:29]
But read it. And you have two choices at this point, all right. You read through all of this, this is why I love this tool. It comes up with a solid plan. The benefits, the risk mitigation. It's just like, yo, you're gonna have a bundle size increase. I as a team of one who knows TRPC pretty well, that's not gonna keep me up at night.
[00:09:53]
But like, okay, it's gonna have all yada yada yada, no regression performance. We'll see. And then you have this choice or really three choices. No, you can be. It's not like no, start over. No, I'm gonna give you feedback. Or like no, did you think about this or no, please don't pull in that library, right?
[00:10:12]
But part of the reason this plan was so robust is not because Claude is a magical beast. It's because I gave it like a 200 line markdown file that I worked on while I was having it fix lint issues. And that's the nice part is I can think big brain thoughts while I'm not finding out why.
[00:10:30]
I still don't understand how Overflow X works in css. Every time I think I do, I don't, right? And so you can either say yes or you say keep planning. And this is the trick that I do like on a big plan like this when I've written the 200 line markdown file and I know that I have draconian ESLINT rules and pre commit hooks as we talked about and all of these things.
[00:10:59]
And there's a plan and I have git. I can hit yes and auto accept the edits. Because again, check it in. Don't be like me, check it into git. You hit Yes, and here's the move that I will pull because I used OPUS to come up with that plan and I wish there was a better way to do this.
[00:11:16]
I'm gonna hit Enter, I'm gonna hit Escape. I'm gonna switch the model back cause I ain't paying for that back down to Sonic. Cuz I feel pretty good about the plan. Now, the other thing you can do is if I used ultrathink on Opus, like, one would argue the 32,000 tokens, 31,999 tokens of extra reasoning for the plan with OPUS was probably going to be worth the cost, right?
[00:11:49]
So, like, you might consider doing that. I'll talk about, like, ways to, like, automate some of that. At this point, I set the model back to Sonnet and I'll usually just write continue. And then what you're going to see is it's going to make a to do list.
[00:12:03]
Ideally, we lost frolicking. So, yeah, to do list where you can go ahead and you can see the steps it's going to take. Now look at this. Not, look how cool it is. Seriously, look at it. Because occasionally you will see it about to do something where you're like, yo, no, no, no.
[00:12:28]
So at any point you can either say, you can hit Escape. Really, at these checkpoints, you can hit Escape anytime you want and you can interrupt it and it will continue. You won't lose everything that's happening. It will continue. It's asking for permission to run a bash command for bun add.
[00:12:45]
Again, you can choose which ones get auto allowed, which ones get denied. I am tired of installing dependencies on my behalf, so it has to check in with me. So you can go in here and you can hit escape at any point and it'll work through the to do list.
[00:12:57]
But like, look at what it's going to do because again, you don't necessarily need to waste tokens and get reset, so on and so forth, right? So like you, in my experience at least it benefits you to be like, involved in the process. But okay, yeah, this seems legit, manifesting, simmering.
[00:13:15]
And also there's some beautiful ones in there occasionally. And it will start going through this process. And like I said, the nice part about when it breaks into phases, no, they don't take eight to ten weeks or two, three weeks each, but it will check in with you in between each one, right?
[00:13:30]
Which is either A, a great time to be like, yo, you didn't do the thing, or B, make a git commit like I've been saying. And then you can kind of like stop in and check on these plans. So there's a few other things. Let's just check if the slides make use of any of them.
[00:13:49]
A few more rules I just want to cover real quick is understand that you are talking to an LLM that is going to read the file once things that are not going to work Thinking that this is a thing, it doesn't know time. Try to get it to tell you what date it is.
[00:14:13]
Try to get it to generate a uuid. It can't do it, right? So if you say, reread this every 30 minutes, it doesn't know what 30 minutes are and it doesn't know what time it was or anything like that. We'll talk about commands and stuff that you can do.
[00:14:26]
But you need to realize that it is not magic. It is simply a statistical model. And the better your plan is, and the more you feed it in, the better your results are going to be. You can have it a lot of times if it has a long to do list, I'll be like, actually write that to do list to tasks markdown as a markdown checklist and check each one off as you go along.
[00:14:49]
This way, if the contact window gets compacted, the plan is written down somewhere. I know where it was in the plan. I can say, take the last one and do it. I think I told you before. Another thing we tried is having a CSV file with what is approved and not approved to do.
[00:15:05]
And say, read this file and figure out what the next task is and check in with me. The more of that that you give it, the more structure, the better your results will be. You can have multiple Claude MD files. So you know how we said cursor rules, you could target given files.
[00:15:23]
You can't necessarily do it with cloud MD files, but if you put one in source design systemcomponents, if it enters that directory, it will read that file. You can do it upper directory of you have a monorepo. Here's the monorepo rules and in the back end we want to have these rules.
[00:15:41]
Some amount of your architecture and the way you've structured your code also makes some of this either easier or harder.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops