팟캐스트로 돌아가기Claude
Claude Code 101
The CLAUDE.md file
[Music starts]
[Music starts]
One of the most useful parts of Claude Code is the claude.md file.
Claude Code에서 가장 유용한 기능 중 하나는 CLAUDE.md 파일입니다.
It gives Claude Code persistent memory about your project.
이를 통해 Claude Code는 프로젝트에 대한 지속적인 메모리를 가질 수 있습니다.
When you open up Claude Code without a claude.md file, it's like it has to start fresh every single time.
CLAUDE.md 파일 없이 Claude Code를 열면 매번 처음부터 시작해야 하는 것과 같습니다.
It has to re-explore your codebase, understand what dependencies are needed and the features that are already implemented.
코드베이스를 다시 탐색하고, 필요한 의존성과 이미 구현된 기능들을 파악해야 합니다.
Sometimes it has to make assumptions which makes it harder for us to steer Claude in the right direction.
때로는 가정을 해야 해서 Claude를 올바른 방향으로 이끌기가 어려워집니다.
But that's where claude.md comes in.
바로 그럴 때 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.
프로젝트 루트에 추가하는 Markdown 파일로, 세션을 시작할 때마다 Claude Code가 자동으로 읽어 들입니다.
It's like an onboarding script for your 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.
간단히 말해, claude.md 파일의 내용은 여러분의 프롬프트에 추가됩니다. /init 명령을 실행하면 Claude가 코드베이스를 기반으로 생성해 줍니다.
So let's have a look at one.
그럼 하나를 살펴보겠습니다.
This is a Next.js 15 app using the app router, Tailwind, and Drizzle ORM.
이것은 App Router, Tailwind, Drizzle ORM을 사용하는 Next.js 15 앱입니다.
Commands: dev server, run tests, lint.
명령어: 개발 서버, 테스트 실행, 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.
코드 스타일: 2칸 들여쓰기, 명명된 export 우선, API 라우트는 app/api 아래, 가능하면 API 라우트 대신 Server Actions 사용.
And it's pretty straightforward.
아주 간단합니다.
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.
이제 Claude Code에 React 컴포넌트 생성을 요청하면 Tailwind 등 제가 쓰는 CSS 프레임워크로 스타일링하는 방법을 알고 있습니다.
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.
Claude가 처음에 모든 것을 이해해야 하는 것과 달리, 바로 더 나은 성능을 보이는 것을 확인할 수 있습니다.
And before you ask, the answer is yes.
물어보기 전에 미리 말씀드리면, 답은 예스입니다.
You share this in your version control for your team to use.
팀이 사용할 수 있도록 버전 관리에 공유할 수 있습니다.
But there's actually a hierarchy of memory files depending on who it's for.
실제로는 누구를 위한 것인지에 따라 메모리 파일의 계층 구조가 있습니다.
So first you have your project-level claude.md that lives in the root directory of your project.
먼저 루트 디렉토리에 있는 프로젝트 수준의 CLAUDE.md가 있습니다.
You have a user-level claude.md that lives in your configuration folder.
설정 폴더에 있는 사용자 수준의 CLAUDE.md가 있습니다.
This one is just for you and goes across all your projects.
이것은 여러분만을 위한 것으로 모든 프로젝트에 걸쳐 적용됩니다.
So put your personal preferences here, like how you write code comments.
여기에 코드 주석 작성 방법 같은 개인적인 선호도를 넣으세요.
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.
먼저, Claude를 수정해야 한다면, 예컨대 API 라우트 대신 항상 Server Actions를 쓰도록 하려면, 명시적으로 메모리에 저장하라고 요청하세요. 프로젝트로 돌아올 때마다 매번 기억합니다.
Second, if you have docs in your project that you want Claude to reference, just use the @ symbol with the file path.
둘째, Claude가 참고했으면 하는 문서가 프로젝트에 있다면 @ 기호 뒤에 파일 경로를 적으세요.
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.
셋째, 먼저 claude.md 없이 프로젝트를 시작해 보세요. 모델을 어디서 계속 수정해야 하는지 볼 수 있습니다.
This keeps your claude.md file compact and contains only the necessary information that Claude can work with.
이렇게 하면 CLAUDE.md 파일을 간결하게 유지하고 필요한 정보만 포함할 수 있습니다.
[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.
답답한 Claude Code 세션과 생산적인 세션의 차이는 컨텍스트에 달려 있으며, claude.md 파일은 그 컨텍스트를 제공하는 방법입니다.
Start with your stack, your preferences, and then commands, and just build from there as you go.
스택, 선호도, 명령어 순서로 시작해서 차근차근 발전시켜 나가세요.