Meta Astryx With Claude Code, Tested: A Third of the Code, Four Times the JavaScript

Meta Astryx With Claude Code, Tested: A Third of the Code, Four Times the JavaScript

Meta Astryx is the open-source design system everyone is talking about this week, and its main pitch is that AI coding agents can build with it as well as people can. We wanted to see what that means in practice, so we gave Claude Code the same dashboard brief twice: once with plain CSS, and once with Astryx installed.

This post shows how to set up Meta Astryx with Claude Code in a few commands, then what the test found. Both builds worked. The differences were in code size, speed, bundle weight and how the page behaves on a phone.

Quick verdict

Astryx did what it promises. Claude wrote 503 lines instead of 1,661, used 14 ready-made components, and the Astryx checker passed the result with no failures.

The cost was real, though. The Astryx run took twice as long, made 51 turns instead of 14, and shipped about four times the JavaScript. On a 390 px phone, its table scrolled sideways and cut long names short, where the plain build switched to readable cards.

If your team wants every screen to look the same and is fine with a heavier bundle, Astryx with Claude Code is a good fit. For a small one-off page, plain CSS was faster, lighter and just as accessible in our test.

Results card comparing plain React and Meta Astryx dashboards built by Claude Code
Our scorecard. Both builds passed every hard requirement; the differences are in size, time and phone layout.

What Meta Astryx is

Astryx is a React design system that grew inside Meta over eight years. According to its GitHub repository, it powers more than 13,000 internal apps. It is MIT licensed, still marked as beta, and has close to 27,000 stars.

It ships 150+ components, seven themes, dark mode, page templates and a command-line tool. It needs React 19 or later, and its styles are written with StyleX, though you can override them with plain CSS or Tailwind.

The part that matters for Claude Code is the CLI. It can search components, print their docs, scaffold templates, and run a doctor check on your source and build. The official docs describe it as one reference for people and agents alike.

How to set up Meta Astryx for Claude Code

Start in an existing React 19 project, for example one made with Vite. Install the core package, a theme and the StyleX peer dependency:

npm install @astryxdesign/core @astryxdesign/theme-neutral @stylexjs/stylex
npx astryx theme add neutral

The second command writes src/astryx-themes.js, which you pass to the Theme component. Then import the two base stylesheets once, in your entry file:

import '@astryxdesign/core/reset.css';
import '@astryxdesign/core/astryx.css';

Now give Claude Code the Astryx instructions. This command writes them into the project only:

npx astryx init --agent claude
Terminal output of npx astryx init --agent claude writing .claude/CLAUDE.md
The init command writes .claude/CLAUDE.md in the project and prints the next steps.

The file it writes, .claude/CLAUDE.md, is short and strict. It tells Claude to start from a template, use Astryx components instead of raw <div> elements, use theme tokens instead of hard-coded colors, and run astryx doctor --built before calling the work done.

There is also a global option, init --user, which installs an Astryx skill for every project on your computer. We skipped it on purpose. A project-level file keeps Astryx rules out of projects that do not use it.

Claude uses the CLI to look things up as it works. You can try the same search yourself:

npx astryx search "sortable table" --limit 3
Astryx CLI search results for sortable table showing a hook and two templates
Search results for “sortable table”: a sorting hook, a block template and a page template, each with the command to read more.

When the build is ready, the checker reads both the source and the built files:

npm run build
npx astryx doctor --built .
astryx doctor output showing 20 passed checks, 3 warnings and 0 failures
The doctor report for Claude’s Astryx build: 20 passed, 3 warnings, 0 failures.

All three warnings came from the generated theme file, which loads the Figtree font from Google Fonts. Claude saw that and chose not to import that file, so the warnings did not affect the shipped page.

How we tested it

We wrote one fixed brief for an orders dashboard: a header with four summary figures, a sortable table with a status filter and search, long labels that hold up at 1280 and 390 px, empty and error states with a Retry button, full keyboard use with a skip link, and a light and dark switch.

Both runs used the same Vite and React 19 starter, the same 36 sample orders and the same model, Opus 5.5. The only difference was one line in the prompt. The plain run was told to write its own CSS. The Astryx run was told to use the installed design system and read .claude/CLAUDE.md.

Flow diagram of the test: one brief built with plain React and with Meta Astryx, then built and checked in Chrome
Same brief, same model, same data. Only the design system changed.

Each build was then served locally and scored in headless Chrome. The script checked layout at both widths, network calls, color contrast in both themes, tab order and focus, keyboard sorting, the filter, and all three states.

The results

CheckPlain React + CSSMeta Astryx
Build time and API cost3m 12s, $0.716m 5s, $1.47
Turns and output tokens14 turns, 22.2k51 turns, 21.7k
Source code written1,661 lines, 24 <div> tags503 lines, 0 <div> tags
JavaScript shipped (gzipped)73 KB300 KB, plus 106 KB of lazy chunks before gzip
CSS shipped (gzipped)3.5 KB48 KB
Text below WCAG contrast0 in both themes0 in both themes
Keyboard, skip link, visible focusPassed, 10 stopsPassed, 10 stops
Long names at 390 pxWrap inside cardsCut with an ellipsis, table scrolls sideways
Error message in a live regionYesNo

Both builds compiled, made no network calls and logged no console errors. Both handled the empty, no-match and error states, and both sorted columns with Enter and Space.

Plain React and CSS orders dashboard built by Claude Code in dark mode
The plain build: summary cards, colored status chips and an orange accent Claude chose itself.
Meta Astryx orders dashboard built by Claude Code in dark mode
The Astryx build: flatter and more neutral, with status dots and the system’s own spacing and type.

The look is the clearest difference. Claude’s own CSS was more decorated. The Astryx page looks like a product from a large company, which is the point of a shared design system.

Both dashboards switched to light mode side by side
Light mode after flipping the switch. Both builds passed contrast checks in both themes.

What Astryx did well

The code was much smaller. Claude wrote about a third as many lines, with no raw <div> tags and no hand-written styles. It built the page from 14 components, including Table, SegmentedControl, Banner, EmptyState and Switch.

That matters for teams. Smaller code that uses shared components is easier to review, and a future change to the design system updates every screen at once.

The CLI also kept Claude on track. It made 27 Astryx CLI calls during the run to search components and read their docs, then ran the doctor check before finishing, as CLAUDE.md asked.

Where it fell short

The first cost is time. Looking things up took 51 turns, so the run took twice as long and cost about twice as much in API usage, even though Claude wrote about the same number of tokens.

The second is weight. The Astryx bundle was 934 KB of JavaScript before gzip and 297 KB of CSS, against 238 KB and 12.5 KB for the plain build. A design system pulls in more than one page needs, and this one is still in beta.

The third showed up on a phone. The plain build turned the table into stacked cards. The Astryx build kept the table, so it scrolled sideways inside its box and cut long names with an ellipsis, with no tooltip to show the full text.

Phone view at 390 px: plain build shows stacked order cards, Astryx build shows a table cut off at the right edge
At 390 px the plain build stacks each order into a card; the Astryx table runs off the right edge.
Top of both dashboards on a 390 px phone screen
The top of both pages on a phone. Both fit the width without page-level scrolling.

There were smaller differences too. The Astryx skip link stays visible at all times instead of appearing on focus. Its error message is not placed in a live region once loading ends, so a screen reader may not announce it. The plain build used an alert region for the same message.

Error state of both dashboards with a Retry button
The error state. Both have a clear message and a Retry button; only the plain build announces it to screen readers.

None of these are hard failures, and all of them are easy to fix with one more prompt. They show that the design system does not replace checking the result.

Tips for using Astryx with Claude Code

  • Keep astryx init --agent claude at the project level unless you use Astryx everywhere.
  • Ask for a phone layout by name, for example “show the table as cards below 600 px”. Astryx will not choose that for you.
  • Run npx astryx doctor --built . after every build, and read the warnings.
  • Check your bundle size with npm run build output before you ship, especially for small pages.
  • Delete src/astryx-themes.js if Claude does not use it, or self-host its font.
  • Pre-approve the commands Claude needs, such as npx astryx and npm run build, so a long run does not stop for permission.

If you want other ways to steer Claude’s front-end work, our design skills test ran a similar brief with two popular skills, and the Skills Directory lists more you can install.

How we ran it and what we did not test

Each build ran once through claude -p with Opus 5.5, in a throwaway folder, with web search and subagents turned off. Claude could read and edit files and run npm run build; the Astryx run could also call the Astryx CLI. Nothing outside the test folder was changed.

During the Astryx run, a few compound shell commands Claude tried, such as chaining cat and grep, were blocked by the permission rules we set. Claude found other ways to get the same information, and the run finished normally. Some of the extra turns came from that.

We used Astryx CLI and core version 0.7.15 and the neutral theme. One run per build is a small sample, so treat the time and cost numbers as a rough guide. We did not test the other six themes, the template commands, server-side rendering or a larger app.

Final verdict

Meta Astryx with Claude Code works as advertised. The agent instructions and CLI got Claude to build a clean, consistent dashboard from shared components, with a third of the code and a passing doctor report.

For a team that already ships many React screens, that consistency is worth the extra time and bundle weight. For a quick single page, Claude’s own CSS was faster, half the price and lighter, and it made better choices on a phone without being asked.

Whichever way you go, check the result in a real browser. Both builds looked finished, and only testing showed where each one fell short. You can find more hands-on guides in our Claude Code tutorials.

Newsletter

New AI tools in your inbox

The best new tools and the AI news that matters, in one short email. Unsubscribe any time.

Free · No spam · Unsubscribe any time

✓ Looks like you’re subscribed

Loading Google’s sign-up form…

Looks like you’re already subscribed

Thanks for reading! New AI tools and the AI news that matters will land in your inbox.

Not subscribed yet? Refresh the page to load the sign-up form.

The sign-up form couldn’t load. If you use an ad or content blocker, allow news.google.com and reload the page.

Free instant check before you pay. Takes a few seconds.

Scroll to Top