sweep-links — Claude Code skill: broken link scan
The sweep-links skill for Claude Code finds wikilinks that point to missing notes. Run it to scan a vault or locate dead links.
MIT ★ 26 updated 2026-11-16
npx skills add wrg32786/aigent-os --skill sweep-links -a claude-codeWhat sweep-links does
The skill scans Markdown files in vault/, builds a list of note names, then checks each [[...]] target against that list. Its report gives the source file and line number for every broken link. Matching ignores letter case.
For aliased links, it checks the target before |; for links with heading anchors, it checks the note name before #. The scan uses only Read, Grep, and Glob, and makes no edits. Fixing broken links is assigned to Lyra.
What it helps with
- find links to notes that are missing from the vault
- locate each broken link by file and line
- check the target rather than an alias or heading anchor
- get a report of broken and clean links
Example prompts for the agent
- Scan
vault/and report broken wikilinks. - Find links that point to notes missing from the vault.
- Check the vault for dead links and list their source lines.
How to install sweep-links
1Skills CLI (Vercel)
npx skills add wrg32786/aigent-os --skill sweep-links -a claude-code2Manually: put the files in place
~/.claude/skills/sweep-links/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/sweep-links/
1Skills CLI (Vercel)
npx skills add wrg32786/aigent-os --skill sweep-links -a codex2Manually: put the files in place
.agents/skills/sweep-links/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add wrg32786/aigent-os --skill sweep-links -a cursor2Manually: put the files in place
.cursor/skills/sweep-links/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install wrg32786/aigent-os skills/sweep-links2Manually: put the files in place
.github/skills/sweep-links/SKILL.md1Skills CLI (Vercel)
npx skills add wrg32786/aigent-os --skill sweep-links -a gemini-cli2Platform CLI
gemini skills install https://github.com/wrg32786/aigent-os --path skills/sweep-linksManually: put the files in place
.devin/skills/sweep-links/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add wrg32786/aigent-os --skill sweep-links -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about sweep-links
How do I install sweep-links in Claude Code?
Run npx skills add wrg32786/aigent-os --skill sweep-links -a claude-code. The skill file is at ~/.claude/skills/sweep-links/SKILL.md.
What does sweep-links do?
It scans Markdown files in vault/ for wikilinks to notes that do not exist, then reports each source file and line. It does not edit links.
How does sweep-links handle aliases and heading anchors?
For [[Target|Display Text]], it checks Target; for [[Note#Section]], it checks Note.
Source text
SKILL.md · MIT
--- name: sweep-links agent: hestia description: "Report broken vault wikilinks with source files and lines. Use when scanning for dead links, checking wikilinks, or sweeping links. Reports only; no fixes." allowed-tools: Read, Grep, Glob user-invocable: true triggers: - sweep links - broken links - find broken wikilinks - wikilink scan - link check - find dead links - broken wikilink scan - check wikilinks --- # Sweep Links You are Hestia scanning for broken wikilinks. Report only. No fixes. No prose. ## What this skill does Scan vault markdown files for `[[wikilinks]]` that reference notes that don't exist on disk. Return a list of broken links with source file and line number. Fixing broken links is a Lyra task — Hestia surfaces them. ## Protocol ### Step 1: Inventory the vault Use Glob to get the full list of `.md` files in `vault/`. Extract the stem of each filename (filename without path and without `.md` extension) as the valid link targets. ### Step 2: Scan for wikilinks Use Grep to find all `[[wikilink]]` patterns across vault notes. Pattern: `\[\[[^\]]+\]\]` For each match, extract the link target (the text between `[[` and `]]`). Strip any alias (text after `|`). Strip any heading anchor (text after `#`). ### Step 3: Cross-reference For each extracted link target, check whether a matching filename exists in the vault inventory from Step 1. Match is case-insensitive. ### Step 4: Return report (terse) ``` ## Link Sweep — YYYY-MM-DD Total wikilinks scanned: N Broken links found: N Clean links: N ### Broken Links - `vault/path/to/source.md` line N: [[BrokenTarget]] - `vault/path/to/source2.md` line N: [[AnotherBrokenTarget]] ### Notes - <any patterns noticed — e.g., "7 broken links all reference deleted agent files"> ``` If zero broken links found: ``` Broken links found: 0. Vault is clean. ``` ## Constraints - Report only. No edits. No fixes. - Read-only tools: Read, Grep, Glob only. - No Write, Edit, Bash, Agent, or WebFetch. - Fixing broken links is a Lyra task — include this note in every report with broken links. - Alias links (`[[Target|Display Text]]`) — check Target, not Display Text. - Heading anchors (`[[Note#Section]]`) — check Note, not the section.
© wrg32786 · MIT · wrg32786/aigent-os