AGENTS.md Best Practices: Why a Giant Instructions File Fails and How to Build a Router
Why agents ignore a giant AGENTS.md or CLAUDE.md: four causes of instruction decay, the instruction SNR metric, a three-tier router → docs → executable checks architecture, and the rule passport.
- You will break down your instructions file into a router and topic-specific documents.
- You will calculate the SNR of your instructions and identify what ought to be removed.
- You will learn to use the rule passport to decide what deserves a place in the instructions and what belongs in a test.
강의 시작 부분
Three months of edits, and the agent got worse
- Every agent bug → a new rule in AGENTS.md
- The file grew to 600 lines — and the agent started making more mistakes
- A critical safety rule is ignored despite being right there in the file
It all started sensibly enough: the agent made a mistake, so you added a rule. It slipped up again, so you added another. Three months later, AGENTS.md runs to 600 lines, and you're rather proud of it: now everything's covered. But on a simple bug fix, the agent somehow reads the deployment instructions, which have nothing whatsoever to do with the task. And the safety rule at line 300 — the very reason this whole exercise began — gets ignored as if it weren't there at all. On top of that, three contradictory style rules produce random behaviour from one run to the next.
This is a systemic failure, not a one-off agent bug
- A simple bug fix → the agent reads irrelevant deployment instructions
- The critical safety rule at line 300 might as well be invisible
- Three contradictory style rules → random behaviour
This isn't a one-off agent bug — it's a systemic symptom. When an instructions file grows unchecked, the same thing happens every time: relevant content drowns in the irrelevant, important rules become visually indistinguishable from trivial ones, and contradictions pile up because deleting anything feels too risky. Later in this lecture we'll cover four independent causes behind all this, a metric that will show you the scale of the problem in your own file, and an architecture that fixes it systematically — rather than piling yet another rule on top of the old ones.
Myth: the more rules in AGENTS.md, the safer the agent
- 🤔 Myth / Common misconception:
- Every new rule makes the agent more reliable
- A 600-line file = maximum control
- ✅ In reality:
- Agent performance dropped as soon as the line count grew too high
- The critical rule got lost among the minor ones
- 📌 Remember: signal beats volume — count SNR, not lines
It seems logical: the more rules you write down, the safer the agent. In practice, quite the opposite. In our example, the file grew to 600 lines — and that was precisely when the critical safety rule stopped being followed. It's not about the number of rules; it's that the agent physically cannot give each of 600 lines equal attention. Volume of instructions does not equal effectiveness. Next, we'll work through four independent reasons why a growing instructions file reduces, rather than improves, agent reliability.
전체 강의는 구독 후 이용 가능
전체 버전에는 22개의 슬라이드가 더 있습니다.
로그인하고 구독하면 영상, 모든 슬라이드, 노트, 테스트, AI 튜터, 면접을 이용할 수 있습니다.
로그인 또는 회원가입 구독하기강의 목차
- Three months of edits, and the agent got worse
- This is a systemic failure, not a one-off agent bug
- Myth: the more rules in AGENTS.md, the safer the agent
- Four independent causes — and they act simultaneously
- 600 lines in a file is already 10% of your context budget
- The rule at line 300 — right where the model goes blind
- All the rules look the same — the agent has no signal to go on
- Why nobody dares to delete a line from AGENTS.md
- Why fixing a single cause changes nothing
- ❓ Passwords in the logs twice in one month — and the rule is right there on line 210
- 💡 It is not the wording of the rule — it is its position in the file
- SNR: the number that honestly shows how much noise is in your file
- How to calculate your file's SNR
- Three levels instead of one giant file
- The router has exactly five duties — and not one more
- Documents the agent opens only when relevant, not every time
- The instruction you don't have to write — it's already in the code
- A proper link to level 2: with a condition, not just a path
- 🛠 War story: a rule with no passport that nearly got forgotten
- A rule's passport: three attributes, or it lives forever
- Placement matters: where a rule goes, and where a bug story goes
- In practice: scheduled reviews and three questions
- Why lines almost never get removed from AGENTS.md
- Practice: split your instructions file into a router and documents — today
- The router beats the encyclopaedia
이 강의 관련 글
- CLAUDE.md와 AGENTS.md: 무엇이며 무엇을 써야 하고 에이전트가 규칙을 무시하는 이유
- Harness engineering이란: AI 에이전트를 실제로 쓸 수 있는 도구로 만드는 방법
- AI 에이전트를 신뢰할 수 있게 만드는 방법: 측정에서 자율 작업까지 단계별 로드맵
- 에이전트가 "완료"라고 했지만 기능이 작동하지 않는다: AI 에이전트 작업을 검증하는 방법
- Harness vs context engineering: 하네스 엔지니어링은 prompt 및 context engineering과 어떻게 다른가
이 강좌의 모든 강의
- What Is Harness Engineering? Why AI Coding Agents Fail Because of the Environment
- Error Accumulation in AI Agents: Why 95% Per-Step Accuracy Fails by Step 10
- AI Agent Reliability Metrics: MTBF, MTTR, Blast Radius and Little's Law
- Why AI Agents Fail in Production: Five Failure Layers and a Diagnostic Loop
- What an AI Agent Harness Is Made Of: Instructions, Tools, Environment, State, Feedback Loops
- Repository Map for AI Coding Agents: Project Structure and State Without Memory
- AGENTS.md Best Practices: Why a Giant Instructions File Fails and How to Build a Router
- AI Agent Memory Between Sessions: Session Handoff, PROGRESS.md and Bootstrap Contract
- feature_list.json for AI Agents: WIP=1, Feature Status and verify.sh Verification
- Agent Says 'Done' but the Feature Is Broken: Verification Gap and Definition of Done
- All Tests Pass, Feature Is Broken: E2E Tests and Architecture Rules for AI Agents
- AI Agent Observability: Sprint Contracts, Evaluator Rubrics and Clean Session Exit
- Autonomous AI Coding Agent for Hours: Loop Engineering and Stop Conditions
- Graph Engineering for AI Agents: When a Single Loop Is Not Enough and You Need a Task Graph
- Building an AI Agent Harness From Scratch: AGENTS.md, feature_list.json, verify.sh and an Autonomous Loop