Terug naar podcastsClaude
Claude Code 101
Het CLAUDE.md-bestand
[Music starts]
[Music starts]
One of the most useful parts of Claude Code is the claude.md file.
Een van de meest nuttige onderdelen van Claude Code is het CLAUDE.md-bestand.
It gives Claude Code persistent memory about your project.
Het geeft Claude Code een blijvend geheugen over uw project.
When you open up Claude Code without a claude.md file, it's like it has to start fresh every single time.
Als u Claude Code opent zonder een CLAUDE.md-bestand, is het alsof het helemaal opnieuw moet beginnen.
It has to re-explore your codebase, understand what dependencies are needed and the features that are already implemented.
Het moet uw codebase opnieuw verkennen, begrijpen welke afhankelijkheden nodig zijn en welke functies al bestaan.
Sometimes it has to make assumptions which makes it harder for us to steer Claude in the right direction.
Soms moet het aannames doen, wat het voor ons moeilijker maakt om Claude in de juiste richting te sturen.
But that's where claude.md comes in.
Maar daar komt CLAUDE.md van pas.
It's a markdown file that you add to the root of your project and Claude Code reads it automatically every time you start a session.
Het is een Markdown-bestand dat u aan de root van uw project toevoegt en dat Claude Code automatisch leest bij elke sessie.
It's like an onboarding script for your codebase.
Het is als een onboarding-script voor uw codebase.
Simply put, the contents of claude.md file are appended to your own prompt. You can run the /init command which will make Claude generate one based off of your codebase.
Eenvoudig gezegd: de inhoud van het claude.md-bestand wordt aan je prompt toegevoegd. Run /init en Claude maakt er een op basis van je codebase.
So let's have a look at one.
Laten we er een bekijken.
This is a Next.js 15 app using the app router, Tailwind, and Drizzle ORM.
Dit is een Next.js 15-app met App Router, Tailwind en Drizzle ORM.
Commands: dev server, run tests, lint.
Opdrachten: ontwikkelingsserver, tests uitvoeren, lint.
Code style: use two space indentation, prefer named exports, all API routes go in app/api, use server actions instead of API routes where possible.
Codestijl: twee spaties inspringen, benoemde exports, API-routes in app/api, waar mogelijk Server Actions in plaats van API-routes.
And it's pretty straightforward.
En het is vrij eenvoudig.
Now, if I ask Claude Code to create a React component, it knows how to style it with Tailwind or any other CSS framework that I'm using.
Als ik Claude Code vraag een React-component te maken, weet het hoe het te stylen met Tailwind of elk CSS-framework dat ik gebruik.
We can see that Claude does a better job at doing its job right off the bat versus having to understand where everything is at first.
We kunnen zien dat Claude van begin af aan beter werk levert dan voorheen.
And before you ask, the answer is yes.
En voordat u het vraagt, het antwoord is ja.
You share this in your version control for your team to use.
U deelt dit in uw versiebeheer zodat uw team het kan gebruiken.
But there's actually a hierarchy of memory files depending on who it's for.
Maar er is eigenlijk een hiërarchie van geheugenbestanden afhankelijk van voor wie het is.
So first you have your project-level claude.md that lives in the root directory of your project.
Eerst heeft u uw CLAUDE.md op projectniveau dat in de rootdirectory staat.
You have a user-level claude.md that lives in your configuration folder.
U heeft een CLAUDE.md op gebruikersniveau dat in uw configuratiemap staat.
This one is just for you and goes across all your projects.
Deze is alleen voor u en geldt voor al uw projecten.
So put your personal preferences here, like how you write code comments.
Zet hier uw persoonlijke voorkeuren, zoals hoe u code-opmerkingen schrijft.
First, if you have to correct Claude to do something, like always use server actions instead of API routes, then explicitly ask Claude to save this to memory so that when you come back to this project, it will know every single time.
Ten eerste: als je Claude corrigeert, zoals Server Actions in plaats van API-routes, vraag hem dit in het geheugen op te slaan; zo onthoudt hij het bij elk projectbezoek.
Second, if you have docs in your project that you want Claude to reference, just use the @ symbol with the file path.
Ten tweede: voor docs die Claude raadpleegt, gebruik @ met het bestandspad.
And third is we recommend you start off a project without a claude.md file so you can see where you have to constantly course correct the model.
Ten derde: start eerst een project zonder claude.md, zodat je ziet waar je het model steeds moet bijsturen.
This keeps your claude.md file compact and contains only the necessary information that Claude can work with.
Hierdoor blijft uw CLAUDE.md-bestand compact en bevat het alleen de noodzakelijke informatie.
[Music transition]
[Music transition]
The difference between a frustrating Claude Code session and a productive one comes down to the context, and the claude.md file's how you provide that context.
Het verschil tussen een frustrerende Claude Code-sessie en een productieve draait om context, en claude.md is hoe u die context aanlevert.
Start with your stack, your preferences, and then commands, and just build from there as you go.
Begin met uw stack, uw voorkeuren en dan opdrachten, en bouw van daaruit op.