●MCP — Enterprise-managed MCP connectors arrive: admins provision once, users get zero-touch access on first login (Okta, Team/Enterprise beta)●LEGAL — 20+ legal MCP connectors and 12 practice-area plugins ship for research, contracts, and matter management●AGENTS — Code w/ Claude unveils Managed Agents: plan the work, fan out to hundreds of subagents, verify before returning●LIMIT — The 5-hour Claude Code rate window is doubled for Pro, Max, Team, and seat-based Enterprise●BILLING — The June 15 Agent SDK credit split was paused; this usage stays within your subscription limits●FIX — Claude Code stability fixes continue: stuck spinners, subagent transcripts, and remote task status●MCP — Enterprise-managed MCP connectors arrive: admins provision once, users get zero-touch access on first login (Okta, Team/Enterprise beta)●LEGAL — 20+ legal MCP connectors and 12 practice-area plugins ship for research, contracts, and matter management●AGENTS — Code w/ Claude unveils Managed Agents: plan the work, fan out to hundreds of subagents, verify before returning●LIMIT — The 5-hour Claude Code rate window is doubled for Pro, Max, Team, and seat-based Enterprise●BILLING — The June 15 Agent SDK credit split was paused; this usage stays within your subscription limits●FIX — Claude Code stability fixes continue: stuck spinners, subagent transcripts, and remote task status
Handing Claude Design Mockups Straight to Claude Code: Folding the Design-to-Code Loop
The June 17 Claude Design update added codebase-aware generation. Here's how to make your tokens the single source of truth, hand mockups to Claude Code, and collapse the design-to-code round trip — with code you can copy.
Maintaining the UI for four sites on my own, the thing I most want to cut isn't building features — it's the round trip between deciding how a screen looks and implementing it. You set a corner radius and button padding in a design tool, switch back to code, retype the same numbers, build, compare, and find it's slightly off again. That translation loss eats more time than the features themselves.
The Claude Design update announced on June 17 hits this directly. It added design-system import, tighter Claude Code integration, direct canvas editing, and more export formats — and most importantly, Claude Design can now work from your local codebase. Generated assets reflect elements of your existing product, and you can hand them straight to Claude Code to implement (it's a beta for Pro, Max, Team, and Enterprise).
But wiring the tools together doesn't erase the round trip by itself. What actually helped me, running four sites as an indie developer, was setting things up so that both tools look at the same vocabulary. This is that setup, with code you can copy.
Why the round trip is heavy
Design and code drift apart not for lack of taste, but because the source of truth is duplicated. The design side has "radius 12px, primary button #5B5BD6," and the code side hardcodes the same values somewhere else. Fix one and the other goes stale; ask an AI to implement and you get something close-but-wrong.
That's exactly what codebase-aware Claude Design changes. It can read the tokens you keep in code, and Claude Code reads the same tokens. Unify the source of truth and the two tools line up by reference, not by translation. The first move isn't to play with the new feature — it's this unification.
The workflow at a glance
The order first; each step is fleshed out below.
Step
What you do
Source of truth
1
Make design tokens the single source
design/tokens.json
2
Generate CSS variables from it
src/styles/tokens.css (generated)
3
Pin design context into CLAUDE.md
CLAUDE.md
4
Hand a Claude Design mockup to Claude Code
handoff prompt
5
Align the generated UI and verify it
verification script
Steps 1–3 are a one-time environment setup; steps 4–5 repeat per screen. The more you invest up front, the less rework happens later.
✦
Thank you for reading this far.
Continue Reading
What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.
WHAT YOU'LL LEARN
✦If you keep redoing work between design and code, you'll be able to drive both Claude Design and Claude Code from one shared vocabulary of tokens
✦You'll get a copy-ready handoff workflow: a tokens.json transform, a CLAUDE.md design-context block, and the handoff prompt itself
✦You'll catch UI that drifts from your design system early, with a verification step instead of your eyes
Secure payment via Stripe · Cancel anytime
✦
Unlock This Article
Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.
The { "value": ... } nesting looks verbose, but it leaves room to attach metadata later (descriptions, deprecation flags). I once skipped that level and had to do a full search-and-replace afterward, so I'd add it from the start.
Step 2: Generate CSS variables
Copy tokens by hand and you've just duplicated the source again. Run a single generator so the CSS is always built from the JSON.
// scripts/build-tokens.mjs — generate CSS variables from tokens.jsonimport { readFileSync, writeFileSync } from "node:fs";const tokens = JSON.parse(readFileSync("design/tokens.json", "utf8"));const lines = [];// Recursively flatten nested tokens into "--group-key: value;"function walk(node, prefix) { for (const [key, val] of Object.entries(node)) { if (val && typeof val === "object" && "value" in val) { lines.push(` --${prefix}${key}: ${val.value};`); } else if (val && typeof val === "object") { walk(val, `${prefix}${key}-`); } }}walk(tokens, "");const css = `:root {\n${lines.join("\n")}\n}\n`;writeFileSync("src/styles/tokens.css", css);console.log(`✅ wrote ${lines.length} tokens to src/styles/tokens.css`);
It produces CSS like this:
/* src/styles/tokens.css — generated. Do not edit by hand */:root { --color-brand: #5B5BD6; --color-fg: #1A1A2E; --color-fg-muted: #5C5C70; --color-bg: #FFFFFF; --color-bg-subtle: #F5F5FA; --color-border: #E2E2EC; --radius-sm: 8px; --radius-md: 12px; --radius-lg: 20px; --space-1: 4px; /* …and so on… */}
Add node scripts/build-tokens.mjs to the prebuild step in package.json and the CSS follows the JSON on every build. Components reference variables only — var(--color-brand) — and never write a raw hex value again.
Step 3: Pin design context into CLAUDE.md
Claude Code reads CLAUDE.md as startup context. Spelling out your design conventions there visibly reduces variance in the UI it generates.
## Design rules (mandatory during implementation)- Always use the CSS variables in src/styles/tokens.css for color, spacing, radius, and font. Never write raw hex or px in components.- Radius: card = var(--radius-md), button = var(--radius-sm), modal = var(--radius-lg).- Body text uses var(--font-size-body) / line-height var(--font-line-body). H2 uses var(--font-size-h2).- Need a new color or spacing value? Add it to design/tokens.json, rerun build-tokens.mjs, then reference it with var() — never inline it.- Never drop the focus ring (2px outline in var(--color-brand)).
This is where /cd (the working-directory switch added June 18) pays off. The CLAUDE.md at the destination is appended as a message rather than replacing the system prompt, and the prompt cache isn't rebuilt. Editing UI across several repos like I do, each site's design rules get layered into context as I switch, so I mix up one site's palette for another far less often.
Step 4: Hand the mockup to Claude Code
This is the part you repeat per screen. When you build a mockup in Claude Design from your local codebase, the generated asset reflects your existing components. When I hand it to Claude Code, I don't say "build the whole thing" — I make the translation into existing vocabulary explicit.
# Handoff prompt to Claude Code (example)Implement the membership card I created in Claude Design.Constraints:- Use only the CSS variables in src/styles/tokens.css (no raw color or px).- Reuse the existing <Card> and <Button variant="primary">; do not add new styles.- Match the structure of the existing src/components/cards/PlanCard.tsx.- Dark mode should follow automatically via the existing [data-theme="dark"] variables.- Accessibility: the button must be a real button element; the price is emphasized text, not a heading.Before you finish, list any raw color or px values you had to add.
That last line earns its keep. Asking the model to self-report any direct values means that when something outside the token set sneaks in, it flags it, and decides whether to add it to tokens.json or swap it for an existing variable. Treat the handoff as "reassemble from existing parts," not "generate from scratch," and the results get a lot steadier.
Step 5: Align and verify
Whether the generated UI has drifted from the rules is faster to check by machine than by eye. A small scan catches raw hex and raw px in components.
// scripts/check-tokens.mjs — detect inline values in componentsimport { readFileSync, globSync } from "node:fs";const files = globSync("src/components/**/*.{tsx,css}");const hexRe = /#[0-9a-fA-F]{3,8}\b/; // raw hex colorsconst pxRe = /:\s*\d+px/; // raw px (not via var())let violations = 0;for (const file of files) { const lines = readFileSync(file, "utf8").split("\n"); lines.forEach((line, i) => { if (line.includes("var(--")) return; // variable references are fine if (hexRe.test(line) || pxRe.test(line)) { console.log(`⚠️ ${file}:${i + 1} ${line.trim()}`); violations++; } });}console.log(violations === 0 ? "✅ no inline values" : `🛑 ${violations} inline values found`);process.exit(violations > 0 ? 1 : 0);
Run it in CI or a pre-commit hook and you stop "that slightly-off Claude Design color" from reaching production. I used to do this by eye and left dark mode with one mismatched radius for two weeks. Verification is cheapest when it's early.
Where this trips you up
A few things I actually hit:
Symptom
Cause
Fix
Generated color is "close but wrong"
Tokens duplicated; one copy is stale
Eliminate raw hex, unify on var(). Watch with check-tokens.mjs
Only dark mode breaks
An explicit color overrides data-theme
Route all color through variables; switch values at the variable definition
Palettes blend across sites
Rules aren't in context
Put rules in each repo's CLAUDE.md and switch with /cd
New spacing values multiply endlessly
Inlined per component
Add new values to tokens.json first; stay on the scale
Whether to use the newest model is a separate question from this setup. Even with Fable 5 now reachable from Claude Code, I keep Opus 4.8 as my default and only try a new model on part of the implementation. With the source of truth unified, anything you generate lines up regardless of model — so there's no rush on model choice.
Your next step
Don't start with a tour of the new feature. Count how many raw hex values are in your current project right now: grep -rn '#[0-9a-fA-F]' src/components. That number is exactly how much room there is for design and code to drift. The more of it you move onto tokens.json-backed variables, the more naturally the Claude Design / Claude Code handoff works. I haven't finished migrating every component myself, but unifying the source of truth — unglamorous as it is — has steadily cut the round trip.
Share
Thank You for Reading
Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.