Multi-file Deploys
Instead of a single HTML string, you can deploy an entire file tree — separate HTML pages, CSS stylesheets, JavaScript modules, images, and fonts. Each file is uploaded and served from a CDN at its path under your subdomain.
The files Array Format
Pass a files array to the deploy or update tool. Each entry has:
| Field | Type | Required | Description |
|---|---|---|---|
path | string | Yes | File path relative to site root (e.g. index.html, css/style.css) |
content | string | Yes | File content (UTF-8 text or base64 for binary) |
contentType | string | Yes | MIME type (e.g. text/html, text/css, image/png) |
encoding | "utf-8" | "base64" | No | Use "base64" for binary files. Defaults to "utf-8". |
Example: Two-Page Site
deploy called with files:
- path: index.html contentType: text/html
- path: about.html contentType: text/html
- path: css/style.css contentType: text/css
- path: js/app.js contentType: application/javascriptYou would ask Claude to deploy this with something like:
"Deploy a two-page site — a home page and an about page — with separate CSS and JS. Use the slug 'my-site'."
The result:
Deployed successfully!
URL: https://my-site.based.page
ID: dep_abc123The files are served at:
https://my-site.based.page/→index.htmlhttps://my-site.based.page/about→about.html(orabout/)https://my-site.based.page/css/style.csshttps://my-site.based.page/js/app.js
Path Resolution
index.htmlat the root is served for/about.htmlat the root is served for/aboutand/about/- Subdirectory
index.html(e.g.blog/index.html) is served for/blog/ - All other paths are served at their exact path
Binary Files (Images, Fonts)
For binary files, encode the content as base64 and set encoding: "base64":
{
"path": "images/logo.png",
"content": "iVBORw0KGgoAAAANSUhEUgAA...",
"contentType": "image/png",
"encoding": "base64"
}Claude can handle base64 encoding automatically when given image data.
Updating a Multi-file Site
Calling update with a new files array replaces all existing files. If you want to keep existing files, include them in the new array.
"Update my-site — add a blog page and update the navigation links in index.html and about.html."
Claude calls update with all files including the new blog.html and the updated versions of the existing pages.
SPA Mode
For single-page apps built with React Router, Vue Router, or similar, enable is_spa: true:
deploy called with:
files: [{ path: "index.html", ... }, { path: "assets/app.js", ... }]
is_spa: trueWith is_spa enabled, any 404 request falls back to index.html, allowing client-side routing to handle the path.
See React & Frameworks for a full React deployment example.
Common MIME Types
| Extension | Content-Type |
|---|---|
.html | text/html |
.css | text/css |
.js | application/javascript |
.json | application/json |
.png | image/png |
.jpg | image/jpeg |
.svg | image/svg+xml |
.woff2 | font/woff2 |
.ico | image/x-icon |
Notes
- File paths must not start with
/. Useindex.html, not/index.html. - There is no maximum file count, but keep individual file sizes reasonable (under 10MB each).
filesandhtmlare mutually exclusive in a single deploy call.- When updating, the new
filesarray completely replaces the previous file set.