Marginalia

unlisted

by Ben Thinkin

Select a term, hit Explain, and keep the explanation: a link in the note plus an entry in a shared glossary, grounded in a web lookup.

Updated 19d agoMIT
View on GitHub

Marginalia

An Obsidian plugin for people who study from their notes. Select a term you half-know, choose Explain, and Marginalia looks it up on Wikipedia and keeps the answer in two places:

  • In the note, the term becomes a link to its glossary entry, with a footnote holding the short definition and sources, so the note stays self-contained.
  • In a glossary note you choose, one ## section per term: a two-to-four sentence definition written for recall, an optional one-line "how I'd say it in an interview", the sources, and a list of the notes the term was seen in.

Explain the same term from another note later and it links to the existing entry without a new lookup.

If Wikipedia picked the wrong meaning ("Raft" the boat, not the consensus algorithm), click Not right? Ask Claude on the result. Claude reads the paragraph the term sits in, picks the meaning you meant, and rewrites that glossary entry and footnote in place.

A gloss is a short explanation written in a book's margin. This is that, with the looking-up done for you.

Status

v0.2.0 is an early, working build. Explain needs no account: it asks Wikipedia. Ask Claude runs Claude Code headless on your machine (claude -p with every tool disabled), so that part needs Claude Code installed and signed in. Desktop-only.

Install

Build it and copy the output into your vault:

bun install
bun run build
mkdir -p "<your vault>/.obsidian/plugins/marginalia"
cp main.js manifest.json styles.css "<your vault>/.obsidian/plugins/marginalia/"

Then enable Marginalia under Settings → Community plugins.

Use

  1. Select a word or short phrase in a note (up to 120 characters).
  2. Right-click → Explain "…", or run the command Marginalia: Explain selection (bind it to a hotkey). The Wikipedia lookup takes about a second.
  3. The notice names the article it used. If that's the wrong meaning, click Not right? Ask Claude (about 5 to 15 seconds). If Wikipedia found nothing, the notice offers Ask Claude instead and nothing is written until Claude answers.
  4. After the notice has gone, right-click → Explain "…" with Claude, or run Marginalia: Explain selection with Claude (no web).

Settings

SettingDefaultNotes
Claude CLI pathclaudeUsed only by Ask Claude; resolved through your login shell's PATH
ModelsonnetAny model alias Claude Code accepts
Glossary note pathGlossary.mdCreated on first use; folders are created as needed
Context hintemptyA few words added to the Wikipedia search and given to Claude, e.g. "AWS". Keep it short: Wikipedia matches every word
Write footnote in noteonTurn off to keep only the link
Claude timeout90 s

What it writes

In the note, the selected text DAX becomes:

[[Glossary#DAX|DAX]][^m-dax]

and this is appended after the note's last footnote:

[^m-dax]: **DAX** — DynamoDB Accelerator. A fully managed in-memory cache in front of DynamoDB… Sources: [AWS docs](https://…).

In the glossary note, entries are ## sections kept in alphabetical order. Marginalia only ever inserts one section or edits lines inside one; it never rewrites the rest of the file.

Privacy and safety

  • Explain (Wikipedia): only the selected term, plus your context hint if you set one, is sent, and only to en.wikipedia.org. Your note text never leaves your machine. No model is involved, so there is nothing for a web page to talk into anything.
  • Ask Claude: the term, the paragraph around it, the note's title and your context hint go to Claude through your own Claude Code session. Claude runs with every tool disabled: it cannot search, open pages or make requests, so no web page can plant instructions in it and it has no way to send your text anywhere else. The plugin, not Claude, then searches Wikipedia for the meaning Claude chose to attach a real source link.
  • Article text and model output are both treated as untrusted: one line, no HTML, no image syntax, no leading block markdown, before anything is written.

License

MIT.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.