Why us?

Behind every great website is a
great team
.

We have built 150+ websites for marketers and global brands.

Services
Technologies
About us

Why us?

Behind every great website is a
great team
.

We have built 150+ websites for marketers and global brands.

Illustration of building a HubSpot website with Claude Code: branded glass plaques connect to a reusable page layout.

Guide

How to Build a HubSpot Website with Claude Code

Table of Contents

Build a HubSpot website with Claude Code using reusable modules, editable page fields, and a sandbox workflow for testing before release.

You have an approved design and need to turn it into a website your marketing team can edit. Building a HubSpot website with Claude Code works best when you give the agent the theme, the design rules, and one clear page to start with.

Claude can help write the modules, styles, and templates. HubSpot then provides the fields and page editor for day-to-day content changes. Start with one service or campaign page, check the editing experience, and reuse the working pieces across the website.

This guide uses a classic HubL theme: HTML, HubSpot’s templating language, CSS, and JavaScript. You will need Claude Code, access to the theme files, and a HubSpot test account or CMS developer sandbox. For an existing website, ask its developer for the current repository and release process.

1. Connect Claude Code to HubSpot

Install Claude Code and a supported Node.js version, then open a terminal in your website project folder. Install the HubSpot CLI and authenticate with your test account:

npm install -g @hubspot/cli
hs account auth
hs account list
hs account info

Follow the authentication prompts and give the test account a recognizable name, such as my-sandbox. Check its account ID before uploading anything. Keep the access key in the CLI’s authentication flow, outside your prompts and repository.

Next, install the HubSpot Developer MCP server for Claude Code:

hs mcp setup

Select Claude Code, complete setup, and restart Claude Code if it is already open. Run /mcp and check that HubSpotDev is connected. This is the local development connection for CMS tools and documentation; the HubSpot CRM connector serves a different workflow.

Claude Code MCP panel showing the HubSpotDev server with a connected status.
Look for HubSpotDev and its connection status in Claude Code. Screenshot: HubSpot documentation.

If you are starting a new website, use HubSpot’s theme boilerplate as the foundation. For an existing site, work from its current theme so Claude can reuse the modules and styles already there.

2. Give Claude the design and project rules

Supply the approved copy, images, design file or screenshots, and a page to use as a reference. If the design still needs work, follow our Claude design guide before starting the HubSpot build.

Keep recurring instructions in a CLAUDE.md file at the project root. Include the theme folder, test account ID, fonts and colors, naming conventions, and release process. Claude Code reads this file when working in the project.

Begin with an inspection prompt. Replace the bracketed details with your own:

Read CLAUDE.md and inspect this HubSpot theme.
We need a [service page] using the attached design and approved copy.
Map each section to an existing module or reusable section.
List anything that needs a new option or module.
Confirm the test account is [account name and ID].
Do not change files or upload anything yet.

The response should name real files and explain which parts can be reused. A useful page plan might be a hero, three benefits, an image-and-text section, an FAQ, and a final CTA. Resolve missing copy or unclear design details before asking Claude to build.

3. Build modules with editable fields

A HubSpot module is a reusable piece of a page. Its content should have clear fields: a heading, body text, image, button label, and link. A benefits module can use a repeatable group so editors can add or reorder cards.

For a classic module, fields.json defines those controls, module.html renders them, module.css handles styling, and meta.json describes the module. Add module.js when interaction requires it. HubSpot’s module file reference explains the structure.

HubSpot documentation example showing fields.json, meta.json, module.css and module.html inside a custom module folder.
A module keeps its fields, markup, and styles together. Screenshot: HubSpot documentation.
Build the benefits section from the approved design on a new Git branch.
Reuse the existing card module if it fits. Otherwise create benefit-cards.module.
Make the heading, intro, card text, images, and links editable in HubSpot.
Use the theme’s existing typography, colors, spacing, and button styles.
Keep the current appearance of existing module instances unchanged.
Include a reusable section and make the cards stack on small screens.
Work locally for now. Show the changed files when finished.

Keep the controls understandable. Group content and styling separately, use descriptive labels, and expose the options an editor needs. A new layout option should preserve the current default on pages already using that module. HubSpot’s field guidelines are a useful reference.

4. Assemble the page in your test account

Upload the reviewed theme files to the test account. For example, with a local folder named my-theme and an authenticated account named my-sandbox:

hs cms upload ./my-theme my-theme --account=my-sandbox

Replace both names with your own. The CMS upload command sends theme code to that account; creating and filling a website page is a separate step.

In HubSpot, go to Content → Website Pages → Create. Select your theme and a suitable template. Use its drag-and-drop area to add the sections, then fill the content fields. Claude can prepare a reusable page layout for this:

Prepare a service-page template using the approved section plan.
Use native HubSpot drag-and-drop areas and our existing modules.
Keep the header and footer shared. Make page copy and images editable.
Reuse this template for pages with the same structure.
Tell me which template to choose and which fields to fill in HubSpot.
Keep production unchanged.

Keep reusable theme code in Git and each page’s content in HubSpot. Once an editor has customized a page’s layout, changing the template’s starting content is not a reliable way to update that page. Read its current content before making later changes.

This illustrated example shows the workflow: the module defines the structure, an editor changes the heading, and the same cards adapt to a phone layout.

5. Test the page and its editing experience

Open Preview in HubSpot and check desktop, tablet, and phone layouts. Then change a heading, replace an image, and reorder a card in the editor. Save and reopen the preview to confirm those fields control the result.

Review [test page URL] against the approved design at 1440, 768, and 390 pixels.
Check text wrapping, image crops, links, keyboard controls, and sideways scrolling.
Check that the content can be changed through the HubSpot fields.
Review other test pages that use any module we changed.
Report what you verified, what failed, and what you could not test.
Do not deploy to production or publish production pages.

If Claude cannot access the browser or editor, complete those checks yourself. For forms, use a test form and verify submission storage, confirmation, and notifications. A working button or success message alone does not prove the integration works.

Set the page title, meta description, language, and final URL in HubSpot. Use our B2B website design checks to review the message and next action as well as the layout.

Release through your team’s normal process after review. Shared module and CSS changes can affect published pages as soon as the code is deployed, even when your new page remains a draft. Publish or update the page content separately, then check the live result.

You now have a pattern for the next page: reuse the modules, supply new content, and test the result. The same principle of keeping the result editable also appears in our guide to turning a Claude design into an Elementor website. The platform changes; the team still needs a website it can maintain.

Picture of Roman Vlčák

Roman Vlčák

An incorrigible perfectionist passionate about pixel-perfect work, who constantly strives to deliver the highest possible quality. Outside of Webgate, he is a caring husband and father to his young son. In his free time, he likes traveling with his family and doing puzzles.

Senior WordPress Developer • Co-founder

Share this article

Let's work together!

Get a free consultation with our experts

Subscribe to our quarterly newsletter and receive latest insights.

Topics: Improving B2B websites, AI tools in web development, UX/UI, website marketing trends etc.

By submitting this form you agree to the processing of your personal data according to our .

Contact

Let's work together!

Get a free consulting call with our experts

Book a call with
Webgate founders

Thank you for your interest!

We will contact you soon.