Claude Code의 두 가지 메모리 시스템 — 사람이 쓰는 규칙과 Claude가 스스로 쌓는 학습 Claude Code's two memory systems — human-written rules and Claude's self-accumulated learning
Claude Code에는 서로 보완하는 두 가지 메모리 시스템이 있습니다. 하나는 사람이 작성하고, 하나는 Claude가 스스로 작성합니다.
Claude Code has two complementary memory systems. One is written by humans, and the other is written by Claude itself.
사람이 작성합니다. 프로젝트 규칙, 기술 스택, 컨벤션 등 Claude에게 알려주고 싶은 모든 것을 담습니다.Written by humans. Contains everything you want Claude to know — project rules, tech stack, conventions, and more.
Claude가 스스로 작성합니다. 세션 중 배운 것, 선호도, 패턴 등을 자동으로 기억에 저장합니다.Written by Claude itself. Automatically saves things it learned during a session — preferences, patterns, and more.
새 팀원이 입사하면 가장 먼저 뭘 하나요? 프로젝트 위키를 읽습니다.
📋 CLAUDE.md = 팀이 미리 써둔 프로젝트 온보딩 문서
"React + TypeScript, npm run build로 빌드, camelCase 사용..."
📓 자동 메모리 = 팀원이 일하면서 스스로 적는 개인 노트북
"이 팀은 PR에 스크린샷을 넣길 좋아하는군. 다음부터 기억해야지."
둘을 함께 사용하면 Claude가 매 세션마다 처음부터 다시 배울 필요가 없습니다.
What does a new team member do first? Read the project wiki.
📋 CLAUDE.md = The team's pre-written project onboarding document
"React + TypeScript, build with npm run build, use camelCase..."
📓 Auto Memory = The team member's own personal notebook they fill in as they work
"This team likes screenshots in PRs. I'll remember that next time."
Using both together means Claude doesn't need to relearn everything from scratch every session.
Claude Code를 실행할 때마다 CLAUDE.md를 자동으로 읽습니다. 매번 "우리 프로젝트는 이거야" 하고 설명할 필요가 없어요.CLAUDE.md is automatically read every time Claude Code starts. No need to explain "this is our project" every time.
기술 스택, 폴더 구조, 빌드 명령어, 코딩 컨벤션 등 프로젝트의 핵심 정보를 Claude에게 전달합니다.Communicates key project information to Claude — tech stack, folder structure, build commands, and coding conventions.
네이밍 규칙, 에러 핸들링 패턴, 금지 사항 등을 명시해두면 Claude가 항상 같은 스타일로 코드를 작성합니다.Specify naming rules, error handling patterns, and prohibitions so Claude always writes code in the same style.
/init 명령을 실행하면 Claude가 프로젝트를 분석해서 CLAUDE.md를 자동 생성해줍니다. 거기서 시작해서 직접 다듬어 나가면 됩니다. /memory로 자동 메모리를 관리할 수 있습니다./init in the project root and Claude will analyze your project and auto-generate a CLAUDE.md. Start from there and refine it yourself. Use /memory to manage auto memory.CLAUDE.md는 4가지 범위에 배치할 수 있습니다. 범위가 넓은 것에서 좁은 것 순으로 모두 적용됩니다.
CLAUDE.md can be placed at 4 different scopes. All of them are applied, from broadest to narrowest.
| 범위Scope | 파일 위치File Location | 용도Purpose |
|---|---|---|
| Managed Policy | /Library/Application Support/ ClaudeCode/CLAUDE.md (macOS) |
IT 관리자가 조직 전체에 강제 적용하는 정책Policy enforced org-wide by IT administrators |
| User (전역Global) | ~/.claude/CLAUDE.md | 모든 프로젝트에 공통 적용되는 개인 설정Personal settings applied across all projects |
| Project (팀 공유Team-shared) | ./CLAUDE.md 또는or ./.claude/CLAUDE.md |
Git으로 팀 전체가 공유하는 프로젝트 규칙Project rules shared via Git with the whole team |
| Local (개인 로컬Personal Local) | ./CLAUDE.local.md | 개인 전용, git에 추적되지 않음 (.gitignore)Personal only, not tracked by git (.gitignore) |
🏛️ 그룹사 정책 (Managed Policy) — "모든 직원은 보안 규정 준수"
🏢 본인 업무 스타일 (전역 User) — "나는 항상 한국어로 메모"
🏬 부서 규칙 (Project) — "개발팀은 코드 리뷰 필수"
🗊️ 내 개인 노트 (Local) — "이 프로젝트의 내 로컬 세팅"
범위가 겹치면 더 구체적인 규칙이 우선합니다.
🏛️ Corporate policy (Managed Policy) — "All employees must comply with security regulations"
🏢 Your own work style (User Global) — "I always take notes in English"
🏬 Department rules (Project) — "Dev team requires code reviews"
🗊️ My personal notes (Local) — "My local settings for this project"
When scopes overlap, the more specific rule takes precedence.
CLAUDE.md 안에서 다른 파일을 가져올 수 있습니다. 긴 문서를 분리하거나, README·패키지 정보를 바로 참조할 때 유용합니다. You can import other files inside CLAUDE.md. Useful for splitting long documents or referencing README and package info directly.
규칙이 많아지면 .claude/rules/ 디렉터리에 주제별로 분리할 수 있습니다. 특정 파일 패턴에만 적용되는 규칙도 설정 가능합니다.
When rules grow large, you can split them by topic inside the .claude/rules/ directory. You can also configure rules that apply only to specific file patterns.
paths frontmatter를 사용하면, 해당 파일 패턴에 매칭되는 파일로 작업할 때만 그 규칙이 적용됩니다. 전체 CLAUDE.md를 짧게 유지하면서 세밀한 제어가 가능합니다.paths frontmatter applies that rule only when working with files matching that pattern. This allows fine-grained control while keeping the main CLAUDE.md short.응답 언어, 커밋 메시지 스타일 등 모든 프로젝트에 공통으로 적용할 규칙을 작성합니다.Write rules that apply across all projects — response language, commit message style, etc.
기술 스택, 빌드/테스트 명령어, 아키텍처 등 해당 프로젝트 고유의 정보를 작성합니다.Write information unique to this project — tech stack, build/test commands, architecture, etc.
개인 전용 설정으로 git에 추적되지 않습니다. 로컬 DB 포트, 개인 API 키 경로 등 팀과 공유하지 않을 내용을 넣습니다.Personal settings that are not tracked by git. Put anything you don't want to share with the team — local DB port, personal API key paths, etc.
Claude가 스스로 작성하는 메모리입니다. 세션 중 배운 것을 자동으로 저장하고 다음 세션에서 활용합니다.
Memory that Claude writes itself. It automatically saves what it learned during a session and uses it in the next.
Claude Code가 작업하면서 중요한 것을 발견하면 스스로 메모합니다.
📝 "이 팀은 ESLint auto-fix 후 반드시 수동 검토를 원하는군"
📝 "이 프로젝트의 API 에러 패턴은 커스텀 AppError 클래스를 사용함"
📝 "배포 전에 항상 npm run e2e를 실행해야 함"
다음 세션에서는 이 메모를 보고 처음부터 다시 설명하지 않아도 됩니다.
When Claude Code discovers something important while working, it takes its own notes.
📝 "This team always wants manual review after ESLint auto-fix"
📝 "This project's API error pattern uses a custom AppError class"
📝 "Must always run npm run e2e before deploying"
In the next session, it reads these notes, so you don't have to explain it from scratch.
자동 메모리는 프로젝트별로 다음 위치에 저장됩니다:Auto memory is saved per project at the following location:
/memory 명령으로 자동 메모리를 관리합니다:Use the /memory command to manage auto memory:
매 세션마다 MEMORY.md의 앞 200줄이 자동으로 컨텍스트에 포함됩니다. 가장 자주 참조되는 핵심 정보가 여기에 담겨있습니다.The first 200 lines of MEMORY.md are automatically included in context every session. This contains the most frequently referenced key information.
디버깅 작업을 하면 debugging.md가, 코드 패턴 관련 작업을 하면 patterns.md가 자동으로 로드됩니다. 불필요한 컨텍스트 낭비를 방지합니다.When doing debugging work, debugging.md auto-loads; for code pattern work, patterns.md loads. This prevents unnecessary context waste.
모든 것을 다 저장하지 않습니다. Claude가 "다음 세션에도 알아야 할 중요한 정보"라고 판단한 것만 선별해서 메모리에 기록합니다.Not everything is saved. Only what Claude judges as "important information to know in the next session" is selectively recorded in memory.
/memory에서 토글하거나, settings에서 autoMemoryEnabled: false로 설정하면 자동 메모리가 비활성화됩니다.Toggle from /memory, or set autoMemoryEnabled: false in settings to disable auto memory.
프로젝트 유형별로 바로 복사해서 쓸 수 있는 CLAUDE.md 템플릿입니다. Ready-to-copy CLAUDE.md templates for each project type.
CLAUDE.md는 구체적일수록 효과적입니다. 실제 비교를 통해 차이를 느껴보세요. CLAUDE.md is more effective the more specific it is. See the difference through real comparisons.
CLAUDE.md를 팀에서 공유하는 두 가지 전략과 셋업 가이드입니다. Two strategies for sharing CLAUDE.md as a team, plus a setup guide.
CLAUDE.md를 저장소에 포함시킵니다.Include CLAUDE.md in the repository.
팀 전체가 동일한 규칙을 사용해야 할 때 추천합니다. PR을 통해 규칙 변경 이력도 관리됩니다.Recommended when the whole team needs to use the same rules. Rule change history is also tracked through PRs.
CLAUDE.md를 개인만 사용합니다.Keep CLAUDE.md for personal use only.
각자 선호하는 스타일이 다르거나, 개인적인 지시사항(예: 응답 언어)을 넣고 싶을 때 추천합니다.Recommended when team members have different style preferences or want to add personal instructions (e.g., response language).
코딩 컨벤션, 네이밍, 금지 사항 등을 팀원들과 함께 정합니다. 이미 있는 ESLint/Prettier 설정을 기반으로 하면 쉽습니다.Agree with teammates on coding conventions, naming rules, and prohibitions. Starting from existing ESLint/Prettier config makes this easy.
한 명이 초안을 작성합니다. 위의 템플릿 갤러리에서 프로젝트에 맞는 것을 복사해서 시작하면 빠릅니다. /init으로 자동 생성 후 다듬어도 좋습니다.One person writes the draft. Copying from the template gallery above and customizing is the fastest approach. Auto-generating with /init then refining also works well.
CLAUDE.md 변경도 코드 리뷰처럼 PR을 거칩니다. "왜 이 규칙을 추가했는지" 이유를 PR 본문에 적으면 나중에 돌아볼 때 좋습니다.Changes to CLAUDE.md go through a PR just like code reviews. Writing the reason "why this rule was added" in the PR description helps when looking back later.
프로젝트가 진행되면서 기술 스택이 바뀌거나 새 규칙이 필요해집니다. 스프린트 회고 때 CLAUDE.md도 함께 리뷰하면 항상 최신 상태를 유지할 수 있습니다.As the project progresses, tech stacks change and new rules emerge. Reviewing CLAUDE.md during sprint retrospectives keeps it always up to date.
~/.claude/CLAUDE.md)에 넣으면 둘 다 적용됩니다.
Hybrid Strategy: Commit the shared team CLAUDE.md to Git, and put personal settings (response language, preferred style, etc.) in the global CLAUDE.md (~/.claude/CLAUDE.md) — both will apply.
CLAUDE.md에 대해 가장 많이 궁금해하는 것들 The most common questions about CLAUDE.md
.claude/rules/ 디렉터리에 주제별로 분산시키거나, 하위 폴더별 CLAUDE.md로 나누세요. Claude는 해당 폴더에서 작업할 때만 하위 CLAUDE.md를 읽으므로 효율적입니다. 또한 @import 문법으로 외부 파일을 참조하는 것도 좋은 방법입니다.
CLAUDE.md is loaded into context at the start of every session, so if it's too long it unnecessarily consumes your context window. The official recommendation is to keep it under 200 lines. If you have a lot of information, put only the core rules in the project root CLAUDE.md, and distribute the details across topic-specific files in the .claude/rules/ directory, or split them into per-subfolder CLAUDE.md files. Claude only reads subfolder CLAUDE.md files when working in that folder, so it's efficient. Using @import syntax to reference external files is also a good option.
/init은 프로젝트를 분석해서 초안을 만들어주는 것일 뿐입니다. 자동 생성된 내용이 정확하지 않을 수 있고, 프로젝트의 특수한 규칙이나 컨벤션은 사람이 직접 추가해야 합니다. 오히려 /init으로 시작하고 직접 다듬는 것이 가장 추천하는 방법입니다.
Absolutely! /init simply analyzes your project and produces a draft. The auto-generated content may not be perfectly accurate, and project-specific rules or conventions need to be added by hand. In fact, starting with /init and then refining it manually is the recommended approach.
~/.claude/CLAUDE.md)는 각자의 컴퓨터에 있으므로 자유롭게 다르게 쓸 수 있습니다. 하지만 프로젝트 루트 CLAUDE.md는 Git으로 공유되기 때문에, 각자 다른 내용을 넣으면 머지 충돌이 발생합니다. 해결 방법은 두 가지입니다: (1) 팀 규칙을 합의해서 하나로 통일하거나, (2) 개인 설정은 전역 CLAUDE.md에 넣고 프로젝트 CLAUDE.md는 공통 규칙만 담는 하이브리드 전략을 사용하세요.
The global CLAUDE.md (~/.claude/CLAUDE.md) lives on each person's machine, so everyone can freely use different content there. However, the project root CLAUDE.md is shared via Git — if different people put different content in it, merge conflicts will occur. There are two solutions: (1) agree on team rules and unify into one file, or (2) use the hybrid strategy where personal settings go in the global CLAUDE.md and the project CLAUDE.md contains only shared rules.
~/.claude/projects/<project>/memory/에 자동 저장합니다. 개인 전용이라 팀과 공유되지 않습니다./memory 명령으로 자동 메모리를 열람하거나 끌 수 있습니다.
The author is different.~/.claude/projects/<project>/memory/. It's personal and not shared with the team./memory command to view or disable auto memory.
CLAUDE.local.md는 자동으로 .gitignore에 추가하는 것이 좋습니다. 팀의 프로젝트 CLAUDE.md에는 영향을 주지 않고 개인 설정을 유지할 수 있습니다.
Use it when you have personal project settings you don't want to share with the team.CLAUDE.local.md to .gitignore. This lets you maintain personal settings without affecting the team's project CLAUDE.md.
두 메모리 = CLAUDE.md (사람 작성) + 자동 메모리 (Claude 작성)
파일 범위 = Managed → User 전역 → Project → Local
고급 기능 = @import 문법 + .claude/rules/ 경로별 규칙
핵심 원칙 = 200줄 이내, 구체적이고 사실적인 정보
Two memories = CLAUDE.md (written by you) + Auto memory (written by Claude)
File scope = Managed → User global → Project → Local
Advanced = @import syntax + .claude/rules/ path-scoped rules
Core principle = Under 200 lines, concrete and factual information
CLAUDE.md 시작하기:Start CLAUDE.md:
/init자동 메모리 관리:Manage auto memory:
/memory