Why coding agents make UI styles drift across sessions

can create slightly different UI styles each time, even inside the same project. A button may use #3B82F6 in one session, #2563EB in another, and bg-blue-500 in a later one. Spacing can also vary between 1rem, 16px, and gap-4, while font sizes may switch between text-xl, 1.25rem, and 20px.

The likely cause is that the agent has no structured palette or to follow. such as CLAUDE.md, AGENTS.md, and .cursor/rules are written in , so the model still has to interpret them and choose a code value at generation time. Putting a palette into a Markdown table can work for small one-off projects, but the model may still drift after several turns.

Using tailwind.config.js as the is better because it gives the agent a more structured reference.

Key points

  • may choose different colors, spacing, and font sizes across sessions.
  • rules can leave too much room for the model to guess.
  • A structured palette or can reduce UI drift.
  • CLAUDE.md, AGENTS.md, and .cursor/rules are useful for workflow rules but weaker as the only design reference.
  • tailwind.config.js can work better as a because it is structured code.
Read original