C.W.K.
Stream
Lesson 03 of 04 · published

Context File 패턴 (CLAUDE.md, AGENTS.md, GEMINI.md)

~20 min · context-file, memory, claude-md, agents-md, gemini-md

Level 0🌱 입문자
0 XP0/70 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

이름은 셋, 아이디어는 하나

모든 메이저 CLI 가 같은 primitive 로 수렴했어: 에이전트가 일 시작하기 전에 읽는 markdown 파일이 repo 에 있어. Claude 는 CLAUDE.md, Codex 는 AGENTS.md, Gemini 는 GEMINI.md 라고 부르지. 같은 모양, 같은 목적: 코드랑 같이 다니는 project memory.

왜 존재하는지: prompt 는 증발하고, 파일은 남아. 모든 컨트리뷰터가 매 세션 시작마다 "우리는 TS strict 쓰고 절대 any 안 써" 다시 입력해야 한다면, 그 룰은 사실상 없는 거야. 추적되는 markdown 파일에 박아두면 에이전트가 cold start 마다, git clone 마다, CI run 마다 읽어. 마침내 repo 가 AI 와 공유하는 메모리를 갖게 되는 거지.

계층은 CLI 마다 같아: global (~/.claude/, ~/.codex/, ~/.gemini/) → project (repo root) → nested (서브디렉토리 전용 룰). 파일들이 머지되고, cwd 에 가까울수록 우선순위 높아. 개인 스타일은 global, 팀 아키텍처는 project root, 보안 민감 룰은 더 깊은 위치에.

Code

A repo with all three context files·text
myproject/
├── CLAUDE.md          ← Claude Code reads this
├── AGENTS.md          ← Codex CLI reads this
├── GEMINI.md          ← Gemini CLI reads this
├── src/
│   ├── payments/
│   │   ├── CLAUDE.md  ← extra rules just for payments code
│   │   └── ...
│   └── ...
└── ...

# Same content can live in all three (or share most of it)
# — different agents, same project memory.
What goes in a context file·markdown
# AGENTS.md (or CLAUDE.md / GEMINI.md)

## What this is
TypeScript REST API on Node 22 + Postgres 16. Deployed via Fly.io.

## Standard commands
npm run dev      # localhost:3000, hot reload
npm test         # vitest
npm run db:migrate

## Conventions
- TS strict, no `any` (use `unknown` and narrow)
- All routes have an integration test in tests/
- Error envelope: { data, error, meta }

## Do not
- Commit .env (use direnv)
- Modify schema.prisma without a migration
- Add deps without checking bundle size first

External links

Exercise

네 repo 에 30–80 줄짜리 context 파일 만들어. tech stack, 표준 명령어 3개, 코딩 룰 2개, "하지 마" 룰 2개 포함. 커밋. 새 CLI 세션 열고 "이 파일 요약해봐" 시켜서 진짜 로드됐는지 확인해.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.