Build

How to build a website with Claude Code

Claude Code builds your site right in a folder on your computer: it creates the files, fixes them and checks its own work. You do not need to know how to code. You write to it in plain words, and type only a few commands, which are here to copy. By the end of this guide there is a one-page site in the folder that opens in your browser, and from there the way live is short.

What to know first

Terminal
The window where you type commands. On a Mac it is called Terminal, and on Windows you use PowerShell.
Project folder
The folder on your computer that holds the files of the site. Claude Code works only on the folder you open it in.
git
A tool that saves versions of your files, so you can go back to any version you saved.

What Claude Code is, and how it differs from a chat

Claude Code is a tool from Anthropic, the company behind Claude. In a regular chat, Claude gives you code that you copy and save yourself. Claude Code works inside a folder on your computer: it creates the files themselves, changes them, and runs checks.

It is available in the terminal, in the Claude desktop app and inside VS Code. This guide uses the terminal, because the commands are the same on every computer. If you would rather not use a terminal, you can work in the desktop app, and the messages below work there too.

What you need before you start

A Claude account on a paid plan, Pro or higher, or a Console account that pays by usage. The free Claude plan does not include Claude Code.

A Mac, Windows or Linux computer, and a quarter of an hour. One more thing saves a lot of rounds: a short paragraph that describes what you are building. The first lesson of the course teaches you to write it in ten minutes.

Step 1: install

Open the terminal. On a Mac, search for Terminal in your computer search, and on Windows, search for PowerShell in the Start menu.

Paste the command that fits your computer and press Enter: the first one for Mac and Linux, the second for Windows. When the install finishes, close the terminal window, open a new one and run the third command. If a version number appears, the install worked.

curl -fsSL https://claude.ai/install.sh | bash
irm https://claude.ai/install.ps1 | iex
claude --version

Step 2: an empty folder and the first run

Claude Code works on the folder you open it in, so you start from an empty folder meant only for the site. The three commands create a folder called my-site, go into it and open Claude Code there.

On the first run a browser opens so you can sign in to your Claude account. After you sign in, go back to the terminal, where a box to type in is already waiting.

mkdir my-site
cd my-site
claude

Step 3: the first message

Paste the opening, right after it the paragraph that describes what you are building, and send. The opening sets limits: one page, in plain files that open in any browser and go live with no preparation.

Before it creates a file or runs a command, Claude Code asks for your approval and shows what it is about to do. Read it and approve. After a minute or two there is an index.html file in the folder, and sometimes style files too.

Opening to paste before the description
Build a one-page site in this folder from the description below.
Plain HTML, CSS and JavaScript files, with an index.html file in the main folder, no build tools and no installs.
The page is in English, left to right, and looks good on a phone too.
No sign-up, no payment and no database.
All the text on the page follows the details in the description. Where a detail is missing, leave square brackets with what is missing, and do not make anything up.

The description:

Step 4: see the site and fix it

Open the my-site folder on your computer and double-click index.html. The page opens in your browser, the way a visitor will see it. To see how it looks on a phone, shrink the browser window until it is narrow.

First ask Claude Code to check its own work. Then fix whatever still bothers you, one request per message, and refresh the browser after each fix. When several changes go in one message and something breaks, it is hard to tell which one broke it.

Self check after the first version
Go through index.html and check three things: the page is in English and reads left to right, there is no made-up text or temporary filler, and nothing overflows to the side at the width of a phone. Fix what is wrong, and say briefly what you fixed.

Step 5: save points to go back to

Every message you send creates a point you can go back to. When a change breaks something, press Esc twice while the message box is empty, and choose from the list where to go back to and what to restore: the files, the conversation, or both.

These points do not replace saving a version. A change made through a command in the terminal is not always kept in them. So when the page looks good, ask Claude Code to save a version in git, and from then on every experiment is safe.

Save a version
Save a version of this folder in git, with a short message that describes what the page has now. If git is not set up in this folder yet, set it up first.

From your computer to live

The site works in the folder, but only on this computer. For anyone to visit it, it needs a server and an address.

The short way is to connect Claude Code to our hosting and ask it in the chat to launch the site. It checks the site on your computer, uploads it and returns an address. Ordering a server costs money, so it always waits for you to click an approval link that arrives by email. If you would rather not connect it, zip the folder and upload the file on the upload page.

Try it now

Install, open an empty folder, and send the opening with a short description of a real business or project. After a few minutes there is an index.html file in the folder that opens in your browser.

There is an index.html in the folder. When you open it in your browser, the page reads left to right, looks good in a narrow window too, and all the text is about the project. Whatever is missing is marked in square brackets.

If it did not work
  • The terminal does not know the claude command? Close the terminal window and open a new one so it loads the install, then try again.
  • Sign in does not go through? Check that the account is on a paid plan. The free Claude plan does not include Claude Code.
  • It asks before every file? That is how it works: it shows what will change first, then waits for your approval. Read it and approve.
  • It started installing packages or built a complicated project? Send it: "Keep only plain HTML, CSS and JavaScript files, with no build tools and no installs."
  • One fix broke something else? Press Esc twice, go back to the point before the fix, and send the request again, shorter.
  • Stuck? Send us a screenshot and we will help with the next step.

Connect Claude Code and go live

Check yourself

Answer in your head first, then open.

How is Claude Code different from Claude in a chat?

It works inside a folder on your computer: it creates and changes the files themselves, instead of giving you code to copy.

Why start from an empty folder?

Because Claude Code works on the folder you open it in. In an empty folder it is clear what belongs to the site, and it is also the folder the site goes live from.

What do you do when a change breaks something?

Go back to the point before the change by pressing Esc twice. When the page works, save a version in git, and you can go back to it tomorrow too.

Common questions

Do I need to know how to code?

No. You write to it in plain words. You type a few commands in the terminal, and they are in the guide to copy. If you would rather not use a terminal, you can work in the Claude desktop app.

Does Claude Code cost money?

It needs a paid Claude plan, Pro or higher, or a Console account that pays by usage. The free plan does not include it.

Does it work on Windows?

Yes. You install it with the PowerShell command, and the rest is the same: the same folder, the same messages.

Can I build more than one page this way?

Yes, but start from one page that works and add pages later, one request at a time. A small site that works beats a big site stuck halfway.

What about changes after the site is live?

Change it in the folder with Claude Code and upload again. When Claude Code is connected to our hosting, the upload is one request in the chat.

Continue from here