lecture-to-anki
A Claude Code plugin that turns lecture slides — a PowerPoint or its PDF — into Anki
decks: cloze and basic cards, with the figures from the slides attached.
Built for medical school, where the lectures are long, the figures matter, and the cards
have to be right.
Why this one
Most AI flashcard tools feed the whole PDF to the model and hope. That is expensive and
the cards come out subtly wrong in ways you only discover six weeks later, mid-review.
This plugin splits the work:
| Stage | Who | Cost |
|---|
| Measure the deck, render sample slides | probe.py | free |
| Decide how this deck should be handled | the model | ~2k tokens, once per course |
| Extract text, figures, learning objectives | extract.py | free |
| Write the cards | the model | the real cost — see below |
| Screen cards, check objective coverage | lint.py | free |
Package into .apkg | build_deck.py | free |
Card-writing is the only expensive stage, and it depends on the lecture. A text-driven
physiology deck runs under 10k tokens. A figure-driven anatomy deck where most slides are
an unlabelled diagram costs far more — a comprehensive pass over 55 anatomy slides
measured ~500k. The skill asks you which you want before it starts, and tells you what
each choice costs.
The model never opens the PDF. It reads a compact markdown digest, plus a figure when a
card genuinely depends on seeing one.
Thresholds are derived, not hardcoded. The probe measures the document's own
distributions and reports the widest natural gap, along with how much to trust it — and
says so plainly when there is no natural split and any cutoff would be arbitrary.
It knows what to ask you, and asks once. Findings are tagged for who should decide.
Layout is never your problem. Intent — where the deck belongs, how thorough to be — is,
and those answers are saved into the course profile so the next lecture asks nothing.
Why the probe step exists. Lecture decks have no common template — one professor sets
titles as text, another renders them as images, a third exports the bullets themselves as
pictures. A fixed pipeline fits whichever deck it was last debugged against. So the
scripts measure and execute, and the model decides: it looks at a few rendered slides,
answers the specific questions the probe raises, and writes a profile.json. That profile
is saved per course, so only the first lecture from a professor pays for it.
Anything the profile still gets wrong degrades safely: a slide that yields neither text
nor a figure is rendered whole rather than dropped, and the run says which slides needed
it.
Does it actually work?
Three fresh agents were handed only SKILL.md — no repo docs, no script source, no
context — and told to run it on a real 55-slide medical anatomy lecture and report every
point of friction.
- Their extractions were identical to the one reached by hand over four rounds of
debugging.
- The second run produced a 117-card deck, 0 lint errors, 82% of cards carrying a
mechanism in
Extra, and confirmed the ~500k benchmark to within 2%.
- The third started from a saved course profile, adopted every preference, and asked
nothing at all.
They also found seventeen defects, including three the author could not have found:
guidance to settle a question by eye that no eye can settle, a lint index that silently
pointed at the wrong card, and a filter that hid the one string naming the course.
Two more fresh agents ran the 1.1 release on the same lecture, one with a saved course
profile and one without. Both built clean decks. Both also found that the saved profile
could not be fed back to the extractor, that two-column slides were being zipped
together line by line, and that a pasted paragraph of textbook text rendered too small
to read — none of which the synthetic fixtures could show. Each run's findings are in
CHANGELOG.md and the commit history.
Install
Add the marketplace, then the plugin:
/plugin marketplace add Skyfox-io/lecture-to-anki
/plugin install lecture-to-anki
There is nothing to install. The PowerPoint path, the linter and the deck builder
are stdlib-only and run on a bare python3. Reading a PDF is best with
PyMuPDF, because nothing pure-Python can render a
figure region out of a PDF; without it, extract.py falls back to a reduced path on
pypdf that reads the text and copies out the embedded
images, and says what it could not do.
PyMuPDF and Pillow are
also used opportunistically to downscale reading copies and apply picture crops. Their
absence costs tokens or fidelity; it never breaks a run.
Anki itself is only needed to import the finished .apkg.
Running in Claude Cowork