# Find broken links with Claude Code

> Tested by AI Setups That Work. Small business · Intermediate · Operations. Updated 2026-11-17.
> Receipt: Ran with Claude Code in a cloud session, Nov 17, 2026, on a made-up 7-page site on a local server: the checker found the 2 broken links and the 2 missing titles. It passed with snags: with no sitemap it listed the 2 broken pages twice, and the same session built the site and the checker. A real website, Manual mode and fixing then rerunning were not tested.

Canonical page: https://www.aisetupsthatwork.com/setups/find-broken-links-and-missing-titles-with-claude-code/

## What it does
Get a plain list of broken links, missing page titles and duplicate titles on your website, from a checker Claude Code writes for you.

## Who it's for
Owners with a small business website who suspect it has broken pages or messy titles and do not want to pay for an audit tool to find out.

## Tools
- Claude Code, in the terminal or the desktop app
- Your website address (most builders publish a sitemap at /sitemap.xml)
- Your website builder, to make the fixes yourself

## Steps
1. Make an empty folder and open Claude Code in it in Manual mode (cd into the folder, then type claude --permission-mode manual).
2. Paste the prompt below with your website address. In Manual mode, Claude Code asks before it edits files or runs commands; approve after you read what it will do.
3. Open report.csv. Start with broken links (404) on your own site, then pages with no title, then duplicate titles.
4. Fix each one in your website builder: update or remove the broken link, and give each page its own short, descriptive title.
5. Run the check again and confirm the list is shorter. Rerun it once a month or after big changes.

## Copy-paste prompt
Adapt bracketed fields to your situation.
```text
My website is [YOUR WEBSITE ADDRESS]. Write a small script in this folder that checks it, then run it.

The script should:
1. Read the sitemap (try /sitemap.xml, then /sitemap_index.xml). If there is none, start from the home page and follow links on my own domain only, up to 200 pages.
2. Visit each page at most once, one at a time, with a short pause between requests.
3. On each page, record: the page address, its status code, its title, and every link on the page.
4. Check each link on my own domain and record any that do not load (status 400 or higher).
5. Write report.csv with: page, problem (broken link, missing title, duplicate title, page error), detail, and how to fix it in plain words.

Rules: only read public pages. Do not log in, submit forms or change anything. Do not check links to other websites unless I ask. When done, show me the count of each problem and the 10 worst pages.
```

## Guardrails
- What it touches: Chat input you provide (Claude Code, in the terminal or the desktop app; Your website address (most builders publish a sitemap at /sitemap.xml)).
- Needs your OK: Send, pay, publish, delete, and CRM updates stay with you unless you explicitly opt in.
- Safety level: Read-only
- It only reads: The prompt tells the checker to visit only your public pages, like a visitor would, and not to log in, submit forms or change anything. It is never given your website builder login. You make every fix yourself.
- Why titles matter: Google's guidance on title links says each page should have a title that describes that page, and warns against titles that are missing, half-empty or repeated across pages.
- The site blocks the checker. Ask Claude Code to slow it down further, or check fewer pages.
- Hundreds of "duplicate title" rows from blog tag or archive pages. Ask it to group them so you fix the template once.
- A link works in your browser but shows as broken. Open it yourself before you change anything.
- With no sitemap, a broken link can show up twice in the report, once as a broken link and once as a page error. Count the broken addresses, not the rows.

## Tips
- Fix broken links on your most visited pages first: home, services and contact.
- Ask Claude Code to add a column for pages with a very short title, like just your business name.
- Keep the folder. Next month, ask Claude Code to rerun the script and compare with the old report.

## Estimates (labeled, not measured)
- Time saved: Not stated in sources.
- Money saved: Not stated in sources.
- Tool cost: Claude Code needs a paid Claude plan (Pro, Max, Ultra, Team or Enterprise) or a Claude Console account. The check runs on your own computer. Plan prices: see claude.com/pricing.

## Sources
Summaries use the public sources below, not independent verification.
- Anthropic: https://code.claude.com/docs/en/quickstart (Claude Code quickstart (read Nov 9, 2026): install commands for macOS, Linux, WSL and Windows, a desktop app option, plans that include it (Pro, Max, Ultra, Team or Enterprise, or a Claude Console account), start it with "cd" into a folder then "claude". Whether it asks before acting depends on the permission mode (see the permission modes page).)
- Anthropic: https://code.claude.com/docs/en/permission-modes (Claude Code permission modes (read Nov 9, 2026): in Manual mode Claude Code stops and asks before most actions that edit files, run shell commands or reach the network; auto mode is the built-in starting mode for interactive terminal and VS Code sessions on current versions; start in Manual with claude --permission-mode manual, or switch with Shift+Tab.)
- Google Search Central: https://developers.google.com/search/docs/appearance/title-link (Influencing your title links in search results. Our build machine could not open Google developer pages; checked through search results on Nov 9, 2026: every page should have a descriptive title element, and missing, half-empty or repeated boilerplate titles are common reasons Google replaces a title.)

## Get the free starter pack
Five beginner copy-paste AI setups, free by email: https://www.aisetupsthatwork.com/starter-pack/?utm_source=ai-agent&utm_medium=markdown&utm_campaign=setup-find-broken-links-and-missing-titles-with-claude-code

Related:
- [Give your AI a map of your website](https://www.aisetupsthatwork.com/setups/give-your-ai-a-map-of-your-website/index.md)
- [Make your website readable by AI](https://www.aisetupsthatwork.com/setups/make-your-website-readable-by-ai-agents/index.md)
- [Optimize your Google Business Profile to show up locally](https://www.aisetupsthatwork.com/setups/optimize-your-google-business-profile/index.md)
