I use Claude Code daily and the first thing I noticed, the very first week, was that Claude has good taste in code and weak taste in UI. The functions it writes are clean, the architecture it suggests is reasonable, the test coverage it adds is sensible. The components it builds, on the other hand, all look the same. Inter at fourteen, soft gray cards, a button with rounded corners and a faint blue background. Every project.
This is not Claude's fault. Claude has no opinion about your brand because you never gave it one. The fix is small. You write a CLAUDE.md, you write a DESIGN.md, you commit them both, and you never have to think about it again. This post walks through that exact setup, in the way I wish someone had shown me when I started.
Why Claude Code needs a written design system
Claude Code reads your repository the way a new contractor would. It opens the README, scans the package.json, looks at a few existing components if there are any, and then writes the next file based on patterns it can see. If there is no design pattern in the repo, Claude defaults to whatever it thinks a modern web app should look like, which is exactly the thing you do not want.
A CLAUDE.md is the file Claude reads first on every session. It is the place where you tell Claude what is special about this codebase. The most important thing you can put in there is one line that points at your DESIGN.md, because that single line keeps every UI decision Claude makes anchored to a real source of truth, instead of drifting toward the average.
The two file setup
You only need two files. CLAUDE.md and DESIGN.md, both at the root of the project. CLAUDE.md is short, often under twenty lines, and it tells Claude how to work in this repo. DESIGN.md is the actual design system, with tokens for colors, fonts, radii, shadows, and buttons.
My CLAUDE.md is almost the same on every project. It says, work in TypeScript, use the existing component library, prefer composition over inheritance, and reference DESIGN.md for all styling decisions. That last line is the one that matters for UI.
The DESIGN.md is the longer file but it is still small. Three colors, two or three fonts, a radius scale, a button section, a one paragraph note about how the app should feel. You can see the exact format on any system page in the directory, since each system here is itself a working DESIGN.md you can copy into your project.
What changes after Claude reads it
The difference is hard to overstate until you see it. Without DESIGN.md, you ask Claude for a pricing card and you get a soft white card with rounded corners and a blue button. Without DESIGN.md, you ask for a settings page and you get the same card pattern, repeated four times. Without DESIGN.md, you ask for a hero and you get a generic gradient behind a 64 pixel headline in Inter.
With DESIGN.md, you ask for the same things and Claude reaches for your tokens. The pricing card uses your surface color, your hairline border, your accent for the call to action. The settings page uses your radius scale, not a default. The hero uses your display font, not Inter. None of this requires re prompting. It just happens, on the first try, because the file was in context.
Common mistakes when wiring Claude to a design system
The first mistake is putting the design tokens in CLAUDE.md instead of in their own file. CLAUDE.md is for general repo behavior, not for visual specifics. If you mix them, the file gets long, Claude skims, and the design tokens get less attention. Keep them separate.
The second mistake is writing the DESIGN.md as a wishlist instead of as a contract. Lines like, the app should feel modern and clean, are useless. Lines like, primary background is oklch 0.99 0.005 240, hairline borders are 1 pixel oklch 0.88 0.01 240, are usable. Be specific where it matters and prose where it does not.
The third mistake is not committing the files. If DESIGN.md only exists on your machine, your collaborators get drift, your CI runs get drift, and any new Claude session that does not have your local file context will start guessing again. Commit it the same way you commit your tsconfig.
Picking a system to start from
If you do not want to write a DESIGN.md from scratch, you do not have to. Pick one from the directory that is close to the feeling you want, copy the file into your project, change the brand color, and you are done. That is the fastest way to get Claude generating consistent UI in a new project, often within ten minutes of opening the editor.
For SaaS dashboards, I tend to start from a clean technical system and adjust the accent color to the brand. For marketing sites, an editorial system gives the prose room to breathe. For internal tools, a denser admin oriented system saves a lot of layout decisions.
What I would do differently if I was starting today
I would set up the two files before I wrote a single component. The cost of doing it on day one is twenty minutes. The cost of doing it later, after a hundred components have already been generated in the wrong style, is a refactor. Future you will be glad past you wrote the DESIGN.md before the first card.
I would also not over engineer the file. Three colors, two fonts, four button states, a radius scale, a one paragraph mood note. Anything more, on a new project, is premature. You can always extend the file as the product matures, but starting small keeps Claude from second guessing the constraints.
Frequently asked questions
How do I add a design system to Claude Code?
Add two files at the root of your repo. CLAUDE.md tells Claude how to work in this codebase and includes a single line pointing at DESIGN.md for all styling decisions. DESIGN.md holds the actual design tokens, colors, fonts, radii, shadows, and button definitions. Claude reads both on every session and applies them automatically.
What goes in a CLAUDE.md file?
A CLAUDE.md should describe how Claude should work in your repo. Mine is usually under twenty lines and covers the language, the component library to prefer, any architectural conventions, and one line that says reference DESIGN.md for all styling decisions. Keep design tokens out of CLAUDE.md and in DESIGN.md, otherwise Claude skims and the tokens get less weight.
Does Claude Code automatically read CLAUDE.md?
Yes. Claude Code reads CLAUDE.md at the start of every session without any extra prompting. That makes it the right place to put project wide instructions, including the pointer to your DESIGN.md design system file.
Can I use a CLAUDE.md design system with Anthropic Claude in the browser?
Browser Claude does not auto load files from your repo, but you can paste your DESIGN.md into the project context once and it will be referenced for the rest of the session. Claude Code is the version that picks the files up automatically without manual steps.
Why does Claude Code generate generic looking UI without a design system?
Without a written design system, Claude defaults to generic patterns from its training data, usually Inter at 14 pixels, soft gray cards, and rounded blue buttons. Adding a DESIGN.md gives Claude concrete tokens to anchor on, which stops it from guessing and produces UI that matches your actual brand on the first try.
What is the difference between CLAUDE.md and a design.md file?
CLAUDE.md is the file Claude Code reads at the start of every session for project context. A design.md file is the actual design system spec, with tokens, components, and rules. The cleanest setup is to keep your design system in design.md and reference it from CLAUDE.md, so Claude loads the design rules every time without you pasting them.
How long should a CLAUDE.md design system file be?
Long enough to cover tokens, typography, spacing, components, and a few hard rules. Short enough that Claude does not waste context. In practice, around 200 to 600 lines works well. If it grows past that, split it into design.md and reference it from CLAUDE.md.
Can I use the same design.md file across Claude Code, Cursor, and Lovable?
Yes. A well written design.md is just markdown, so it is portable. You drop the same file into Cursor rules, reference it from CLAUDE.md for Claude Code, and paste it as context in Lovable. The output is not identical across tools, but the visual direction stays consistent.
Does Claude Code respect color tokens defined in CLAUDE.md?
It does, as long as the tokens are explicit. Write them as named CSS variables with values, list the surfaces they belong to, and add a short rule like never use raw hex in components. Claude is good at following that pattern, much better than at guessing tokens from a vibe.
How do I prevent Claude Code from inventing new colors and fonts mid project?
Two things. First, list the allowed tokens in CLAUDE.md and add a rule that says do not introduce new colors or fonts without updating this file. Second, when you see drift, point Claude back to the file instead of fixing the symptom in one component. The drift usually comes from missing rules, not from the model being lazy.
