SLOPSHOPPER

meta-lint

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…

newbandguardcommand
A shopper browsing a rack in a slop shop
Preview · a replayed session in a sandbox
claude · ~/work/app · meta-lint
› fix the failing auth test and add an audit log call ⏺ Read(src/auth.ts) ⎿ Read 6 lines ⏺ Update(src/auth.ts) ⎿ Added 2 lines, removed 1 line ⏺ Bash(bun test) ⎿ 3 pass, 1 fail ● Done. refresh now rejects expired claims and logs an audit event. ✻ Worked for 42s · done 4:20 PM › /meta-lint ⎿ meta-lint: No page edited yet. Run `/meta-lint <file>` to check one. ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── › ? for shortcuts
README

Claude Code mods by krysmalskipl

Mods for Claude Code, built for SEO and content work. Install only the ones you want.

Install

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.

Mods

ModWhat it doesCommand
🪙openrouter-balanceYour 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-lintThe 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-checkChecks the external links Claude adds. Broken ones go back to Claude so it can fix them, and show above the prompt/links [file]
🪧share-previewHow 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-statsYour 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]`

📏 meta-lint

meta-lint and link-check in Claude Code: /meta-lint details with a search snippet preview, /links, and the SEO line above the prompt

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
Install
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.

What it checks
CheckWhere it looksGreenYellowRed
TitleFrontmatter seo_title, meta_title or title (the first one set), else <title>, else the first # H130 to 60 charactersunder 30over 60, or missing
DescriptionFrontmatter seo_description, meta_description, description or excerpt, else <meta name="description">70 to 160 charactersunder 70over 160, or missing
H1# lines and <h1> tags in the body, outside code blocksone, 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 altany
Wordsthe body, without codeshown, not judged
Commands
  • /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 not

Limits 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.

🔗 link-check

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
Install
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.

How it works
  • After each 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)
  • Claude is told: links that answer 4xx or 5xx, or don't answer at all, go back to Claude with the edit's result, so it can fix or remove them in the same turn
  • You see them above the prompt until they're gone from the file. /links lists them
  • An edit waits at most 6 seconds for its links. A slower host's answer comes later as a toast
  • 401, 403 and 429 count as working: they're usually bot walls or rate limits, and the page opens in a browser
  • Skipped: localhost, 127.0.0.1, example.com, .local, .test and links with template placeholders (${…}, {{…}})
  • Each URL is asked once per session, at most 25 per edit and 6 at a time. Requests go from your machine straight to each link's host, nowhere else
Commands
  • /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 ✗ broken

🪧 share-preview

See 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)
Install
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.

Use it
  • /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 page
  • In the pane: g Google, s shared link, r refresh
What it shows
  • Google: the desktop and mobile result, the title cut at about 600 px and the description at about 920 px (desktop) and 680 px (mobile), measured in Arial glyph widths the way Google draws them, not in characters
  • Shared link: the LinkedIn and Facebook card, Slack's unfurl and X's card (large, small or none, from twitter:card), with the fallbacks each platform uses when a tag is missing
  • Checks, worst first: noindex, 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>
  • Tags set in code ({post.title}, generateMetadata) are marked as such: /preview <url> reads them rendered

The 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.

⏱️ cache-stats

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)
Install
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.

Set the cache lifetime

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.

What the line shows
  • Hit rate of the last request: how much of the prompt the cache served. Green from 80%, yellow from 50%, red under
  • Warm 3m: time left before the cache lapses, counted from the last reply. Once it has, the line says what the next message re-caches
  • Cached: tokens in the cache now, the size of the last prompt
  • Session time since the session started, and how much of it the model spent working
  • avg and requests: the hit rate over the whole session and the number of requests to the model

On a narrow terminal the right-hand parts drop out first.

Commands
  • /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 back

A 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.

🪙 openrouter-balance

openrouter-balance: OpenRouter key limit and today's spend above the Claude Code prompt

Your OpenRouter credit in one line above the prompt, refreshed every 5 minutes and after each turn.

1. Check your Claude Code version
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.

2. Add this marketplace

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.

3. Install the mod
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.

4. Give it an OpenRouter key

Pick the kind of key first:

KeyWhat the line showsWhere to make one
Management key (recommended)The account's real balance, today's spend and the model the money mostly went toopenrouter.ai/settings/management-keys. It can't call models, so it's safe to keep around
Regular API keyOnly that key's own spend today and this month, and what its limit leavesopenrouter.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:

  1. /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.

  1. An environment variable: 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-..."
  1. The macOS Keychain (no key in any file). Paste the key when asked:
   security add-generic-password -a "$USER" -s openrouter-key -w
  1. Your login shell: when Claude Code doesn't see the variables itself (the desktop app started from the Dock never reads ~/.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.

5. Restart and check

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.

Update or remove
claude plugin marketplace update krysmalskipl
claude plugin update openrouter-balance@krysmalskipl

claude plugin uninstall openrouter-balance@krysmalskipl
If something's off
The line saysWhyFix
Nothing at allThe mod isn't loaded yetStart a new session, or /reload-plugins. Check claude plugin list shows it enabled
no key setNo key in any of the four placesStep 4. In the desktop app, the Keychain is the surest place
key rejectedThe key was revoked or disabledMake a new one, put it where the old one was
can't reach OpenRouter yetNo network, or OpenRouter is downIt retries every minute by itself
$0.42 today · $12.30 this month and no balanceA regular key with no limit: it can't see the accountUse a management key for the balance, or set a limit on the key
… · offlineThe last refresh failedThe numbers are the last good ones; it retries every minute
How it counts
  • Green from $5, yellow under $5, red under $2
  • "Today" is the UTC day. With a management key it's the usage now minus where it stood when the mod first saw the day; a day first seen after 00:15 UTC shows "since HH:MM" (UTC)
  • Spend by model comes from OpenRouter's /activity, which holds completed UTC days only

Develop

claude plugin validate mods/<name>
CLAUDE_CONFIG_DIR=$(mktemp -d) claude plugin test mods/<name>

More mods: hamzafer/claude-code-mods.

License

MIT

Source 2 files
hooks/register.tsx 180 lines
1// 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})`
180
types/index.d.ts 17 lines
1// 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