How to edit your website with Claude, ChatGPT or Grok, with prompts you can copy

An AI assistant can make most of your site edits for you, safely, if you set it up right. The three ways to work, five rules, and the prompts we actually use.

Londynn Metten

· 9 min read

You’ll end up with

Site edits made by an AI assistant, checked on a preview, live on your site

Time
10 minutes an edit
Cost
Free, or $20 to $30 a month
Level
Beginner

The short answer

You can edit a Next.js site with Claude, ChatGPT or Grok in one of three ways: paste a file into the chat and paste the updated file back into GitHub, let the assistant connect to your GitHub repository and open a pull request for you, or run it on your own computer where it can see every file. Whichever you pick, the safety comes from the same place: the change goes on a branch, your host builds a preview, and you check it on your phone before you merge. Ask for one change at a time, and always ask for the complete file back.

01

Which way of working with AI fits you?

01

No setup

Paste into a chat

  1. 1Copy the file from GitHub
  2. 2Chat changes it
  3. 3Paste back on a branch

Best for: One-file edits

02

Connect once

Connected to GitHub

  1. 1Describe the change
  2. 2It edits on a branch
  3. 3It opens the pull request

Best for: Several files, new pages

03

Install

On your computer

  1. 1It works in your site folder
  2. 2You watch it change
  3. 3Push a branch

Best for: Layout, bigger changes

Three ways to work with an assistant. Start with the first; move right when you outgrow it.
Way of workingWhat it looks likeGood forSetup
Paste into a chatCopy a file into Claude, ChatGPT or Grok, paste the new version back on GitHubOne-file edits: words, a section, a titleNone
Connected to GitHubThe assistant reads your repository and opens a pull request for youEdits across several files, new pagesConnect GitHub once, to one repository
On your computerA coding assistant runs in your site’s folder and edits files directlyBigger changes, layout, anything you want to watch liveInstall it, plus the site running locally
All three assistants can do the first. Coding tools for the second and third are named differently by each company and change often, so look for “connect GitHub” or “code” in yours.

Start with pasting. It needs nothing installed, and it teaches you what good edits look like. Move up when you’re pasting three files for one change. When you get there, here’s how to run an AI assistant in the terminal, where it can see your actual files.

02

What are the five rules that keep AI edits safe?

  1. 01Never edit main directly. Every AI change goes on a branch and through a preview. This one rule makes everything else low-stakes.
  2. 02One change per request. “Update the hours” is a good request. “Update the hours, redo the hero and fix mobile” is three, and you won’t know which one broke.
  3. 03Ask for the whole file back, not a snippet. Pasting a full file is foolproof. Stitching a snippet into the right spot isn’t.
  4. 04Paste errors back word for word. If the preview build fails, copy the error into the chat and ask what it means. Don’t describe it, paste it.
  5. 05Never paste secrets. If a file has keys or passwords in it (usually one named .env), leave it out of the chat entirely.

AI is confident whether it’s right or not. The preview is where you find out which.

03

How do you edit by pasting into a chat?

  1. 01Find the file on GitHub that holds the thing you want to change (search for a phrase from the live page).
  2. 02Click the copy icon above the file to copy its whole contents.
  3. 03In Claude, ChatGPT or Grok, paste the file with one of the prompts below.
  4. 04Copy the complete file it gives back.
  5. 05On GitHub, click the pencil, select everything, paste, then Commit changes to a new branch and open a pull request.
  6. 06Open the preview on your phone and a computer. If it’s right, merge.

The editing part is exactly the same flow as editing by hand, just with the assistant doing the typing. If any step there is new, go back to how to edit a file right on GitHub.

04

How do you let the assistant open the pull request itself?

  1. 01In your assistant’s coding tool, connect GitHub and give it access to only your site’s repository, not all of them.
  2. 02Describe the change the same way you would in a chat, using a prompt below.
  3. 03It reads the files, makes the change on a new branch, and opens a pull request.
  4. 04Your host posts a preview link on that pull request. Check it on your phone.
  5. 05Read what it changed in the pull request’s Files changed tab. Red is removed, green is added. Anything outside what you asked for is a reason to ask why.
  6. 06Merge, or reply on the pull request with what to fix.
05

What prompts actually work?

These are the ones we use. Fill in the brackets, paste the file underneath when you’re working in a chat, and send. The first rule for any of them is to be specific about what should not change, because that’s where assistants wander.

Change some words.
This is a page from my Next.js website. Change [the opening hours] from "[Tuesday to Saturday, 11 to 9]" to "[Wednesday to Sunday, 12 to 10]". Change only that text. Don't change layout, styling, class names or any other words. Give me back the complete file.

[paste the file here]
Add a section.
Add a new section to this page, directly after the section that starts with "[heading of the section before it]".

Heading: [your heading]
Text: [your paragraph, written out in full]
Button: "[button label]" linking to [/contact]

Match the style of the existing sections exactly: same spacing, same heading size, same button style. Reuse the class names already in this file instead of inventing new ones. Don't change anything else. Give me back the complete file.
Fix something that looks wrong on a phone.
On a phone about 390 pixels wide, [the three price cards are squeezed side by side and the text overlaps]. On desktop it looks right and should stay exactly as it is.

Fix it so on small screens [the cards stack one per row with space between them]. Use Tailwind's responsive prefixes (sm:, md:, lg:) and change as little as possible. Tell me in one sentence what you changed, then give me back the complete file.
Swap an image and its description.
I've uploaded a new photo to public/images/[new-file-name.webp]. In this file, replace the image [describe it, e.g. "of the old storefront"] with the new one, and change its alt text to: "[describe the new photo in one plain sentence]". Keep the same size and position. Give me back the complete file.
Write the search title and description.
This is the [Services] page of my website for [what your business does, where]. Write the metadata for it: a title under 60 characters that starts with what someone would actually search for, and a description under 155 characters that says what's on the page and who it's for. Use only facts that are already on the page. Don't invent claims, numbers or awards. Add it as a metadata export at the top of the file and give me back the complete file.
The preview build failed.
My site's preview build failed. Here is the error, word for word:

[paste the full error from the build log]

And here is the file I changed last:

[paste the file]

Explain in plain English what went wrong, then give me the corrected complete file. Don't change anything that isn't part of the fix.
Explain a file before you touch it.
I'm not a developer. Explain what this file does on my website, in plain English, in five bullet points or fewer. Then tell me which parts are safe for me to edit by hand (words, links, images) and which parts I should leave alone.

[paste the file]
Add a new page (best with a connected or local assistant).
Add a new page to my Next.js site at /[services/catering]. Copy the structure and styling of app/[about]/page.tsx exactly.

Content, in this order:
1. Heading: [heading]
2. Intro paragraph: [text]
3. [list the sections, with their words written out]

Add the page's title and description metadata. Add a link to it in the main menu, after "[existing menu item]". Make a new branch for this and open a pull request. Don't change any other pages.

Every one of these follows the same shape: what to change, what not to touch, what to give back. If you want to know why that shape works so well, we tested it in how to write one prompt that gets a usable answer on the first try.

06

How do you stop repeating your rules every time?

Write them down once, in the repository. Most coding assistants look for a plain text file at the top of the project, usually named AGENTS.md, and some also read their own (Claude’s is CLAUDE.md). Put your site’s house rules there and a connected or local assistant reads them before every change.

AGENTS.md, at the top of your repository. Paste the same text at the start of a chat when you’re pasting files.
# House rules for this website

## About the business
[Business name] is a [what you do] in [where]. Our customers are [who].

## Voice
Plain, warm, short sentences. No jargon. No exclamation marks. Never invent facts, prices, reviews, awards or numbers.

## Brand
Colors: [hex codes and what each is for]. Fonts: [heading / body]. Reuse existing components and class names. Don't add new libraries.

## Safety
Work on a branch and open a pull request. Never commit to main. Don't touch .env files, next.config, or package.json unless asked. After changes, check the page at 390px wide and at desktop width.

If you find yourself explaining the same process over and over, that’s the moment to turn it into a skill the assistant finds on its own. Here’s how to turn a workflow you keep repeating into an AI skill.

07

What should you check before you merge?

Ask

One change at a time.

Draft

Never the live site.

Preview

Phone and computer.

Check

Every fact.

Publish

Live in minutes.

Wrong after all? Undo it (“revert”). Two clicks, and you’re back to step 1.

Every AI edit goes round this loop. It’s what makes a wrong answer harmless.
  1. 01The preview built. A green check on the pull request, not a red cross.
  2. 02The change you asked for is there, on a phone and on a computer.
  3. 03Nothing else moved. Scroll the whole page, not just the part you changed.
  4. 04The Files changed tab only touches files you expected.
  5. 05Every fact is true. Assistants love to add a confident sentence nobody asked for. Delete anything you didn’t say.

If a merged change turns out wrong, revert it. Two clicks, and the site is back. You can always undo.

08

Where AI editing stops being the shortcut

AI assistants are excellent at small, well-described changes and unreliable at taste. A redesign, a new brand direction, or “make it feel more premium” will come back different, not better, and you’ll spend more rounds than a person would take.

They also don’t know your business. They’ll write a plausible testimonial, invent a year you were founded, or promise a turnaround you don’t offer. The house rules file cuts this down. Reading every line before you merge stops it.

And anything touching payments, logins, or customer data deserves a developer’s eyes, even if the AI’s version looks fine. Those are the mistakes that look fine right up until they don’t.

Common questions

Which is best for editing a website: Claude, ChatGPT or Grok?
For pasting a file and getting it back changed, all three do well, and the prompt matters more than the brand. For working directly in your repository, pick whichever has the coding tool you find easiest to connect to GitHub. We use Claude day to day, and the prompts here work in all three.
Do I need a paid AI plan to edit my site?
Not to start. Free plans handle the occasional paste-and-edit. If you’re editing every week or want the assistant connected to GitHub, a paid plan (about $20 to $30 a month, depending on which one, as of November 2026) is worth it for the higher limits.
Can an AI assistant break my live website?
Only if its change goes straight to main. Keep every AI edit on a branch, check the preview, and merge only what you’ve looked at. A bad merge can still be reverted in two clicks.
Is it safe to give an AI tool access to my GitHub?
Give it access to the one repository it needs, not your whole account, and review its pull requests before merging. Don’t keep passwords or keys in your code, and never paste a .env file into a chat.
Why does the assistant keep changing things I didn’t ask for?
Because you didn’t tell it what to leave alone. Say “change only this” and “don’t change layout, styling or other text” in every request, and put the same rule in your AGENTS.md file.

Keep going

More you can build yourself

Build it yourself

How to ship a one-page website with Claude, v0, and GitHub in 90 minutes

About 90 minutesBeginner

Playbook · Part 3

How to edit your own Next.js website without breaking it

15 minutes a changeBeginner

Playbook · Part 2

What are Git and GitHub, and why does your website need them?

About 30 minutesBeginner

Playbook · Part 4

How to deploy your Next.js site from GitHub to Cloudflare or Vercel, step by step

About 45 minutesBeginner

Build it yourself

How to write one prompt that gets a usable answer on the first try

About 10 minutesBeginner

Playbook · Part 1

How to leave WordPress for a site you actually own

1 to 3 daysBeginner

Build it yourself

How to get on Google Maps, then actually get reviews

About 1 hourBeginner

Build it yourself

How to build a brand kit you can actually reuse

About 2 hoursBeginner

Build it yourself

How to run your AI assistant in the terminal, where it can see your actual files

20 minutes to set upIntermediate

Build it yourself

How to turn a workflow you keep repeating into an AI skill that fires on its own

About 1 hourIntermediate

Fix what broke

How to tell if your contact form is silently dropping leads

About 30 minutesBeginner

Fix what broke

Why scroll animations hide content from some visitors

About 15 minutesAdvanced

Fix what broke

Why Google is indexing the wrong domain for your site

About 20 minutesIntermediate

That’s the series. No WordPress, no plugins, no builder. If you’d rather we set the whole thing up with you, the first hour is free.

Get Unstuck