How to write Claude Code prompts for website changes
How to write Claude Code prompts for website changes

A good Claude Code prompt for a website change says five things: which pages or files to work on, exactly what should change, what must not change, how to check the result, and what to show you before editing anything. "Make the services page better" leaves Claude guessing on all five. "On /services/roof-repair/, rewrite the meta description to under 155 characters using only facts already on the page; list the old and new text and wait for my approval" leaves it guessing on none.
You don't need special syntax or magic phrases. Anthropic's own advice is to "talk to Claude like you would a helpful colleague," and to be specific: "The more precise your instructions, the fewer corrections you'll need." This guide turns that into a method for website work, with before-and-after examples, prompts for common jobs, and the things a prompt can't do for you, as of October 2026.
Key Takeaways
- Name the scope (pages, files or folders), the change, the limits, the check and the stopping point. Vague prompts trigger broad scanning, which costs time and usage.
- Ask for a plan or a list before any file changes. Plan mode, or starting a single prompt with /plan, makes Claude research and propose without editing your source.
- Give Claude a check it can run, such as a build, a link check or a screenshot, and ask it to show the evidence. Anthropic: "If you can't verify it, don't ship it."
- Rules that must always hold go in permission settings, not just the prompt. Anthropic warns that a boundary stated in conversation "can be lost if context compaction removes the message" (compaction is when Claude summarizes a long conversation to free space).
- If you've corrected Claude more than twice on the same issue, Anthropic suggests running /clear and starting again with a better prompt.
The five parts of a website prompt
| Part | What to say | Example wording |
|---|---|---|
| Scope | Which URLs, templates, files or folders | "Only the pages under /services/" |
| Change | What should be different afterward, in concrete terms | "Each page gets one H1 (main heading) that includes the service name" |
| Limits | What must not change, and where facts come from | "Don't change URLs, layout or body copy. Use prices only from docs/company-facts.md" |
| Check | How Claude proves it worked | "Run the build and confirm it passes; list every page you changed" |
| Stopping point | What to show you, and when to wait | "Show me the plan first. Don't edit until I approve" |
Not every prompt needs all five spelled out. A one-line typo fix doesn't need a plan. But the bigger the change, the more of these you should state, and the more each one saves you in review.
Before and after: vague versus specific
Anthropic's best-practices page shows the pattern with coding examples: scope the task, point to sources, reference existing patterns, and describe the symptom. Here's the same idea applied to website jobs.
| Vague | Specific |
|---|---|
| Fix our SEO | List every page whose title is missing, duplicated or over 60 characters. Output a table: URL, current title, problem, suggested title. Don't edit any files. |
| Add a testimonials section | Look at how the existing FAQ section is built on the homepage and follow the same pattern to add a testimonials section below it. Use the three quotes in @docs/testimonials.md exactly as written. Don't add any new libraries. |
| The contact form is broken | Visitors report the contact form shows an error after they click Send. Check how the form submits, find the cause, and explain it to me before changing anything. Don't send test submissions to the live inbox. |
| Update our hours | Our Saturday hours changed from 9 to 1 to 10 to 2. Find every place the old hours appear, including structured data (the schema code search engines read) and the footer. List them first; after I approve, update them all and rebuild. |
| Make the page faster | On the homepage, list the scripts, styles and images that load before the page first appears, and suggest the three changes most likely to help. Don't change anything yet. |
Anthropic notes that vague prompts have a place: "what would you improve in this file?" can surface things you wouldn't have thought to ask. Use them for exploration, then switch to specific prompts for the actual change.
Ask for a plan or a list first
The single most useful habit is to ask for a list or a plan before any file changes. Reviewing a list takes a minute. Undoing a bad site-wide edit can take a day.
- Plan mode. In the terminal, press Shift+Tab until the mode reads Plan, or start one prompt with /plan; in the desktop app, pick Plan in the mode selector. Typing the words "plan mode" in a prompt doesn't switch modes. Claude reads files and explores, then presents a plan for approval without editing your source. Our guide to Claude Code plan mode covers the approval options.
- "List first" in the prompt. End with "list what you'll change and wait for my approval." This works in any mode.
- Approve a sample. For repeated edits, ask Claude to do one page, show you the result, and wait. Then do the rest.
Anthropic's guidance is that planning helps most when you're unsure of the approach, the change touches several files, or you don't know the code. "If you could describe the diff in one sentence, skip the plan."
Give Claude a check it can run
Claude stops when the work looks done. Without a check, "looks done" is all it has, and you become the only test. Anthropic's advice: "Give Claude a check it can run: tests, a build, a screenshot to compare." On a website, useful checks include:
- The site's build command, which catches broken templates and syntax errors.
- A link checker run against the built site.
- A count: "confirm the old phone number appears zero times in the built site."
- A screenshot of the changed page at mobile and desktop widths, compared with the original.
Then ask for evidence, not reassurance: "paste the last lines of the build output" or "show me the count." Anthropic notes that reviewing evidence is faster than re-running the check yourself.
Point to files and sources instead of describing them
- Use @ to reference a file. Typing @ followed by a file name pulls that file into the conversation, so Claude reads it before answering.
- Keep business facts in one file. Prices, phone numbers, addresses and service areas belong in a single facts file that your prompts and CLAUDE.md point to. Claude can't know your new Saturday hours unless you tell it, and it can write a believable wrong one.
- Give URLs for rules. If a change depends on a platform rule or a law, give Claude the official page to read and ask it to quote the line it relied on.
- Attach a screenshot when describing a visual problem. The desktop app supports attaching images and PDFs.
Anything Claude writes about your business, its prices or a regulation is a draft until a person checks it against a primary source. Our guide to common Claude Code mistakes on websites shows what happens when that step is skipped.
Put permanent rules in settings, not just prompts
"Don't push" in a prompt is useful, but it isn't a guarantee. Anthropic's docs say a boundary stated in conversation "can be lost if context compaction removes the message," and that CLAUDE.md content is treated "as context, not enforced configuration." For rules that must hold every time, use the right layer:
| Where the rule lives | Good for | Strength |
|---|---|---|
| The prompt | Limits for this one task | Applies to this request; can be lost in a long session |
| CLAUDE.md | Project conventions and standing instructions | Loaded every session; guidance, not enforcement |
| Permission rules in settings | "Never read .env", "always ask before git push" | Enforced by Claude Code, not by the model, per Anthropic's permissions docs |
Our guide to writing a CLAUDE.md for a website covers the middle layer, and our templates page has a permissions file and eight copy-ready prompts for weekly website jobs.
For bigger jobs, let Claude interview you
For a new page type, a form or anything with many decisions, Anthropic suggests starting small and having Claude ask the questions. A website version of the prompt Anthropic publishes:
I want to add a quote request form to our service pages. Interview me in detail: ask about fields, where submissions go, spam protection, tracking, confirmation messages and edge cases. Don't ask obvious questions. When we've covered everything, write the spec to SPEC.md and stop.
Then start a fresh session to build from the spec (the written description of what to build), so the build session starts clean. Anthropic says the most useful specs name the files involved, state what's out of scope, and end with a verification step that proves the feature works.
When the answer is wrong
- Stop early. Press Esc the moment Claude heads the wrong way. Context is kept, so you can redirect.
- Undo. Press Esc twice on an empty prompt, or run /rewind, to restore an earlier point in the session.
- Start over after two corrections. Anthropic: "If you've corrected Claude more than twice on the same issue in one session, the context is cluttered with failed approaches." Run /clear and write a better first prompt that includes what you learned.
- One task per session. Mixing unrelated jobs in one conversation is what Anthropic calls "the kitchen sink session." Use /clear between them.
Specific prompts also cost less. Anthropic notes that vague requests "trigger broad scanning," while specific ones let Claude work with fewer file reads. More on that in our guide to keeping Claude Code costs under control.
Prompts for common website changes
These are illustrative. Replace the file names and details with your own.
| Job | Example prompt |
|---|---|
| Rewrite one page's meta description | On /about/, propose three meta descriptions of 120 to 155 characters using only facts on the page. Don't edit anything until I pick one. |
| Change a fact everywhere | Our email changed to hello@example.com. List every occurrence of the old address, including structured data and mailto links. After I approve, update them, rebuild, and confirm zero old occurrences remain. |
| Add a page from a template | Create a new service page for gutter cleaning by copying the structure of /services/roof-repair/. Use the copy in @drafts/gutter-cleaning.md. Show me the diff before committing. |
| Fix a layout bug | [screenshot attached] On mobile, the header menu overlaps the logo. Find the cause in the header styles, fix it, and take screenshots at 375 and 1280 pixels wide to compare. |
| Audit before editing | /plan List pages with more than one H1 heading or none at all. Table: URL, H1 count, current H1 text. Don't change files. |
For larger, repeated jobs such as rewriting titles across hundreds of pages, see our step-by-step on title and meta rewrites with Claude Code.
What a prompt can't do
A well-written prompt makes a good result more likely. It doesn't make the result correct. Claude can still misread a template, invent a plausible fact or change a file you didn't mention. The review step stays: read the diff, check the page on staging, and have a person approve anything that goes live. Our guide to reviewing a diff when you aren't a developer shows what to look for.
Conclusion
Write website prompts the way you'd brief a careful contractor: name the pages, describe the change, set the limits, ask for a plan or a list first, and give Claude a check whose result it has to show you. Put the rules that must always hold into permission settings, start fresh when a session goes sideways, and keep a person reviewing what ships. If you'd like your team to have a shared prompt library, CLAUDE.md and review routine, our Claude Code consulting includes that setup and training. More guides are in our Claude Code Guide.
Frequently asked questions
Do I need special wording or "prompt engineering" tricks?
No. Plain, specific English works best. Anthropic's quickstart says to talk to Claude like a helpful colleague, and its best-practices page says to be precise about files, constraints and what done looks like. The example prompts in this guide are illustrations, not magic words.
How long should a prompt be?
Long enough to cover scope, change, limits, check and stopping point for the size of the job. A typo fix might be one sentence. A new form might start with an interview prompt and a written spec.
Should I write prompts in CLAUDE.md?
Put standing project rules in CLAUDE.md, such as "work on a branch" or "facts come from docs/company-facts.md." Keep task-specific instructions in the prompt. A repeated multi-step procedure is better as a skill, a saved set of instructions that loads only when it's used.
Why does Claude sometimes ignore part of my prompt?
Long sessions, contradictory instructions and very long prompts all make it more likely. Split big requests into steps, use /clear between unrelated tasks, and move rules that must always hold into permission settings or hooks (scripts Claude Code runs automatically at set points).
Can I reuse the same prompt across sites?
Yes, with care. Swap in each site's file names, facts and build commands, and check that the site is built the way the prompt assumes. A prompt written for a Next.js site won't map cleanly onto a WordPress theme.
Put this into action with eSEOspace
We help businesses grow with seo, geo & aeo that actually performs. Explore the services behind this guide:
Get a FREE Audit
We'll perform a comprehensive SEO, AEO, GEO & CRO audit of your website — completely free — and show you exactly how to outrank your competitors.
Don't have a site yet? Get in touch →
Get a FREE GEO/AEO/SEO Audit
We'll analyze your site's SEO, GEO, AEO & CRO — completely free — and show you exactly how to get found across Google and AI answers.
Don't have a site yet? Get in touch →
Great — your audit is on the way!
We'll send your free SEO/GEO/AEO/CRO audit within the next few hours. Where should we send it?
You're all set! ✓
Your free audit is being prepared — check your inbox in the next few hours. Talk soon!
On this page
- Key Takeaways
- The five parts of a website prompt
- Before and after: vague versus specific
- Ask for a plan or a list first
- Give Claude a check it can run
- Point to files and sources instead of describing them
- Put permanent rules in settings, not just prompts
- For bigger jobs, let Claude interview you
- When the answer is wrong
- Prompts for common website changes
- What a prompt can't do
- Conclusion
- Frequently asked questions





