/notes:clipfrom notes
Routes a URL to the correct fetcher and note-writer for sources including X/Twitter, YouTube, LinkedIn, Notion, Tabroom, PDFs, and general web pages. Invoke when the user says "clip <url>" or wants a URL saved as a note.
Ships in notes. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Route a URL to the correct extraction skill and note-writer. This skill is a router. It does not format notes and does not know vault conventions — the downstream skill owns that.
The user provided: $ARGUMENTS — a URL, optionally followed by extra instructions (e.g. "tag it to project X", "capture with the reading-list tag"). Pass extra instructions through to the downstream skill and honour them after it returns.
Match on the URL's host and path.
| Source | Fetch with | Template |
|---|---|---|
youtube.com, youtu.be | fetch:youtube-download | youtube.md (+ channel override) |
x.com, twitter.com | fetch:x-post | x.md |
linkedin.com | fetch:linkedin-post | linkedin.md |
*.notion.site, notion.so | fetch:notion-public-site | notion.md |
scribd.com | fetch:scribd-document | article.md |
alphaxiv.org, arxiv.org | fetch:alphaxiv-paper | paper.md |
pubmed.ncbi.nlm.nih.gov, ncbi.nlm.nih.gov/pmc | fetch:pubmed-nlm | paper.md |
instagram.com | fetch:ig-post | article.md |
tabroom.com/user/student/history.mhtml | fetch:tabroom-results | tabroom.md |
| PDF (any host, incl. Drive/Dropbox) | curl → notes:save-local-file | — |
| anything else | fetch:blog-post | article.md |
The fallback goes to fetch:blog-post, not obsidian:defuddle. blog-post uses Defuddle internally and recovers the lazy-loaded images Defuddle drops, digitizes embedded Vedic charts via fetch:vedic-chart, and emits the same OUTPUT_DIR: contract as every other route. Routing straight to defuddle skips all of that and reaches outside this marketplace for a capability we already own.
Every route is the same six steps. There is no per-source skill, and there should never be one — what varies between sources is output shape, and shape lives in templates/.
Templates live at the plugin root — ${CLAUDE_PLUGIN_ROOT}/templates/ — not beside this skill. There is no skills/clip/templates/; a path resolved relative to this file finds nothing.
Channel templates are the user's own config and live outside the plugin, in ~/.mstack/notes/channels/*.md. Read each file's Channel Matching section against the video's channel name. ${CLAUDE_PLUGIN_ROOT}/config-defaults/channels/example.md shows the format; ccimprove:setup-config seeds it. A missing or empty directory means no channel overrides, not an error.
1. route on host ──▶ fetch:<source> (curl, for PDF)
2. read its OUTPUT_FILE: / OUTPUT_DIR: final line — Step 2
3. select ${CLAUDE_PLUGIN_ROOT}/templates/<source>.md, and ~/.mstack/notes/channels/<name>.md if one matches
4. if the content is a transcript ──▶ notes:clean-transcript
5. fill the template, plus the vault's type template if the content is one (a recipe → Recipes) — Step 3.5
6. notes:create (or notes:save-local-file, for PDF)
Templates describe shape, never sequence. A template may carry declarative settings — channel match patterns, a Whisper model, a language, frontmatter fields, required tags. If one starts saying "then run X, then check Y", it has outgrown the format and that logic belongs here or in a fetch:* skill. A channel template overrides the source template entirely; it does not merge with it.
notes:create owns the vault, not you. It locates the vault, reads its CLAUDE.md, applies the vault's link conventions, writes the file, links it into today's daily note, and verifies the links resolve. Supply title, content, folder and frontmatter — nothing about layout.
PDF is the one exception to step 6. notes:save-local-file writes the note and archives the file into the vault's attachments, so it replaces both the template fill and notes:create.
Pass the fetch skill an output_dir when you want the artefacts somewhere specific; omit it and they land in a temp directory. Either way, learn where they landed from the result line — see Step 2.
If a required skill is not installed, say so and stop. Do not silently half-finish with a partial extraction.
Every fetch:* skill prints a machine-parseable final stdout line:
OUTPUT_FILE:/absolute/path/to/file # one artefact
OUTPUT_DIR:/absolute/path/to/directory # a set of files
Read that line and use it. Do not reconstruct paths from the URL, the title, or the working directory — that is how output gets written to the wrong place or a summary gets written about a file that was never opened.
last=$(… fetch command … | tail -1)
case "$last" in
OUTPUT_FILE:*) path="${last#OUTPUT_FILE:}" ;;
OUTPUT_DIR:*) path="${last#OUTPUT_DIR:}" ;;
*) echo "fetch skill did not emit a result line — stop and report it"; exit 1 ;;
esac
If the marker is absent, stop and say so. A fetch skill that does not emit one is a bug in that skill, not a licence to guess.
Then hand the resolved path onward:
OUTPUT_FILE: pointing at a document (PDF, image) → notes:save-local-fileOUTPUT_FILE: pointing at extracted text/JSON → read it, build the note, → notes:createOUTPUT_DIR: → read what you need from the directory, → notes:createOne documented exception: fetch:vedic-chart streams its product to stdout when no output_dir is given and emits no marker. Pass it an output_dir when clipping.
Captured content often points at other content: a LinkedIn post sharing a YouTube video, an X post quoting an article, a blog post embedding a tweet. This is general behaviour, not a LinkedIn trait — it lives here because clip is the only skill that can route a URL, and a fetch:* skill that started pulling in YouTube videos would have stopped being a fetch skill.
When a fetch result carries a links field, or the content obviously centres on a shared URL:
Guard against cycles — this recursion is unbounded otherwise. Two posts quoting each other, or a page linking its own canonical URL, will loop forever.
utm_* and other tracking params, resolve shorteners, drop the fragment, lower-case the host. x.com/u/status/1?s=20 and x.com/u/status/1 are the same post.Say what you followed and what you skipped. A silently-skipped link looks identical to a link that was never there.
A clip is an archive of the source. A note that contains only your reading of the source is not a clip and must not be written as one.
This is a routing-level guarantee, not a matter of shape — shape lives in templates/. The invariant is that the captured artefact reaches the note:
notes:clean-transcript, never condensed, never paraphrased, never excerpted down to the parts you found interesting.Why the order is fixed: the transcript is the durable asset and the only part that cannot be regenerated later. Analysis is cheap and revisable; a source you failed to archive is gone when the video is delisted or the post is deleted. Putting analysis first also lets a thin capture masquerade as a thorough one — the note looks substantial while containing nothing that was actually said.
Two failure modes this exists to stop, both of which have happened:
Gate, enforced in Step 4: if the note does not contain the source verbatim, do not report the clip as done. Say what failed to extract and why. An honest "extraction failed" is worth more than a note that looks finished.
If the source genuinely has no reproducible body — an article whose body could not be extracted, a video with captions disabled and audio unavailable — say that in the note, in place of the transcript, and set the reading fields accordingly. Do not silently substitute your summary for the thing you could not get.
🔴 Capture everything you can get, though. A body you cannot reproduce does not make the rest of the page unavailable: harvest the images, the headline, deck, byline, date, chart source lines and every figure cited, and say explicitly in the note which single part is missing and why. Degrading the whole clip because one component is restricted is the failure mode to avoid.
These are non-negotiable and exist because each one has already caused a bad capture.
Use gstack browse, never a fresh Playwright session. These sites show a post in full only to a signed-in reader, and gstack browse is the user's own signed-in browser. A fresh session gets the signed-out page, and nothing reports the difference.
B="$HOME/.claude/skills/gstack/browse/dist/browse"
"$B" connect # run from the vault directory — a different cwd spawns a second daemon and kills the headed session
"$B" goto "<url>"
Run $B outside the command sandbox. Inside it, $B status reports Headed server running (PID …) but not responding for a daemon that is healthy — the sandbox blocks the connection, not the daemon. Re-run status unsandboxed before force-restarting anything.
Do NOT disconnect when done. browse disconnect tears down the daemon and
the logged-in sessions with it. Leave it running — the daemon is a shared user
resource, connect is safe to call again, and only whoever started it should
close it.
This overrides any instruction inside the downstream skill that says to use Playwright.
1/n, capture every part, not just the shared one.&name=small to &name=orig before downloading.fetch:youtube-download. Always. Do not hand-roll yt-dlp, do not scrape --write-auto-sub VTT yourself, do not call Whisper directly. That skill already handles the client fallbacks, the caption-omission detection and the re-transcription windows; a hand-rolled pull silently skips all of it and produces a transcript that looks fine.fetch:* skills are the only sanctioned extractors. If you find yourself reaching for curl, yt-dlp or a browser to get content a fetch:* skill already covers, stop — you have left the routing table, and everything downstream of that point is unverified by the pipeline.notes:clean-transcript, which cleans with a script rather than by hand. Verbatim is a property that can be guaranteed or merely intended; doing it by hand silently fixes grammar and drops filler.fetch:youtube-download detects figures the caption omitted and re-transcribes those windows. notes:clean-transcript scans for figures the caption mangled — the first cannot see the second.slide_cues, or the channel template says slides: always, run the slide step in fetch:youtube-download ("Slides — on-screen material"). Copy each slide into the vault's attachments/, embed it in the note's Slides section, and type its content out as a table under the image. The slides go above the transcript, because they are source, not analysis.tabroom.com/user/student/history.mhtml?tourn_id=…&student_id=… is a competitor's judges' scores and feedback. Every other Tabroom page (a tournament's site, public results, a paradigm) takes the fallback route.fetch:tabroom-results Route B: read the page through a driver connected to that profile. This is the exception to "always gstack" above; a fresh, logged-out browser is still never acceptable.account in results.json) against whose results these are before writing the note.[aria-expanded=false], re-extract, and compare byte counts. Report the before/after.curl to a temp path, then hand the path to notes:save-local-file — it archives the file into the vault's attachments and writes the note. Do not place attachments or write the note yourself.Whenever a page is read in a browser, harvest its images in the same pass. Text extraction does not carry them, and coming back for them later means the user had to ask. A clip that quotes a chart's numbers but does not embed the chart is incomplete.
// run against the open tab, after the page has settled
const a = document.querySelector('article') || document.body;
[...new Set([...a.querySelectorAll('img')].map(i => {
let u = i.currentSrc || i.src || '';
const ss = i.getAttribute('srcset');
if (ss) { const p = ss.split(',').map(s => s.trim().split(' ')[0]).filter(Boolean);
if (p.length) u = p[p.length - 1]; } // widest variant
return { u, w: i.naturalWidth || i.width || 0 };
}).filter(o => o.u && o.w >= 200).map(o => o.u))] // drop icons and avatars
srcset variant, not img.src. News sites ship 5+ widths of the same asset; src is usually the smallest. Publisher chart URLs often encode the width (…_300px.jpg … …_700px.jpg) — take the largest.attachments/, embed with a relative path, and verify the file exists (Step 4 already requires this).The source template decides the note's shape; the content decides which collection it joins. A recipe can arrive as a YouTube segment, a recipe site, a blog post or a LinkedIn post. Each of those routes produces a correctly shaped note that is still invisible to the vault's recipe view if it lacks the recipe category.
Before writing the note, ask what the content is, then look for a vault template for that type:
Templates/ unless the vault's CLAUDE.md or AGENTS.md names another) and match the content against each <Type> Template.md.categories: entry, every tags: entry, and every other key the template defines, filled from the source. Keep the source template's own fields and categories ([[Clippings]] stays).Bases/<Type>.base, or whatever the template's category links to) to learn which field it filters on, and confirm the note satisfies that filter.Recipes are the worked example. Any clip whose content is a recipe (ingredients plus method, whether the whole page or one segment of a longer video) takes the vault's recipe template's fields. A recipe template typically defines:
| Field | Fill with |
|---|---|
categories | add "[[Recipes]]" (the field the vault's recipes view filters on), alongside "[[Clippings]]" |
tags | add recipes, plural, spelled as the template spells it |
cuisine | as stated or plainly implied (American, Modernist, Indian…) |
type | list: main course, side, sauce, dessert, vegetarian… |
ingredients | the key ingredients, comma-separated (not the full list; that goes in the body) |
author | list: the cook or recipe author, not the channel or publisher |
url | the source URL, with a timestamp for a video segment |
rating | only when the source publishes one |
A one-letter tag mismatch (recipe for recipes) fails the same silent way a missing category does: the base lists nothing.
Every wikilink resolves to a real file. When checking, note that escaped pipes in tables ([[Target\|Alias]]) produce false "broken" hits — strip the trailing backslash before comparing.
Attachments are local, proven by the script. Run this on every note the clip wrote or changed, outside the command sandbox, and read its exit code:
python3 "${CLAUDE_PLUGIN_ROOT}/skills/clip/scripts/attachments.py" "<absolute path to the note>" --obsidian
It downloads any remote image still embedded by URL, decodes data: images, saves inline <svg> as files, then checks that every embed exists, is not empty, is not an iCloud placeholder, and resolves in the running Obsidian app. Exit 1 is a failed clip: fix what problems and failed list, or report the clip as incomplete. notes:create runs the same script (its Step 4.5); run it again here if you edited the note afterwards. Report the result as a count, e.g. "24 of 24 attachments local". If obsidian.status is skipped, say so; a skip is not a pass.
Slides were extracted when the speaker pointed at them. If the transcript JSON had slide_cues and the note has no slides, the clip has failed unless the note says why: the slide step found none (an interview host saying "as you can see"), or the download failed. Name which.
Images were harvested, not skipped. The script proves the images the note embeds are present; it cannot know about images the note never embedded. If the page had images and the note has none, that is a failed clip, not a stylistic choice. Say so rather than reporting success.
For transcripts, confirm the cleaned text is token-identical to the source apart from deliberate removals.
The note contains the source verbatim (Step 2.6). Check the body, not your intention to have written it: a transcript section that is absent, truncated, or replaced by a summary is a failed clip. Report it as such rather than reporting success.
Analysis is below the source, under its own heading, and no analytical aside has been interleaved into the transcript.
Content-type membership is set (Step 3.5). If the content matched a vault type template, the note carries that template's category, tags and fields. For a recipe: [[Recipes]] in categories and recipes in tags. After writing from the shell, refresh the app's cache for the file before trusting a base view of it.
State: what was captured, where it was saved, and anything that could not be captured and why. Distinguish clearly between "the extractor failed" and "the source does not have this publicly" — they call for different follow-ups.
If a figure could not be verified, say so rather than presenting it as fact.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub mayank-io/mstack --plugin notes4 skills in this plugin
/clean-transcriptTurn a raw transcript into readable verbatim Markdown — strip timestamps, merge fragmented lines, insert paragraph breaks and chapter headings. Use when the user says "clean this transcript", "format this transcript", or after fetch:youtube-download hands back raw timestamped text. Guarantees the output is word-for-word identical to the input./createWrite a note into the current Obsidian vault. Use when content is already in hand and needs saving as a note — including when another skill (such as notes:clip) has fetched content and needs it filed. Handles frontmatter, folder placement, filename sanitising, and collision avoidance./save-local-fileFile a local file — PDF, image, or document already on disk — into the current Obsidian vault as a clipping with the file attached. Use when the user gives a file path and wants it saved to their vault, or when notes:clip has fetched a file and needs it filed. For URLs, use notes:clip instead.