C.W.K.
Stream
Lesson 05 of 11 · published

AGENTS.md — Codex 의 Project Memory

~16 min · codex, agents-md, override, hierarchy

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

Discovery, layering, override 파일

AGENTS.md 가 Codex 한테 CLAUDE.md 가 Claude Code 한테인 거. 같은 아이디어, 약간 다른 메커니즘. Codex 가 Git root 부터 CWD 까지 모든 레벨 + 글로벌 ~/.codex/AGENTS.md 에서 AGENTS.md 찾아. 파일들이 top-down 머지; CWD 에 가까운 게 충돌 시 이김.

Override 파일: AGENTS.override.md. 어느 레벨에서든 있으면 그 레벨의 일반 AGENTS.md 보다 우선. 시간 제한 글로벌 override 용 — sprint 별 룰, "이번 주, 테스트 코드만", 또는 마이그레이션 동안 일반 스타일 선호도 disable.

config.tomlproject_doc_fallback_filenames 이 기존 instruction 파일 (TEAM_GUIDE.md, .agents.md, AI_GUIDE.md) 재사용 가능 + rename X. project_doc_max_bytes 가 크기 cap — 누가 wiki 통째로 AGENTS.md 에 dump 하면 유용.

Code

A real AGENTS.md·markdown
# AGENTS.md — Project Root

## What this is
TypeScript microservices API on Node 22 + Postgres 16, gRPC between
services, JWT RS256 auth.

## Setup
1. npm install
2. docker-compose up -d postgres
3. npm run migrate
4. npm run dev      # port 3000
5. npm test         # vitest

## Code standards
- Strict TS, no `any` (use `unknown`)
- Result<T, E> for error returns where possible
- Functions max 40 lines
- Files max 300 lines

## Important files
- src/config/env.ts — env vars (don't add new ones elsewhere)
- src/types/errors.ts — error types

## Do not
- Commit to main directly
- console.log in app code (use src/lib/logger.ts)
- Hardcode env vars outside config/env.ts
Override + nested layering·markdown
# ~/.codex/AGENTS.override.md
# Sprint override — week of 2026-05-04
All work this week is TEST ONLY. Do not modify production code.
Tests use Vitest. Branch coverage must be 100%.

# services/payments/AGENTS.md (nested, additive)
## Payments — additional rules
PCI-DSS regulated. NEVER log card numbers, CVVs, full PANs.
All encryption: src/lib/crypto.ts (AES-256-GCM).
Stripe calls: src/clients/stripe.ts only.

External links

Exercise

실제 repo 에서 layered AGENTS.md 계층 작성: project 표준 가진 root 파일 + 민감 서브디렉토리 (auth, payments, infra) 의 nested AGENTS.md 1개. root 와 nested 디렉토리 둘 다에서 codex --ask-for-approval never "활성 instruction 요약" run; nested 룰이 관련할 때만 보임 verify.

Progress

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

댓글 0

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

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