Watch on YouTubePlayPlays from YouTube. Google's privacy policy (opens in a new tab) applies.
Adam explains how Claude combines your instruction files, then has Claude write his own CLAUDE.local.md for the team's project and keep it out of git without touching the shared .gitignore.
What you'll learn
- Claude stitches instructions together: personal (home folder), the project's
CLAUDE.md, andCLAUDE.local.md. CLAUDE.local.mdholds your own preferences for one project.- Good things to put there: your role, "stay in my lane", preview every UI change, generate stress-test data.
.git/info/excludehides files from git just for you, without editing the shared.gitignore; handy for local notes or to-do folders too.- Local instruction files don't come with you into cloud sessions.
- When a personal rule would help everyone, move it to the shared
CLAUDE.md.
Chapters
- 00:00What CLAUDE.local.md is for
- 02:52Asking Claude to write it
- 05:22Keeping it out of git
- 08:26Local rules versus team rules
- 00:00In previous videos, we talked about cloud .md files, a way for you to have all of your agents share the same context or have additional instructions whenever you begin
- 00:13a new session in a particular project folder.
- 00:16So when you add a cloud .md file, Claude Code is going to automatically add this to its own context and it's going to keep that in its own working
- 00:25memory throughout this entire session that you happen to have within a particular folder.
- 00:32We also talked about how you can create your local instructions and you can keep them on your Mac and you can have that Claude .md file in your home
- 00:41directory and when you have it, Claude is basically going to stitch both Claude .md files together, your local one and the one that can be found in your project
- 00:51and it's going to have context from from both sources.
- 00:56What we didn't talk about so far is the fact that you can also create a cloud .local .md file and the name is probably already telling you everything you
- 01:07need to know. So say there are some additional things you wish all of your Claude Code sessions remembered about you or your preferred style of working within a particular
- 01:19project. If that is the case, when you create a cloud .local .md file, Claude Code is going to automatically recognize it and it's going to stitch it together with
- 01:28everything else. So the Claude .md file official for this repo and also your local one.
- 01:35It is a great place to you know, keep things such as I don't know, just restating the fact that you work here as a UI or product designer, that
- 01:48you prefer for Claude agents working with you to stay in your lane and don't really embark on more ambitious or potentially dangerous code changes.
- 01:59Things like after each every new change please open up a preview of this application in my browser because I need to see the UI.
- 02:08Or things like for every new design we create please go back to our local database and create some dummy data so that I can stress test all sorts of
- 02:19scenarios. So all of these things that you wish for Claude Code to remember that you don't really believe would be beneficial for other team members of your team to
- 02:29have, this is a perfect place for them.
- 02:31One thing to note about the local CLAUDE.md file and it's the same as the one we talked about in the other video in your home directory.
- 02:41Your local CLAUDE.md files are not going to stick with you whenever you want to have a conversation or a session in the cloud.
- 02:50So yeah, that's just a thing to remember.
- 02:52What we are going to do in this video is we are going to set up this kind of file and we are going to see how we can later
- 03:00deal with it, okay?
- 03:01So I'm going to start a new session here.
- 03:04Again, making sure I'm in the right folder, I'm working locally.
- 03:07I'm going to keep this on Opus 5.5 and let's see.
- 03:14Claude, I would like you to help me set up my local CLAUDE.md file for this project in which I would like you to remember that I am UI/product
- 03:25designer in this team.
- 03:28I would like you to help me remain in my lane.
- 03:33I don't really want you to suggest work working on anything that is potentially dangerous.
- 03:40I really don't want to be touching any database migrations for now.
- 03:46I need you to spin up a dev server if there isn't one running already so that I can see every UI change you make.
- 03:56And for each UI change I need you to make sure that we have uh dummy data in our local database uh in all shapes and sizes, including ones that
- 04:07are going to allow me to really stress test the UI.
- 04:10So really long names, uh long notes for the reservations and other things things along these lines.
- 04:21Okay. Uh and with that I'm going to hit send, not being, you know, entirely sure that Claude is going to uh recognize this as my request to create a
- 04:32local CLAUDE.md file.
- 04:34Um let's see. It's going to look at how the project is set up.
- 04:38Fair enough. Um and I'm really actually curious uh how Claude is going to interpret uh that request.
- 04:45Let's give it a second.
- 04:49Okay and we are done.
- 04:51And yes, Claude recognized this properly uh or at least just how I imagined it and we now have this new Claude that local that MD files with my own
- 05:01instructions that are local to this folder only.
- 05:05This way I can keep, you know, having my own custom preferences for this particular repo without necessarily polluting my global local CLAUDE.md file in on my Mac.
- 05:17Um one more thing that's worth pointing out here is that this file automatically in this particular repository uh doesn't happen to be git tracked, meaning it is not going
- 05:30to show up as something that we need to commit in order to have it truly preserved for all other conversations.
- 05:37And this is because um it appears to be included in the git ignore file.
- 05:43Uh let's see. Uh-huh uh-huh.
- 05:47Oh, okay. That's interesting.
- 05:49I don't see a line that would exclude this file from git and yet it doesn't show up as something that is going to be committed.
- 05:58Um okay, let me ask a clarifying question.
- 06:02Okay Claude, does this file um let me start it differently.
- 06:09Uh is this file going to be git tracked from now on?
- 06:14And if it isn't, tell me why.
- 06:19Okay, uh and let's see.
- 06:23Okay, this is perfect.
- 06:26Uh I actually wanted to cover this in the next step, but seems like Claude have thought about it already ahead of me.
- 06:32So um in the past, if you were to add a Claude that local .md file, it would be git tracked automatically unless it would unless it was already uh
- 06:43included here in that git ignore file, which isn't really a common thing.
- 06:47Um so really if you wanted to have that, you know, excluded from the git history, and that would be really the only option for you to have that file
- 06:54with you uh when you change branches, when you raise PRs and what not, and not really, you know, having that file go into the remote repository.
- 07:04The only file would be to set up a personal git exclude rule, which is something that Claude added and did over here as it's saying uh in this paragraph.
- 07:14So I added both files to a private ignore uh list that lives inside your copy of the project.
- 07:20So there is a folder, that git folder, which I think we have already seen in one of the previous videos.
- 07:26Um and there is the info/info/exclude um file and the you know um folder and then there is like a like a separate git ignore file that is local to
- 07:39you. And this way you can keep having your like private local stuff in this repository without necessarily excluding them in the file that is shared with anyone else.
- 07:52So this way nobody even knows what you are excluding, which is great in case you want to like create keep creating like your local to-do folders or notes within
- 08:05the project uh folder over here and you don't want to keep committing these files, but you also don't want to be git ignoring them every every time you add
- 08:16something new. This way of like excluding things from git is perfect for this specific occasion.
- 08:23Again, worth calling out one more time that this file is not going to be available to you in your in your remote like cloud sessions with cloud, so be
- 08:34mindful of that. And also one more thing to keep an eye on is that some of the instructions that we keep adding to our local CLAUDE.md files could
- 08:43at some point be also helpful to others.
- 08:47So if we find ourselves, you know, adding rules or instructions that make our UI genuinely better and we wish, you know, other engineers would enjoy from that too, that
- 08:59might be a good moment to consider taking that rule out of your local CLAUDE.md file and putting it is in the official CLAUDE.md file that is shared
- 09:09with everybody else. So that is how you can keep adding or having your local global instructions in a particular in a specific project.
- 09:21In the next video, we are going to unpack a thing that we also have been talking about for a while now, skills.
- 09:27And we are going to talk about how we can like keep using skills that are project specific.
- 09:33So I'll see you there.