SEO basics of the page or post Claude just edited, above the prompt: title and meta description length, H1 count, images without alt, word count. /meta-lint…

Mods for Claude Code, built for SEO and content work. Install only the ones you want.
Every mod installs on its own. The quick version:
claude plugin marketplace add krysmalskipl/claude-code-mods
claude plugin install <mod>@krysmalskipl
Then restart Claude Code. Each mod below has the full steps, including any key it needs.
Needs Claude Code 2.1.287+ in the terminal, or the Claude desktop app's Code tab. Plugins installed from the terminal show up in both.
| Mod | What it does | Command | ||
|---|---|---|---|---|
| 🪙 | openrouter-balance | Your OpenRouter credit: the real balance with a gauge, today's spend and the model the money mostly went to. A regular API key shows its own spend and limit instead | /openrouter-balance | |
| 📏 | meta-lint | The SEO basics of the page or post Claude just edited: title and meta description length, H1 count, images without alt, word count. Markdown, MDX, Astro and HTML | /meta-lint [file] | |
| 🔗 | link-check | Checks the external links Claude adds. Broken ones go back to Claude so it can fix them, and show above the prompt | /links [file] | |
| 🪧 | share-preview | How the page looks in Google (desktop and mobile, cut by pixel width) and as a shared link on LinkedIn, Facebook, Slack and X, with what would cost you clicks. Live while Claude edits | `/preview [url \ | file]` |
| ⏱️ | cache-stats | Your prompt cache above the prompt: hit rate, how long it stays warm, what a cold restart re-caches, and how long the session has run. /cache lists every miss and why | `/cache [hide\ | show]` |

One line above the prompt after Claude edits a page or post:
◆ SEO post.md title 58/60 ✓ · description 186/160 ✗ · H1 1 ✓ · 2 images without alt · 2,726 words
claude plugin marketplace add krysmalskipl/claude-code-mods # once per machine
claude plugin install meta-lint@krysmalskipl
Restart Claude Code or type /reload-plugins. No key, no setup: it reads files on your machine and sends nothing anywhere. The line appears after Claude's first Write or Edit of a .md, .mdx, .markdown, .astro, .html or .htm file.
| Check | Where it looks | Green | Yellow | Red |
|---|---|---|---|---|
| Title | Frontmatter seo_title, meta_title or title (the first one set), else <title>, else the first # H1 | 30 to 60 characters | under 30 | over 60, or missing |
| Description | Frontmatter seo_description, meta_description, description or excerpt, else <meta name="description"> | 70 to 160 characters | under 70 | over 160, or missing |
| H1 | # lines and <h1> tags in the body, outside code blocks | one, or none when the frontmatter has a title (templates usually render it as the H1) | more than one, or none at all | |
| Images without alt | and <img> without alt | any | ||
| Words | the body, without code | shown, not judged |
/meta-lint shows the details of the last page: each value, where it came from, how far over or under it is, and a search snippet preview cut where Google would likely cut it/meta-lint path/to/file.md checks any file, edited or notLimits are in characters. Google cuts titles by pixel width (about 600 px), so a title of wide letters can be cut sooner: treat the numbers as a guide.
Checks every external link Claude adds to a page, post or template, while Claude is still working.
◆ Links 2 not working · https://gone.dev/page (404) in post.md and 1 more · /links
claude plugin marketplace add krysmalskipl/claude-code-mods # once per machine
claude plugin install link-check@krysmalskipl
Restart Claude Code or type /reload-plugins. No key, no setup.
Write or Edit of a .md, .mdx, .astro, .html, .tsx, .jsx, .vue, .svelte, .php, .njk, .liquid or .twig file, it finds the http(s) links new in that edit and asks each one (a HEAD, or a GET when the host refuses HEAD)/links lists themlocalhost, 127.0.0.1, example.com, .local, .test and links with template placeholders (${…}, {{…}})/links lists the links that don't work, and where/links path/to/file.md checks every link in a file now (up to 100), with ✓ working, ↪ redirect, ~ blocks bots and ✗ brokenSee the page you're building the way people will meet it: as a Google result and as a link someone shares. A pane next to the chat, updated while Claude edits.
✗ og:image "/og.png" is relative: platforms need a full https:// URL
! Title is 668px wide, Google shows about 600px: the end is cut
! No twitter:card: X shows a small thumbnail, add summary_large_image for the big card
✓ Description fits desktop and mobile (512px)
claude plugin marketplace add krysmalskipl/claude-code-mods # once per machine
claude plugin install share-preview@krysmalskipl
Restart Claude Code or type /reload-plugins. No key, no setup.
/preview shows the page Claude edited last: HTML, Astro, Vue, Svelte, JSX with <Head>, a Next.js metadata export or Markdown frontmatter. The pane follows every later edit of that file/preview localhost:3000/pricing reads the page your dev server renders, the most accurate view. It refreshes after each of Claude's turns/preview https://example.com checks a live pageg Google, s shared link, r refreshtwitter:card), with the fallbacks each platform uses when a tag is missingnoindex, a missing title, a missing or relative or local og:image, an og:image that doesn't load (it asks the URL, or looks in public/ and static/ for a local file), a canonical pointing at localhost, titles and descriptions too long or too short, a missing twitter:card, og:image:alt or <html lang>{post.title}, generateMetadata) are marked as such: /preview <url> reads them renderedThe findings also go to Claude as context, so "fix these" just works. Pages and images are fetched from your machine; nothing is sent anywhere else.
Google publishes no snippet limits: the pixel widths are the ones SEO tools have measured for years. Treat them as a close guide, not a promise.
Claude Code resends the whole conversation with every request, and the prompt cache is what keeps that cheap and fast. This shows what the cache is doing, live.
◆ Cache █████████░ 96% hit · warm 58m · 133k cached · session 1h 12m (23m working) · avg 94% · 38 requests
◆ Cache ░░░░░░░░░░ 0% hit · cold, next message re-caches 133k · session 2h 05m (31m working)
claude plugin marketplace add krysmalskipl/claude-code-mods # once per machine
claude plugin install cache-stats@krysmalskipl
Restart Claude Code or type /reload-plugins. The line appears after Claude's first reply. It reads Claude Code's own usage figures and sends nothing anywhere.
The hit rate is measured, but the warm countdown needs to know how long your cache lives: 1h on a Claude subscription (the default) or 5m on an API key. On an API key, set it in /config → cache-stats, or from a shell:
echo '{"ttl":"5m"}' | claude plugin configure cache-stats@krysmalskipl --values-stdin
Not sure which you have? Look at your session transcript: ephemeral_1h_input_tokens in the usage rows means a 1h cache.
On a narrow terminal the right-hand parts drop out first.
/cache shows the details: state, session totals (read from cache, written, sent uncached, generated), every miss with the reason, and the last requests/cache hide and /cache show take the line away and bring it backA miss is a large prompt (5,000+ tokens) the cache mostly did not serve. The reason is told by the gap before it: idle longer than the cache lives means it simply expired; soon after the last request means something under the cache changed, such as /model, /compact, an edited CLAUDE.md or a new MCP tool. That second kind is the one worth hunting down, since each costs a full re-cache.
Subagents run on caches of their own and are not counted.

Your OpenRouter credit in one line above the prompt, refreshed every 5 minutes and after each turn.
claude --version
You need 2.1.287 or newer. Older? Update with claude update (or npm install -g @anthropic-ai/claude-code). In the desktop app, type /status in a Code tab session.
Once per machine, in a terminal:
claude plugin marketplace add krysmalskipl/claude-code-mods
Or inside a Claude Code session: /plugin marketplace add krysmalskipl/claude-code-mods.
claude plugin install openrouter-balance@krysmalskipl
Or inside a session: /plugin install openrouter-balance@krysmalskipl.
It ends with "1 userConfig option not yet set". That's the optional key from step 4. If your key is already in your environment or Keychain, ignore it.
Pick the kind of key first:
| Key | What the line shows | Where to make one |
|---|---|---|
| Management key (recommended) | The account's real balance, today's spend and the model the money mostly went to | openrouter.ai/settings/management-keys. It can't call models, so it's safe to keep around |
| Regular API key | Only that key's own spend today and this month, and what its limit leaves | openrouter.ai/settings/keys. The OPENROUTER_API_KEY you already use works |
Then put it in one place. The mod looks in this order and takes the first it finds:
/config → openrouter-balance in an interactive claude terminal session, or from a shell: echo '{"apiKey":"sk-or-v1-..."}' | claude plugin configure openrouter-balance@krysmalskipl --values-stdin
That line lands in your shell history; the Keychain (3) keeps the key out of it.
OPENROUTER_MANAGEMENT_KEY for a management key, OPENROUTER_API_KEY for a regular one. Add it to ~/.zshrc (or your shell's startup file): export OPENROUTER_MANAGEMENT_KEY="sk-or-v1-..."
security add-generic-password -a "$USER" -s openrouter-key -w
~/.zshrc), the mod asks your shell for OPENROUTER_MANAGEMENT_KEY and OPENROUTER_API_KEY. So a key exported in ~/.zshrc works there too.The key is kept in memory only and sent only to openrouter.ai.
Start a new Claude Code session (or type /reload-plugins in an open one). Within a few seconds a line appears above the prompt:
◆ OpenRouter █████████▁ $2.67 of $3.00 key limit left · $0.33 today
Type /openrouter-balance for the breakdown: balance, today, yesterday, last 30 days and spend, requests and tokens by model. With a regular key: today, this week, this month, all time, its limit and budget.
claude plugin marketplace update krysmalskipl
claude plugin update openrouter-balance@krysmalskipl
claude plugin uninstall openrouter-balance@krysmalskipl
| The line says | Why | Fix |
|---|---|---|
| Nothing at all | The mod isn't loaded yet | Start a new session, or /reload-plugins. Check claude plugin list shows it enabled |
no key set | No key in any of the four places | Step 4. In the desktop app, the Keychain is the surest place |
key rejected | The key was revoked or disabled | Make a new one, put it where the old one was |
can't reach OpenRouter yet | No network, or OpenRouter is down | It retries every minute by itself |
$0.42 today · $12.30 this month and no balance | A regular key with no limit: it can't see the account | Use a management key for the balance, or set a limit on the key |
… · offline | The last refresh failed | The numbers are the last good ones; it retries every minute |
/activity, which holds completed UTC days onlyclaude plugin validate mods/<name>
CLAUDE_CONFIG_DIR=$(mktemp -d) claude plugin test mods/<name>
More mods: hamzafer/claude-code-mods.
MIT
hooks/register.tsx 180 lines1// Meta Lint: the SEO basics of the page or post Claude just edited, in a band above the prompt.
2// Reads Markdown, MDX, Astro and HTML files after each Write or Edit. Nothing leaves your machine.
3import { atom, read, update } from 'claude-code'
4import type { EngineInterface, Register } from 'claude-code'
5
6import type { Report } from '../types'
7
8const CONTENT_FILE = /\.(md|mdx|markdown|astro|html?)$/i
9const EDIT_TOOLS = new Set(['Write', 'Edit', 'MultiEdit'])
10const TITLE_MAX = 60 // characters Google usually shows before cutting the title
11const TITLE_MIN = 30
12const DESC_MAX = 160 // and the description
13const DESC_MIN = 70
14const BRAND = '#4ade80'
15// Frontmatter keys, most specific first: an SEO title wins over the post's title.
16const TITLE_KEYS = ['seo_title', 'seoTitle', 'meta_title', 'metaTitle', 'title']
17const DESC_KEYS = ['seo_description', 'seoDescription', 'meta_description', 'metaDescription', 'description', 'excerpt']
18
19// Held by the host, so the band survives a hot reload of this file.
20const last = atom({ plugin: 'meta-lint', key: 'last' } as const, null as Report | null)
21
22export const register: Register = on => {
23 on('session.start', async ($, e, next) => {
24 const result = await next(e)
25 await $.command
26 .register({ name: 'meta-lint', description: 'SEO basics of the last edited page, or of a file you name', argumentHint: '[file]' })
27 .catch(() => {}) // a name Claude Code already has is refused: start anyway
28 return result
29 })
30
31 on('tool.call', async ($, e, next) => {
32 const ran = await next(e)
33 const path = (e as unknown as { file_path?: unknown }).file_path
34 if (!EDIT_TOOLS.has(e.tool) || e.agentId || typeof path !== 'string' || !CONTENT_FILE.test(path)) return ran
35 if (ran.deny !== undefined || ran.isError === true) return ran
36 try {
37 const report = lint(path, String(await $.fs.read(path)))
38 await update($, last, () => report)
39 } catch {
40 // a file that can't be read leaves the band as it was
41 }
42 return ran
43 }).catch(($, e, next) => next(e)) // a hook that failed never holds up the edit
44
45 on('command.run', { command: 'meta-lint' }, async ($, e) => {
46 const arg = e.args.trim()
47 try {
48 const report = arg ? lint(arg, String(await $.fs.read(arg))) : await read($, last)
49 if (!report) return { text: 'No page edited yet. Run `/meta-lint <file>` to check one.' }
50 if (arg) await update($, last, () => report)
51 return { text: detail(report) }
52 } catch (err) {
53 return { text: `Couldn't read ${arg}: ${err instanceof Error ? err.message : String(err)}` }
54 }
55 })
56
57 on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
58 const rest = await next(e) // what other mods and Claude Code draw here stays
59 const r = await read($, last)
60 if (e.props.hasSurvey || !r) return rest
61
62 const { Box, Text } = $.ui.resolve(e)
63 const isWide = e.props.bodyColumns >= 80
64 const sep = <Text dimColor>{' · '}</Text>
65 const t = titleTone(r)
66 const d = descTone(r)
67 const h1Bad = r.h1 > 1 || (r.h1 === 0 && !r.hasTitleField)
68
69 return (
70 <Box flexDirection="column">
71 <Box paddingX={1}>
72 <Text wrap="truncate-end">
73 <Text color={BRAND} bold>{'◆ SEO '}</Text>
74 {isWide && <Text dimColor>{`${basename(r.file)} `}</Text>}
75 <Text dimColor>{'title '}</Text>
76 <Text color={t}>{r.title ? `${len(r.title.text)}/${TITLE_MAX} ${mark(t)}` : 'missing ✗'}</Text>
77 {sep}
78 <Text dimColor>{'description '}</Text>
79 <Text color={d}>{r.description ? `${len(r.description.text)}/${DESC_MAX} ${mark(d)}` : 'missing ✗'}</Text>
80 {sep}
81 <Text dimColor>{'H1 '}</Text>
82 <Text color={h1Bad ? 'red' : 'green'}>{`${r.h1} ${h1Bad ? '✗' : '✓'}`}</Text>
83 {r.noAlt > 0 && sep}
84 {r.noAlt > 0 && <Text color="red">{`${r.noAlt} ${r.noAlt === 1 ? 'image' : 'images'} without alt`}</Text>}
85 {isWide && sep}
86 {isWide && <Text dimColor>{`${r.words.toLocaleString('en-US')} words`}</Text>}
87 </Text>
88 </Box>
89 {rest}
90 </Box>
91 )
92 })
93}
94
95// Everything the band and /meta-lint show, from a file's text. Pure, so the tests can feed it anything.
96export function lint(file: string, text: string): Report {
97 const { fields, body } = frontmatter(text)
98 const html = /\.(astro|html?)$/i.test(file) ? text : body
99 const titleKey = TITLE_KEYS.find(k => fields[k])
100 const descKey = DESC_KEYS.find(k => fields[k])
101 const titleTag = /<title[^>]*>([\s\S]*?)<\/title>/i.exec(html)?.[1]
102 const descTag = metaDescription(html)
103 const prose = stripCode(body)
104 const mdH1 = prose.split('\n').filter(l => /^#\s+\S/.test(l))
105 const tagH1 = prose.match(/<h1\b/gi) ?? []
106 return {
107 file,
108 title: titleKey
109 ? { text: fields[titleKey], from: titleKey }
110 : titleTag?.trim()
111 ? { text: clean(titleTag), from: '<title>' }
112 : mdH1[0]
113 ? { text: mdH1[0].replace(/^#\s+/, '').trim(), from: 'H1' }
114 : null,
115 description: descKey ? { text: fields[descKey], from: descKey } : descTag ? { text: descTag, from: 'meta description' } : null,
116 h1: mdH1.length + tagH1.length,
117 hasTitleField: fields.title !== undefined,
118 noAlt: (prose.match(/!\[\s*\]\(/g) ?? []).length + (prose.match(/<img\b[^>]*>/gi) ?? []).filter(tag => !/\balt\s*=\s*(["'])\s*[^"'\s]/i.test(tag)).length,
119 words: words(prose),
120 }
121}
122
123function detail(r: Report) {
124 const lines = [`## SEO basics: ${basename(r.file)}`, '']
125 const t = r.title
126 const d = r.description
127 lines.push(
128 t ? `- **Title** (${t.from}): ${len(t.text)} characters, ${advice(len(t.text), TITLE_MIN, TITLE_MAX)}` : '- **Title:** missing',
129 d ? `- **Description** (${d.from}): ${len(d.text)} characters, ${advice(len(d.text), DESC_MIN, DESC_MAX)}` : '- **Description:** missing',
130 `- **H1:** ${r.h1}${r.h1 > 1 ? ', keep one per page' : r.h1 === 0 ? (r.hasTitleField ? ' in the body (the frontmatter title is usually the H1)' : ', add one') : ''}`,
131 `- **Images without alt:** ${r.noAlt}`,
132 `- **Words:** ${r.words.toLocaleString('en-US')}`,
133 )
134 if (t || d) {
135 lines.push('', '**Search snippet preview** (cut by characters; Google cuts by width, so treat it as a guide)', '')
136 if (t) lines.push(`> **${cut(t.text, TITLE_MAX)}**`)
137 if (t && d) lines.push('>')
138 if (d) lines.push(`> ${cut(d.text, DESC_MAX)}`)
139 }
140 return lines.join('\n')
141}
142
143// `key: value` lines between the first two `---` lines. Enough for titles and descriptions; lists are skipped.
144function frontmatter(text: string) {
145 const fields: Record<string, string> = {}
146 const m = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(text)
147 if (!m) return { fields, body: text }
148 for (const line of m[1].split(/\r?\n/)) {
149 const kv = /^([A-Za-z_][\w-]*):\s*(.*)$/.exec(line)
150 if (!kv || !kv[2]) continue
151 const value = kv[2].trim().replace(/^(["'])(.*)\1$/, '$2').trim()
152 if (value) fields[kv[1]] = value
153 }
154 return { fields, body: text.slice(m[0].length) }
155}
156
157function metaDescription(html: string) {
158 for (const tag of html.match(/<meta\b[^>]*>/gi) ?? []) {
159 if (!/\bname\s*=\s*["']description["']/i.test(tag)) continue
160 const content = /\bcontent\s*=\s*(["'])([\s\S]*?)\1/i.exec(tag)?.[2]
161 if (content?.trim()) return clean(content)
162 }
163 return null
164}
165
166// Fenced and inline code don't count as prose: a `# comment` in a shell block is no H1.
167const stripCode = (s: string) => s.replace(/^(```|~~~)[\s\S]*?^\1[^\n]*$/gm, '').replace(/`[^`\n]*`/g, '')
168const words = (s: string) =>
169 (s.replace(/<[^>]+>/g, ' ').replace(/!?\[([^\]]*)\]\([^)]*\)/g, '$1').match(/\p{L}[\p{L}\p{N}'’-]*/gu) ?? []).length
170const clean = (s: string) => s.replace(/\s+/g, ' ').trim()
171const len = (s: string) => [...s].length
172const cut = (s: string, max: number) => (len(s) > max ? `${[...s].slice(0, max - 1).join('').trimEnd()}…` : s)
173const basename = (p: string) => p.split('/').pop() ?? p
174const tone = (n: number, min: number, max: number) => (n > max ? 'red' : n < min ? 'yellow' : 'green')
175const titleTone = (r: Report) => (r.title ? tone(len(r.title.text), TITLE_MIN, TITLE_MAX) : 'red')
176const descTone = (r: Report) => (r.description ? tone(len(r.description.text), DESC_MIN, DESC_MAX) : 'red')
177const mark = (t: string) => (t === 'green' ? '✓' : t === 'yellow' ? '~' : '✗')
178const advice = (n: number, min: number, max: number) =>
179 n > max ? `${n - max} over ${max}, Google will likely cut it` : n < min ? `short, there's room up to ${max}` : `fits (${min} to ${max})`
180types/index.d.ts 17 lines1// The SEO basics of one file, as the band and /meta-lint show them.
2export type Report = {
3 file: string // the path as Claude edited it
4 title: { text: string; from: string } | null // from: the frontmatter key or tag it came from
5 description: { text: string; from: string } | null
6 h1: number // in the body; a frontmatter title is usually the page's H1 too
7 hasTitleField: boolean // the frontmatter has a title, so a body without H1 is fine
8 noAlt: number // images without alt text
9 words: number
10}
11
12declare module 'claude-code' {
13 interface PluginState {
14 'meta-lint': { last: Report | null }
15 }
16}
17