To build a website with Claude Code, write a CLAUDE.md brief about your business, then describe the site you want. Claude Code builds the pages on your computer, you preview them in a browser, review every change, then host the site. I build client websites this way, and the path below works whether you want a static site or keep WordPress. If you're new, learn Claude Code with my step-by-step course.
How do you build a website with Claude Code?
You build a website with Claude Code by writing a brief, describing the site, and reviewing what it makes. Anthropic calls Claude Code an agentic coding tool that reads your codebase, edits files, runs commands, so it does the typing. Start with one page, then add more.
You don't need a coding background. A Reddit user on r/ClaudeAI wrote "I have very little software background" and still built and launched a project by starting small.
Quality is the catch. A Reddit user on r/ClaudeCode said the sites "technically work, but they lack that polished, intentional feeling". Your facts, your brief and your review are what close that gap.
Gather these before your first Claude Code session
Have these ready before Claude Code writes a single page:
-
A paid Claude plan. The Claude pricing page lists Pro and Max among the plans that include Claude Code, and the free plan doesn't.
-
Claude Code installed. On a Mac, the install line in Anthropic's docs is
curl -fsSL https://claude.ai/install.sh | bash, and Windows has its own. -
A desktop app or VS Code, if a terminal feels foreign. Claude Code runs in both.
-
An empty project folder on your computer, one per website.
-
Your real facts: services, service area, phone number, photos and reviews from real customers.
-
A domain name registered in your own name.
Claude Code builds the files and you decide what goes live
Claude Code writes the files
It writes the HTML and CSS, runs the commands, and repeats the dull work across every page you ask for.
The owner decides what is true
Who the site is for, which services lead, and what each page asks a visitor to do. Claude Code can't know your business unless you tell it.
Claude Code drafts the copy
It drafts headings, page text and image descriptions from your brief. Treat every line as a draft you correct with real facts.
The owner approves what goes live
Brand, offers, promises and launch dates stay your call. Nothing goes live until you've read it on a phone and a laptop.
Six steps to build a website with Claude Code
- Make a project folder. In a terminal, type
cd your-projectand thenclaude. The first time, Claude Code asks you to log in. - Write the brief. Run
/initfor a starting CLAUDE.md, then add your business facts and rules from the next section. - Describe one page. Ask for a home page with your services, area, reviews and phone number. Name a site you like and say why.
- Preview it locally. Open the page in your browser, or ask Claude Code how to preview it. Check it at laptop and phone widths.
- Plan before big changes. Press Shift+Tab until the status bar shows plan mode. Claude Code reads the files and writes a plan, and edits nothing until you approve.
- Review, then host. Read each change and screenshot every page before launch. Then put the files on a host under your own domain.
Put your business facts in the CLAUDE.md brief
Per Anthropic's memory docs, Claude reads CLAUDE.md at the start of every session, so put these in it:
-
Who you serve, where, and the services you sell, in your own words.
-
Facts Claude Code must never change: business name, phone, address and any license you actually hold.
-
Your tone, with two or three lines of copy you like.
-
Design rules: colors, fonts, button style and one sample page to match.
-
Working rules, such as "plan first", "never publish" and "screenshot every page before you call it done."
-
Fewer than 200 lines, the length Anthropic's docs suggest for each CLAUDE.md file.
-
No passwords, API keys or logins. A project CLAUDE.md is meant to be shared through source control, so anything in it can travel.
Static site or WordPress for Claude Code websites
A static site fits a simple business site
Plain HTML and CSS files, with no database or plugins to update. Spearleaf's own site works this way, and I make text changes in Claude Code.
WordPress fits a team that edits often
Staff get a dashboard they already know. You also take on a database, updates for core, plugins and themes, and more to protect.
The person who edits later decides it
If you edit the site yourself and rarely, a static site keeps things simple. If three people post every week, keep WordPress.
A working WordPress site can stay
If your WordPress site already brings calls, you don't need to rebuild it. Claude Code can help through WordPress's own tools, covered next.
Edit an existing WordPress site safely
- Back up first. WordPress's backup guide says a backup has two parts, the database and the files. You need both to restore.
- Work on a copy. Make a staging copy of the site and let Claude Code change that one, never the live site.
- Use an Application Password. WordPress has shipped them since version 5.6. Create one on the Edit User screen instead of sharing your admin password.
- Connect through the REST API. The WordPress REST API lets applications create and change content. Send those requests only over https.
- Save drafts, not live posts. Ask Claude Code to save every new page as a draft. You read it in the dashboard and publish it yourself.
- Keep everything updated. WordPress's security guide calls keeping core, plugins and themes up to date the most important security step.
My Claude Code setup for client websites
I build client websites in Claude Code, and Spearleaf's own site is a static site I work on there. Three habits do most of the work.
A rules file holds the brand, the facts and the things Claude Code must never do. A design system keeps every page using the same colors, type and buttons.
Then I screenshot every page before anything goes live, at phone and desktop width. The Claude Code skills I use for SEO run the same way, written down once and reused.
Hosting a static site under your own domain
A static site is a folder of files, so any host that serves static files can run it. I found no Anthropic guide to deploying a website with Claude Code, so follow your host's own docs. Ask Claude Code to walk you through those steps one at a time.
Register the domain in your own name, and keep the host login in your own account. The site stays yours whoever works on it next.
Ask Claude Code to put the project under version control with git, so every change has a way back. Plan for forms and online booking, since a static page needs an outside service for those.
What every Claude Code website still needs
Watch my video on what small business websites include at three budgets for the basics that matter whoever builds the site:
-
A page for each service you want calls for.
-
A clear title and description on every page, both checked by my free website grader.
-
Real reviews from real customers, shown near the call button.
-
Fast loading on a phone, tested on a real phone.
-
A booking or call button on every page.
-
Copy that says what you do and where, as in what makes a good contractor website.
-
Search basics after launch, which my guide to Claude Code for SEO picks up.
Keep passwords out of chats and backups on hand
A Reddit user on r/Wordpress would "never give AI access to a live website," so work through this checklist:
-
Never paste a password, API key or login into a chat with Claude Code.
-
Keep secrets out of CLAUDE.md. Claude reads it every session, and a project copy is shared through source control.
-
Turn permission prompts on. Press Shift+Tab until the status bar shows manual mode, and Claude Code asks before most edits and commands.
-
Skip the bypassPermissions mode, which Anthropic's permission docs reserve for isolated environments.
-
Build and test on a separate copy before anything touches the live site.
-
Back up the live site before every change, and check that the backup opens.
-
Read every change before you approve it, then screenshot each page at phone and laptop width.
-
Make the brand, offer and go-live calls yourself. Claude Code proposes, and you decide.
Run your own website with Claude Code
My Claude Code training walks you through this setup, and it comes with ready-made skills. The site stays yours, and you do the work yourself.
- Start here: Claude Code for SEO.
- Next step: Claude Code skills for SEO.
- Compare costs: what a small business website costs.