Publish a website with Claude Code
Claude Code can build your site and put it online in the same session. site.link hosts the built folder at your address, and every later publish replaces it.
What you need
- site.link added to Claude Code.
- A static site: HTML, CSS, JavaScript, images and fonts.
1. Build the site
site.link hosts the built files, so it needs a folder with an index.html at the top. Most tools make one with their build command:
| Site | Build | Folder |
|---|---|---|
| Plain HTML | None | The folder with index.html |
| Vite | npm run build | dist |
| Astro | npm run build | dist |
| Next.js | output: "export", then npm run build | out |
Static files only: anything that needs a server, like API routes or server-side rendering, won't run. You don't have to run the build yourself. Claude Code can do it in the next step.
2. Ask Claude to publish the folder
With site.link added to Claude Code, ask in your project's folder:
> Build this site and publish it at mycafe.site.link $ npm run build sitelink: get_upload_url $ cd dist && zip -qr ../site.zip . && curl -sS -T ../site.zip "https://mcp.site.link/upload/…" Published. https://mycafe.site.link is live.
site.link gives Claude a one-time upload link that works for 15 minutes. Claude zips the built folder, uploads it, and the reply says whether the site is live. The limit is 100 files and 10 MB.
3. Publish again after changes
After you change the site, ask Claude to build and publish again. Each upload replaces the whole site, and site.link keeps the version before it while the new one rolls out.
To make it automatic, add a line to your project's CLAUDE.md file, which Claude Code reads in every session:
If something goes wrong
- Too big. Shrink large images, and leave out source maps and files the site doesn't load.
- A blank page or missing styles. Check that Claude published the built folder, not the source, and that the site expects to live at the top of its address, not in a subfolder.
- The upload link expired. Ask Claude to publish again. It gets a fresh link.
- The name points at a ChatGPT Site. Claude asks before it moves the name to the files you publish. Say yes only if you want the address to stop showing the Site.
- The publish was refused. Pages that ask for passwords or card details can't be hosted.