Copenhagen --:--

Book a call

Build it yourself

How to Build a Website with Claude, Astro and Sanity: Where to Start

Build a fast custom website yourself with Claude Code, Astro, Sanity and Cloudflare: what you need, the order to do it in, and what to expect.

By Henrik Pultz Melbye ·

This website started as a text file. Before any code, I wrote down who the site is for, which pages it needs and what each page has to say. Then I opened Claude Code and asked it to help me build it on Astro, Sanity and Cloudflare.

The site you are reading now is the result. The starlings, the sky, the sound, the blog. I have built websites in Webflow for years, so I was not starting from zero. But a lot of what I did here, you can do too, even if you have never written a line of code. This post is about where to start and what to expect.

What the three tools do

Astro makes the pages. It turns your content into plain, fast HTML. Nothing loads in the visitor's browser unless it needs to.

Sanity holds the content you want to change yourself: blog posts, case studies, team members, opening hours. You edit it in the browser, in something called the Studio, without touching the design.

Cloudflare hosts the site. It serves your pages from a server close to whoever visits. For most small sites, the free plan is enough.

Claude Code writes the code with you. You describe what you want, it writes it, runs it and fixes it when it breaks. It works in the Claude desktop app and in the terminal.

How a blog post travels from Sanity, through Astro and Cloudflare, to a phone
  1. You write a post in the Sanity Studio and press Publish.
  2. Astro turns it into plain, fast HTML pages.
  3. Cloudflare serves the pages from a server close to whoever visits.
  4. The visitor gets the page on their phone. Claude Code wrote the code that ties it together.

Why not just use Squarespace, Wix or Webflow? You can, and for some people that is the right choice. If you want to drag things around in a visual editor, use a site builder. But with Astro and Sanity you get a site that is fast, that looks exactly how you want, and that you own completely. There is no monthly site-builder plan and no template you have to fight.

What you need

  • A paid Claude plan (Pro or higher), which includes Claude Code
  • A computer (Mac or Windows)
  • A free GitHub account, where your code is saved
  • A free Cloudflare account, for hosting
  • A free Sanity account, for the content
  • A domain name, when you are ready to go live

You don't need to install everything yourself first. Ask Claude what is missing and it will help you set it up, one step at a time.

Start with the words, not the code

This is the part most people skip, and it is the part that matters most. Before you ask Claude for anything, write down:

  • Who the site is for, and what they need to find
  • Which pages you need (fewer than you think)
  • What each page has to say, even in rough notes
  • What you will want to change yourself later, and what will stay the same

Claude is very good at building what you ask for. It is not good at knowing what your business needs, because you haven't told it. If you start with "make me a website for my bakery", you get a website for a bakery. Any bakery.

A plan in a text file also gives Claude something to come back to. I kept mine next to the code, and when a session got long I could point to it instead of explaining everything again.

The order I would do it in

1. Set up the project

Make a folder, open it in Claude Code and ask it to set up a new Astro project. Ask it to explain what each step does. You don't need to understand everything, but you should know roughly where things are.

Then ask Claude to put the project on GitHub. From now on, every working step gets saved there. More about why in the next post.

2. Get one page live

Before you build the whole site, get a single, ugly page online on Cloudflare. Claude can connect the GitHub project to Cloudflare, and then every change you save goes live on a test address by itself.

It sounds backwards, but it takes the scary part out of launch day. You find out early that hosting works, and you can check the site on your phone from the start.

Setting up an Astro project with Claude Code and putting the first page online
  1. Make a folder, open it in Claude Code and ask for a new Astro project.
  2. Claude runs the commands and the project files appear.
  3. Ask Claude to save the project on GitHub.
  4. Connect GitHub to Cloudflare: one ugly page is live on a test address, and you can open it on your phone.

3. Build the pages one at a time

Start with the homepage. Get the structure and the words right first, then the design. Ask for one section at a time, look at it, and say what is wrong.

Check it on your phone after every bigger change. Claude checks its own work in a preview, but it does not hold your phone.

A small tip that saved me a lot of trouble: keep the facts in one place. On this site, prices, email and phone number live in one file. Every page reads from there. When I changed my prices, I changed one number, and it changed everywhere.

Building a homepage one section at a time, checking each on a phone
  1. Ask for one section: the top of the homepage.
  2. Look at it on your phone, and say what is wrong: "The heading is too big on my phone."
  3. Claude fixes it. Then the next section.
  4. Keep the facts in one file. Change the price once, and every page that shows it changes too.

4. Add Sanity when the structure is stable

Not everything needs a CMS. Your About page probably changes once a year, and Claude can change it for you in a minute. Sanity is for the things you will add or edit often, like blog posts, projects or events.

Ask Claude to set up a Sanity Studio and connect it to the site. Then add your first post in the Studio and check that it shows up. When I moved this blog from Webflow to Sanity, Claude moved all nine posts, kept their old addresses and set up the Studio, so I can write new posts in the browser.

One thing to know: a static Astro site only shows new content after it is built again. Ask Claude to set up a webhook, so publishing in Sanity rebuilds the site by itself.

Publishing a post in Sanity, and a webhook rebuilding the site
  1. Write the post in the Sanity Studio and press Publish.
  2. A webhook tells Cloudflare that something changed.
  3. Cloudflare builds the site again with the new post.
  4. A minute later, the post is live.

5. The details before launch

This is where the time goes. Page titles and descriptions. A sitemap. Images that are not too big. Alt text. A contact form that actually sends email. Redirects from your old site, if you have one, so Google and old links still find your pages. A 404 page.

Ask Claude to go through the list with you. Then check the things it can't check: does the form arrive in your inbox, do the links work on your phone, does the text read well.

6. Connect your domain

When everything works on the test address, connect your domain in Cloudflare. Claude can walk you through the settings, but you click the buttons yourself, because it is your account.

How to talk to Claude

  • One thing at a time. "Make the header smaller on mobile" works better than a list of ten changes.
  • Describe what you see, not what you think the fix is. "The menu covers the heading on my phone" is better than "add more padding".
  • Send screenshots. A picture of the problem is faster than explaining it.
  • Ask it to explain. "Why did you do it that way?" is a good question. Sometimes the answer is a good reason. Sometimes Claude changes its mind.
  • Save after every step that works. Ask Claude to commit to GitHub. Then you can always go back.

What to expect

The first version comes fast. Within an evening you can have something that looks like a website. That part feels like magic.

The last part is slow. Spacing on small screens, a form that sends email, the right titles for Google, the page that looked fine until you added real text. Expect to spend most of your time there, and expect it to take weeks of evenings rather than one weekend.

Things will break. Something that worked yesterday will stop working. The animation that runs fine in the preview does nothing on your own screen. That is normal, and it is fixable. I wrote a separate post about what to do when it breaks or you get stuck.

The cost is low. A Claude plan, a domain, and for most small sites the free plans at Cloudflare and Sanity. What it costs instead is your time.

Is it worth it?

For a lot of people, yes. You end up with a site you understand, that you can change whenever you want, and that nobody can lock you out of. But it is not for everyone, and sometimes it is cheaper to pay someone. I wrote about that too: build it yourself or hire someone.

If you would rather have it built for you, that is what I do. I build custom websites on Astro, Sanity and Cloudflare, and I also help by the hour if you are building it yourself and get stuck. Get in touch.

So hand it to one

Get your next build off your plate

Send the Figma file. Get a fixed price. Hand your client a site you're proud to put your name on.

Book a free discovery call

30 minutes. Free. We talk about your agency, your typical projects, and how a partnership could work. If it's not a fit, I'll say so.

  1. You tell me about your agency and your dev bottleneck
  2. We talk through your typical project types and volume
  3. I explain how I work with agencies and what it costs
  4. If it makes sense, we start with one trial project
Book a 30-min call

Or just write hello@attabird.com or call +45 28 90 88 75.

attabird is a Copenhagen-based web development studio run by Henrik Pultz Melbye. It is a white-label Webflow development partner for agencies in the Nordics, Europe and the US, moves sites off WordPress, Wix and Squarespace, and builds custom websites on Astro, Sanity and Cloudflare.

Not ready for a call? Get a fixed quote.

Send the Figma link, or the site you want replaced, and I'll reply with a fixed price and timeline within 24 hours on working days.