Build websites with Claude Code
Scaffold with your framework CLI, add CLAUDE.md and a check Claude can run, then review every page before ship.
Published here · 7 sources · Resume reading
Building a site with Claude Code means the framework CLI owns the scaffold, Claude owns the edits, and your check owns "done". Astro's install docs start with npm create astro@latest (and the pnpm equivalent). Claude Code common workflows start in the project root with claude. [1] [2]
Related reading: Lock Claude Code out of your .env, Claude Code for content, Claude Code for design. Durable users: Review a Durable website before publishing is a different product path. [7]
Scaffold with the framework, then open Claude
npm create astro@latest
cd your-project-name
claudeYou should see the Astro wizard finish, then Claude Code attach to that folder. Use the same pattern for other frameworks: their create command first, Claude second. Asking Claude to invent a whole toolchain from an empty directory wastes the first session on version guesses. [1] [2]
Write a short CLAUDE.md Claude cannot infer
Best practices: only write what Claude cannot find by reading the repo, or what it would rediscover every session. Memory docs cover CLAUDE.md as project instructions the model reads. [3] [4]
Example shape (adapt to your stack):
# Site rules
- Run `npm run check` before claiming done.
- Never edit files under `dist/`.
- Content lives in `src/content/`; do not invent frontmatter fields.
- Deploy: push to main; Cloudflare Pages builds main.Put never-break rules (secrets, generated clients) into deny rules or hooks, not only prose. Settings docs cover permission precedence. [5] [3]
Give Claude a check, then a page job
Best practices split non-deterministic guidance (CLAUDE.md, prompts) from deterministic checks (tests, Stop hooks, CI). [3]
Add an About page using the existing layout. Keep the current color tokens.
When finished, run npm run check and fix failures before you stop.Common workflows also cover explore-first prompts ("give me an overview of this codebase") before large edits. Use that on unfamiliar templates. [2]
Review the rendered page before you merge
Open the preview URL on a phone width. Check the longest heading, the nav, and the primary CTA. Pair Claude Code for design when the change is visual, and Claude Code for content when the change is copy.
| Stage | Owner | Source |
|---|---|---|
| Scaffold | Framework CLI | Astro install [1] |
| Edits | Claude Code | Common workflows [2] |
| Project memory | CLAUDE.md | Best practices / memory [3] [4] |
| Secrets | Deny rules | Settings + env lock [5] [6] |
| Done | Your check + you | Best practices [3] |
You now have a website path that keeps scaffold and CI honest while Claude Code does the file work.
Send this to the builder who wants Claude Code on a real framework repo, not a blank prompt.
Keep this guide
Filed under Claude Code, Dev tools
Questions about this guide
Should Claude invent the project scaffold?
Prefer the framework's own create command (for example npm create astro@latest or create-next-app), then open Claude Code in that folder.
What belongs in CLAUDE.md?
Per Claude Code best practices, only what Claude cannot see from the repo: deploy steps, env vars, banned paths, and the check that means done.
How do I stop secret leaks?
Deny .env in settings and keep tokens out of chat. See Lock Claude Code out of your .env.
Is Durable the same as coding a site in Claude Code?
No. Durable is a separate AI website builder product. This page is repo-based Claude Code work.
Sources
- Astro install and setup, accessed 2026-11-26docs.astro.build
- Claude Code common workflows, accessed 2026-11-26code.claude.com
- Claude Code best practices, accessed 2026-11-26code.claude.com
- Claude Code docs: memory / CLAUDE.md, accessed 2026-11-26code.claude.com
- Claude Code docs: settings, accessed 2026-11-26code.claude.com
- Full Byte Developer: Lock Claude Code out of your .envfullbytedeveloper.com
- Full Byte Developer: Review a Durable website before publishingfullbytedeveloper.com