Why the Same Model Designs Better in One App Than Another
Claude Design and Claude Code run on the same model weights under very different runtime constraints. Here is why their UI output differs—and how to bridge the gap.
Ask Claude to design a screen inside Claude Design (or Artifacts) and you get a layout you can show a client immediately. Ask for the exact same screen inside Claude Code in a production repository and you often get something that compiles, passes the linter, and looks like a generic internal admin form. Both tools run on the same underlying model weights, yet their visual output differs sharply.
That gap has nothing to do with a secret “design model.” Claude Design produces better visual layouts because it operates under a completely different set of runtime conditions. Once you isolate those conditions, you can bring most of them into your local coding workflow.
1. Visual feedback loop vs. blind file editing
Claude Design renders its output onto a live browser canvas and inspects the result. When a display heading crowds a status badge or a dark card swallows its own body copy, the visual collision is immediately visible in the frame.
Claude Code edits source files blind. Even when you hand it a finished HTML reference to port into your application, the CLI agent cannot see what the browser or simulator actually painted unless you feed a rendered screenshot back into the conversation.
When I designed CortexPanel’s visual direction in Claude Design—a warm light-paper background with light expert cards and a dark slate surface reserved for the Moderator synthesis card—and handed the exported HTML to Claude Code to port into our Next.js repo, the first pass rendered poorly despite having the exact source markup in context:
- A stale dev server had not recompiled the new Tailwind theme tokens.
- A gradient fade utility had
rotate(180deg)inverted upside down. - Several expert avatar initials failed WCAG contrast against their background fills.
- Google Fonts was serving
Interwithout itsopszoptical-sizing axis, making display headings look loose and spindly.
I hit the same blindness on our React Native mail and calendar suite. When I asked Claude Code to port a tactile button specification into StyleSheet.create, it applied a bright gloss gradient across the entire button face instead of restricting it to a 2px top inset border. In JSX source code, a full-bleed gradient view and a border gradient look almost identical; on a phone screen, one looks like anodized metal and the other looks like a 2009 web banner.
2. Direct node selection vs. prose targeting
In a visual tool, feedback attaches directly to the DOM node you selected. You click a card header, type "too heavy," or drag a spacing handle, and the target element is unambiguous.
In a terminal session, you type "the spacing at the top of the card feels cramped," and the coding agent spends half its turn figuring out which card component, which wrapper <View>, and whether the whitespace comes from paddingTop, marginBottom, or a parent gap token. Three direct visual nudges converge faster than a paragraph of prose description.
3. Training-distribution depth: HTML/CSS vs. custom frameworks
Claude Design outputs standalone HTML, CSS, and SVG. Frontier models have trained on millions of well-designed web pages and stylesheets, so CSS Grid proportions, fluid typography, and standard web patterns sit deep in the model’s weights.
Ask the same model to compose a view inside React Native’s StyleSheet (Yoga flexbox), a custom enterprise charting library, or a multi-brand token system, and it has a much smaller distribution of high-craft visual examples to draw from. It knows how to make the TypeScript compile, while its intuition for how lineHeight: 20 sits beside a 16pt icon in Yoga layout is much weaker.
4. How pre-commit rules consume the attention budget
Context window attention is finite, and every instruction loaded before your prompt competes for it.
In our production React Native monorepo, before Claude Code writes a single line of JSX, it loads roughly 50 KB of standing architecture and design-system rules, all enforced by blocking pre-commit checks:
- Every user-visible string must pass through
t()with zero raw string literals. - Layouts must use logical
paddingStart/paddingEndproperties and directional icon wrappers so Arabic and Hebrew mirror cleanly. - AST lint rules block raw hex literals, inline font sizes, and cloned row components.
- Automated contrast checks validate every foreground/background token pair across light and dark tenant palettes.
Every one of those checks is binary: violate one and git commit fails. By the time the coding agent satisfies 50 KB of structural invariants and type checks, visual hierarchy and whitespace rhythm get whatever scraps of attention remain.
Claude Design carries none of that weight in its context window. It loads a compact color palette and type scale, ignores localization, state machines, and keyboard avoidance, and spends 100% of its attention budget on how the rectangle looks.
5. Prototype incentives vs. production incentives
A Claude Design artifact exists to be evaluated visually and discarded. Nobody gets paged at 2 AM if a label overflows in German or a popover clips inside a scrolling modal.
Production application code has to survive missing data, Dynamic Type scaling, offline states, and strict TypeScript checks. When you optimize an agent’s instructions around “never break a pre-commit check,” the model makes conservative, defensive layout choices. When you optimize around “make this screen look editorial,” it takes visual risks.
Four ways to bridge the gap in a production repo
- Explore layout directions in Claude Design, then port to Claude Code: Use a visual sandbox when you want to compare five layout directions in twenty minutes, then hand the winning HTML and token values to Claude Code as a concrete specification to wire into production components.
- Close the visual loop with simulator screenshots: Pasting a screenshot of the running iOS simulator or browser window back into Claude Code recovers most of the visual gap in a single turn. As soon as the agent sees the inverted gradient or cramped header rendered on a real surface, it fixes what it could not infer from the JSX alone.
- Separate the structural pass from the visual polish pass: If you ask for strict lint compliance and visual refinement in the same prompt, binary lint rules always win. Run a dedicated visual pass after the screen compiles and passes tests, using a three-rule checklist:
- Maximum three typography levels per view: Page title, uppercase section eyebrow, and body copy. If a fourth text size appears, merge it into an existing level.
- One semantic job per accent color: If two badges in the same view share a color for different reasons, one of them is using the wrong token.
- Hairlines and whitespace over nested boxes: Separate groups with
1pxhairlines and vertical spacing rather than nesting cards inside cards.
- Annotate visual bugs with tight crops and arrows: Instead of writing three sentences explaining which border looks heavy, drop a cropped screenshot with a red arrow into the prompt so zero tokens are wasted guessing which element you mean.
Summary
- Claude Design inspects its rendered canvas; Claude Code writes source files blind unless you feed screenshots back into the session.
- Visual sandboxes bind feedback directly to the clicked DOM node rather than forcing the model to locate components from prose descriptions.
- Claude Design outputs pure HTML and CSS, where the model’s visual training priors are deepest.
- In a production repository, standing architectural rules and blocking pre-commit checks consume the attention budget before visual polish begins.
- Sandboxes optimize for immediate visual impression; production agents optimize for passing type and lint checks.
- Explore visual directions in Claude Design first, then hand the winning markup and token spec to Claude Code.
- Paste simulator or browser screenshots back into Claude Code so it can inspect the painted surface.
- Run the structural pass and the visual polish pass in separate turns (max 3 type sizes, 1 job per accent color,
1pxhairlines over nested cards). - Point at visual defects using cropped screenshots with arrows instead of describing them in prose.