Dan Birman

What a DESIGN.md is worth to a coding agent

Writing · November 2026 · 3 min

Summary. A DESIGN.md file in the repo removed most of the design-system drift I measured in Claude Code and Codex. It missed the product’s own patterns, such as empty states. Listing them helped Claude reuse them.

Each feature ran with and without the file

The app is shadcn’s open-source Taxonomy, with a shadcn/ui design system. I wrote 20 features for it, each with 10 follow-up requests that give no visual direction. In one copy of the repo, CLAUDE.md and AGENTS.md pointed to a DESIGN.md generated from the code: its tokens and 153 components. Each run was a fresh clone that couldn’t see other runs or my own settings.

The agents were Claude Code with Sonnet 5.5 and Codex with gpt-6.1-sol. A design-system checker I built, designci, checked a render of every step. An off-token color, or a hand-built control where the system has one, counts once per run. A model judge also reviewed each run’s final code for copied or inconsistent patterns.

The file cut drift for both agents

AgentWithout DESIGN.mdWith DESIGN.mdTasks where it helped
Claude, 20 tasks1343317 of 20, 3 ties
Codex, 15 tasks4223015 of 15

On the 15 shared tasks, the file helped 27 times and never hurt. The odds of that by chance are about 1 in 70 million.

Codex writes each color as several classes, so one hue can count seven times. Counting each hue once on the shared tasks, the file takes Codex from 129 to 30 and Claude from 61 to 20.

Off-system decisions per task for Claude Code and Codex, without and with DESIGN.md. Every task moves left or stays put; none moves right.
Off-system decisions per task, without and with DESIGN.md, on the 15 shared tasks. A ringed dot is a tie.

Across all 20 tasks, Claude’s off-system colors fell from 62 to 3 and its hand-built controls from 45 to 6.

Without the file, agents invented colors

The system has no success, warning or info token. When a request needed one (“so successful and failed deliveries are easy to tell apart”), agents without the file used Tailwind’s green, amber and red. With it, they used existing tokens and added no status color. Codex also gave each avatar, role or event type its own hue on 14 of 15 tasks; Claude did so on 8.

The Codex team members table without DESIGN.md, with colored avatars and badges, above the same table with DESIGN.md, in grays and the system’s badges.
Codex’s team members task after all 10 edits: 13 off-system decisions without DESIGN.md (above; 68 before grouping shades), and 1 with it (below).

Without the file, drift grew in later edits

Without the file, two thirds of Claude’s drift came after the first build (88 of 134 decisions), and about half of Codex’s. With it, drift stayed nearly flat.

Listing the product’s own patterns helped

The judge found about as many copied and inconsistent patterns without the file as with it (Claude 26 and 23 over 20 tasks). Nearly all involved the empty state, the page header and toasts, which live outside the component library and so outside the DESIGN.md.

A third version added a “Product patterns” section. It listed every component or hook outside the library that at least two pages import, with its path and a usage snippet. On 15 Claude tasks, runs importing the empty state, page header and page shell went from none to 8, 7 and 6. Copied-pattern findings went from 7 to 0.

No agent shipped a toast in any version, so total drift didn’t move (20 vs 21). My bench required each request to show in a preview screenshot, and a toast doesn’t.

What I’d do with this

  1. Give your agent a DESIGN.md.
  2. Add missing tokens, such as success and warning colors.
  3. List your product’s own patterns next to the component library.

Limits

This is one app, one run per condition, and two agents at default effort. Codex covers 15 of the 20 tasks because my ChatGPT plan’s usage ran out. The preview rule biases against toasts.

The judge can open repo files, so it might have read the DESIGN.md. None of its findings mention it, and the rule-based findings, most of the drift, can’t be affected.

Every run is in the bench repo.