Running a content audit manually is one of the most time-consuming parts of SEO maintenance. Checking 50–100 blog posts for broken links, missing frontmatter, inconsistent slugs, and internal link gaps takes hours if you’re opening files one by one.
Claude Code can do this in minutes. It reads your content directory, checks each file against a set of criteria, and gives you a structured report. The audit runs against your actual files — not a sitemap or crawled version of your live site — so you catch issues before they deploy.
Quick Answer: Claude Code can audit a local markdown content directory for: broken internal links (links to slugs that don’t exist in the directory), missing frontmatter fields, description length violations, and internal link count per post. Give Claude Code a specific audit task, a list of criteria, and a content directory. It returns a structured report with file-by-file findings.
Why audit markdown files locally with Claude Code
The standard SEO audit workflow uses a crawler (Screaming Frog, Ahrefs site audit) to check the live site. This catches live issues but misses draft content issues before deployment.
For content teams that publish on a git-based workflow (Astro, Next.js, 11ty), catching issues in the source files before they go live is more efficient. A pre-deploy audit that runs in 30 seconds is more valuable than a post-deploy crawl that runs overnight.
Claude Code can:
- Check every markdown file’s internal links against the actual files in the directory
- Flag links that point to slugs that don’t exist
- Count internal links per post and flag posts with fewer than 3 (under your minimum)
- Check frontmatter for required fields (title, description, category, cluster, slot, ogImage)
- Flag descriptions over 160 characters
- Check for UTM parameters on links to /tools/, /programs/, and /offers/ routes
These checks run against the source files — no deployment needed.
Running a broken link audit
Open Claude Code in your project directory. Give this instruction:
Audit src/content/blog/ for broken internal links.
Check every link in the format /blog/[slug]/ against the actual
.md files in src/content/blog/. List every broken link with:
the file containing it, the broken link URL, and the line number.
Claude Code will:
- List all
.mdfiles in the blog directory and extract their slugs - Scan each file for markdown links matching
/blog/[slug]/ - Check whether each linked slug corresponds to an existing file
- Report all mismatches
A typical output looks like:
Broken internal links found:
src/content/blog/affiliate-operator-stack-2026.md:
Line 82: /blog/recurring-commission-affiliate-programs/
→ No matching file (nearest: recurring-vs-high-ticket-offers-in-2026...)
src/content/blog/what-is-openrouter-2026.md:
Line 145: /blog/openrouter-advanced-config/
→ No matching file
2 broken links found across 47 files checked.
Running a frontmatter completeness audit
Check all files in src/content/blog/ for missing required frontmatter fields.
Required fields: title, description, pubDate, category, tags, keyword,
cluster, ogImage, draft, slot.
List each file with missing fields. Also flag descriptions over 160 characters.
Claude Code reads each file’s frontmatter, checks for each required field, and measures description length. Files with missing fields or overlength descriptions are reported.
Running an internal link density audit
For each file in src/content/blog/, count the number of internal links
(links starting with /blog/, /tools/, /programs/, or /offers/).
List files with fewer than 3 internal links, sorted by pubDate ascending.
This helps identify older posts that predate your internal link strategy — posts that are indexed and getting traffic but not contributing to your link structure.
Automating audits with a shell script
For regular audits, combine these checks into a shell script:
#!/bin/bash
# audit-content.sh
# Runs Claude Code SEO audit on src/content/blog/
echo "=== Internal Link Audit ===" >> audit-report.txt
claude --print "Audit src/content/blog/ for broken internal links. Check /blog/[slug]/ links against actual .md files. List broken links with filename and line number." >> audit-report.txt
echo "" >> audit-report.txt
echo "=== Frontmatter Audit ===" >> audit-report.txt
claude --print "Check all src/content/blog/ files for missing required frontmatter. Required: title, description, pubDate, category, tags, keyword, cluster, ogImage, draft, slot. Also flag descriptions over 160 chars." >> audit-report.txt
echo "" >> audit-report.txt
echo "=== Low Internal Link Posts ===" >> audit-report.txt
claude --print "List src/content/blog/ files with fewer than 3 internal links to /blog/, /tools/, /programs/, or /offers/ routes. Sort by pubDate ascending." >> audit-report.txt
echo "Audit complete. Report saved to audit-report.txt"
Run this monthly. The report gives you a prioritized list of content maintenance tasks — fix broken links, add missing fields, improve internal link density on underlinked posts.
Interpreting audit results
Broken links: Priority fix. Broken internal links waste link equity and create a poor reader experience. Fix within the same sprint as the audit.
Missing frontmatter fields: Medium priority. Missing slot breaks auto-publish. Missing cluster breaks content organization. Missing ogImage degrades social sharing. Fix before the next publication cycle.
Low internal links: Long-term improvement queue. Posts with fewer than 3 internal links are leaving link equity on the table. Add links during the next scheduled content refresh.
Long descriptions: Fix during next edit. A description over 160 characters will fail a build check — but if you’re not validating before push, it will silently truncate in some display contexts.
For scripts that automate bulk fixes (not just detection), see the Claude Code batch editing tutorial. For the broader Claude Code workflow context, the tools overview covers where it fits a lean operator stack.
Frequently Asked Questions
Can Claude Code check external links for 404s?
Not directly via the file scan. You’d need to pipe the URLs to a separate HTTP checking script. Claude Code can extract all external URLs from your markdown files, which you then check with a tool like curl in a shell loop.
How long does a full audit of 100 posts take? Typically 1–3 minutes for a complete audit of 100 markdown files. Reading files and pattern matching is fast. API response time for Claude’s analysis is the limiting factor.
Does this replace a live site crawler? No — a live site crawler checks the deployed site, including dynamically generated URLs, redirect chains, and crawlability issues. A local file audit checks source content. Use both: local audit pre-deploy, crawler audit post-deploy.
Can I add custom audit rules? Yes — describe any additional checks in plain language. “Flag posts with fewer than 1000 words” or “list posts in the cluster-r-openrouter cluster that don’t link to /tools/openrouter/” are valid audit instructions.
Build your content quality system
For operators running a structured content site with internal link requirements and publication schedules, the Claude Code tool page and the blog section cover the workflows that keep content quality consistent at scale.