Pillar

Context Architecture

How a codebase explains itself — context files, documentation and conventions structured so the right material is found at the right time, by a person or a tool.

01

Measuring Whether Your Context File Helps: A Practical Evaluation Method

A repeatable way to test whether AGENTS.md changes actually improve agent behaviour: representative tasks, objective scoring, controlled comparison, and enough runs to beat variance.

02

Declaring Off-Limits Paths: Generated Code, Migrations and Secrets

The four categories of file an agent must not edit, why each entry needs an escape hatch, and the one line that stops an agent disabling your CI checks.

03

Agent Context Across Many Repositories: Carry Contracts, Leave the Rest

Nested context files solve monorepos and do nothing for fourteen separate services. What must cross a repository boundary, why vendoring contracts works, and how to sequence cross-service work.

04

Token Budget in Multi-File Refactoring: Sequencing Over Squeezing

Where the context budget actually goes during a large refactor, reading signatures instead of implementations, bounding tool output, and staging work so each session can discard the last.

05

AGENTS.md vs CLAUDE.md vs .cursorrules: When One File Isn't Enough

Whether to keep one context file or several, the three cases where a second file is justified, and why the symlink workaround usually disappoints.

06

Agent Memory: Four Layers, and Which One Is Worth Building

Nothing persists that you did not persist deliberately. The four things people mean by agent memory, why task handoff pays first, and why recording dead ends matters more than recording progress.

07

The AGENTS.md Specification: Anatomy of a Repository Context File

What belongs in an AGENTS.md file, the six sections that carry the weight, why short files outperform comprehensive ones, and where context files stop working.

08

Writing Build and Test Instructions an Agent Can Actually Execute

Five ways 'run the tests' fails in practice, how to separate the fast loop from the merge gate, and why pointing at one CI-backed script beats fifteen lines of prose.

09

Dependency-Ordered Context: Rank by Structure, Not Similarity

Why import graphs predict relevance better than semantic similarity, reading imports in full and importers as signatures, excluding hub modules, and telling the agent what you left out.

10

Context File Size and Token Budget: Measuring What You Can Afford

Why the context window is a budget rather than a container, how position affects which rules actually influence behaviour, and a concrete token budget for root and package files.

11

Versioning and Reviewing Context Files as Source Code

Why an AGENTS.md change has a wider blast radius than most code changes, five questions worth asking in review, and two forcing functions that stop the file growing forever.

12

RAG for Runbooks: The Narrow Case Where Internal Retrieval Works

Why most internal-documentation RAG disappoints and operational content does not, structural chunking, returning provenance and age, hybrid retrieval for error codes, and measuring recall@5.

13

Encoding Architectural Constraints and Module Boundaries for Agents

Why naming your architecture pattern doesn't work, how to state dependency directions as checkable rules, and why every prohibition needs an escape hatch.

14

Why Duplicating Your README Into AGENTS.md Makes Agents Worse

Copying project overview into a context file measurably degrades agent performance. The three mechanisms behind it, and a discoverability test for deciding what to cut.

15

AST-Based Repository Indexing: Giving an Agent Exact Answers

Why text search returns confidently wrong answers in codebases with interfaces, a forty-line symbol index you can build with the standard library, and how to keep it from going stale.

16

Scoping Agent Context in Monorepos: Nested Files and Precedence

How to split AGENTS.md across a monorepo so each package carries its own rules, why precedence follows proximity, and how to verify your tooling actually reads nested files.

Other pillars