Volver a PodcastsClaude
Claude Code 101
El archivo CLAUDE.md
[Music starts]
[Music starts]
One of the most useful parts of Claude Code is the claude.md file.
Una de las partes mas utiles de Claude Code es el archivo CLAUDE.md.
It gives Claude Code persistent memory about your project.
Le da a Claude Code memoria persistente sobre tu proyecto.
When you open up Claude Code without a claude.md file, it's like it has to start fresh every single time.
Cuando abres Claude Code sin un archivo CLAUDE.md, es como si tuviera que empezar de cero.
It has to re-explore your codebase, understand what dependencies are needed and the features that are already implemented.
Tiene que volver a explorar la base de código, entender qué dependencias se necesitan y las funciones implementadas.
Sometimes it has to make assumptions which makes it harder for us to steer Claude in the right direction.
A veces tiene que hacer suposiciones, lo que hace mas dificil para nosotros guiar a Claude en la direccion correcta.
But that's where claude.md comes in.
Pero ahi es donde entra CLAUDE.md.
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.
Es un archivo Markdown en la raíz del proyecto que Claude Code lee automáticamente al iniciar cada sesión.
It's like an onboarding script for your codebase.
Es como un script de incorporacion para tu base de codigo.
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.
En pocas palabras, el contenido del archivo claude.md se añade a tu propio prompt. Puedes ejecutar /init y Claude generará uno basado en tu codebase.
So let's have a look at one.
Veamos uno.
This is a Next.js 15 app using the app router, Tailwind, and Drizzle ORM.
Esta es una aplicacion Next.js 15 que usa App Router, Tailwind y Drizzle ORM.
Commands: dev server, run tests, lint.
Comandos: servidor de desarrollo, ejecutar pruebas, 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.
Estilo de código: dos espacios de indentación, exports con nombre, rutas API en app/api; preferir Server Actions a rutas API.
And it's pretty straightforward.
Y es bastante sencillo.
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.
Ahora, si le pido a Claude Code crear un componente React, sabe cómo estilizarlo con Tailwind u otro framework CSS que use.
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.
Podemos ver que Claude hace un mejor trabajo desde el principio, en comparación con tener que entender primero dónde está todo.
And before you ask, the answer is yes.
Y antes de que preguntes, la respuesta es si.
You share this in your version control for your team to use.
Compartes esto en tu control de versiones para que tu equipo lo use.
But there's actually a hierarchy of memory files depending on who it's for.
Pero en realidad hay una jerarquia de archivos de memoria segun para quien es.
So first you have your project-level claude.md that lives in the root directory of your project.
Primero tienes tu CLAUDE.md a nivel de proyecto que vive en el directorio raiz.
You have a user-level claude.md that lives in your configuration folder.
Tienes un CLAUDE.md a nivel de usuario que vive en tu carpeta de configuracion.
This one is just for you and goes across all your projects.
Este es solo para ti y se aplica a todos tus proyectos.
So put your personal preferences here, like how you write code comments.
Pon aquí tus preferencias personales, como la forma en que escribes comentarios de código.
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.
Primero: si debes corregir a Claude, como usar siempre Server Actions en vez de rutas API, pídele guardar esto en memoria; así lo recordará cada vez que vuelvas al proyecto.
Second, if you have docs in your project that you want Claude to reference, just use the @ symbol with the file path.
Segundo: para docs que Claude debe consultar, usa el símbolo @ con la ruta del archivo.
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.
Tercero: empieza un proyecto sin claude.md, así verás dónde tienes que corregir constantemente el modelo.
This keeps your claude.md file compact and contains only the necessary information that Claude can work with.
Esto mantiene tu archivo CLAUDE.md compacto y contiene solo la informacion necesaria.
[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.
La diferencia entre una sesión de Claude Code frustrante y una productiva depende del contexto, y el archivo claude.md es cómo proporcionas ese contexto.
Start with your stack, your preferences, and then commands, and just build from there as you go.
Empieza con tu stack, tus preferencias y luego los comandos, y construye desde ahi.