By Order of the Markdown Files

3 min read

Every serious agent setup now runs on markdown. CLAUDE.md, AGENTS.md, skills, rubrics. Edit one and the system behaves differently on the next run, with no code change and no redeploy.

That speed is the appeal. It's also how you quietly break things.

Structure what the model sees

Agents act on what's in their context window, so how you organize that context matters more than where it's stored. The layout I keep coming back to has three tiers:

Context architecture: INDEX.md is always loaded, topic files are loaded on demand, and logs are searched but never loaded into the context window

A small index the model always sees. Topic files it pulls in when a task needs depth. Logs it can search but never loads whole, because dumping logs into a prompt costs tokens and muddies the model's reasoning.

Most problems I see come from skipping this discipline: files that only grow, instructions appended instead of rewritten, contradictions left for the model to sort out. It will sort them out, usually by following whichever instruction appears last. Your system's behavior now depends on line order.

The judge that scored the wrong answer 94%

I learned the harder lesson building an evaluation service for a software factory, a harness that turns tickets into pull requests. An LLM judge scores each run, and its rubric lives in JUDGE.md, loaded as the system prompt on every evaluation. Code only does the arithmetic that combines dimension scores.

One run scored 94%. Clean code, sensible structure, passing tests. It solved the wrong problem. The factory had misread the ticket, and nothing in the rubric told the judge to check the premise before grading the craft.

Adding a premise gate fixed that case. The real problem was bigger: I had edited that rubric many times and had no way of knowing which edits helped and which just moved the failure somewhere else.

Treat edits as deploys

Now every change to the judge goes through the same loop as code:

Judge change loop: edit JUDGE.md, replay frozen baseline runs offline, compare new scores to recorded ones, and fail CI if a known-bad run scores higher

The 94% run is frozen as a baseline. Any edit to the rubric triggers an offline replay of the baselines, and CI fails if a known-bad run scores higher than it should. Judging is held to a determinism policy, since you can't spot a regression in a system that answers differently every time.

Nothing here is new. It's review and regression testing, applied to files we used to think of as docs.

The rules

  • Keep always-loaded files small.
  • Move detail into files the agent fetches on demand.
  • Search logs; never load them.
  • Rewrite instead of appending.
  • Version every file that shapes behavior.
  • Test those files before changes ship. With agents, writing code is the cheap part. The hard part is deciding what the model should know, defining "good" precisely enough for a model to apply it, and proving that a change made things better rather than just different.

Code handles execution. Markdown shapes reasoning. Both deserve the same standard.