Explains lecture slides using Claude. For when you have the slides but not the lecture.
Project description
chalk
When self-studying university courses (e.g. CMU 15-411, MIT 6.1810), you often get lecture slides but no lecture videos. The slides alone are rarely self-contained: professors design them as visual aids for a spoken lecture, not as standalone reading material. So you scroll through a PDF, hit a slide you don't understand, and have no way to hear the explanation that was supposed to go with it.
chalk fills that gap. Point it at a lecture PDF, tell it which slides you're stuck on, and it generates a professor-style explanation. It reads all prior slides for context (not just the ones you asked about), so it understands the narrative arc of the lecture before explaining your target slides.
Why not just attach the PDF or screenshot the slides?
You could, but it's more friction than it looks.
Screenshotting slides manually means opening the PDF, navigating to each page, taking a screenshot, and dragging it into a chat. For a single slide that's fine. For slides 5 through 20, it's tedious. And you'd also need to include the earlier slides for context, which you probably wouldn't think to do.
Attaching the PDF directly works for text-heavy documents, but lecture slides are visual artifacts. Diagrams, figures, equations in specific layouts, color-coded code snippets, annotated graphs: these are designed to be seen as rendered images, not parsed as PDF text. When Claude reads a PDF as a document, it processes the text layer. When it sees the slides as images, it processes what the professor actually put on screen.
chalk handles both problems. It renders each page as a high-resolution PNG, automatically includes all prior slides as context, and sends them to Claude's vision API in one call. You type one command; it does the rest.
Two ways to use it
Claude Code (recommended)
If you use Claude Code,
the /slides skill lets Claude read the slide images directly, no API key
needed:
/slides lecture.pdf 15
/slides lecture.pdf 10-15
/slides lecture.pdf 3,7,12 What is the connection between these three slides?
This extracts pages 1 through the last requested page as PNGs, loads them into Claude's context, and explains the target slides with full awareness of everything that came before.
To make /slides available:
chalk --install-skill
Standalone CLI
For terminal use without Claude Code. Requires an Anthropic API key:
export ANTHROPIC_API_KEY="sk-ant-..."
chalk lecture.pdf 15
chalk lecture.pdf 3-7
chalk lecture.pdf 1,3,5
chalk lecture.pdf 1-3,5,7-9
The CLI sends all slides from page 1 through your last requested page to Claude's vision API and streams the explanation to stdout.
Options:
--model MODEL Claude model to use (default: claude-sonnet-4-6)
--prompt PROMPT Custom prompt (default: "Explain these slides.")
--max-tokens N Maximum tokens in the response (default: 8192)
Examples:
chalk lecture.pdf 12 --prompt "Summarize the key equations on this slide."
chalk lecture.pdf 1-10 --max-tokens 16384
Installation
Requires Python 3.12+.
# From PyPI
pip install chalk-pypi
# or
uv tool install chalk-pypi
# From source
uv tool install git+https://github.com/fadli0029/chalk.git
Development
git clone https://github.com/fadli0029/chalk.git
cd chalk
uv sync
# Run quality checks
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
uv run mypy
uv run pytest
License
MIT. See LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chalk_pypi-0.3.0.tar.gz.
File metadata
- Download URL: chalk_pypi-0.3.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07bd31287ccb2e0b6998c8811b1c584edfe029da40c3aa94b3101066f189bade
|
|
| MD5 |
2302087be7f83800b477b5b55c4916c5
|
|
| BLAKE2b-256 |
bf04f7664a3d2be20f49b858d0917f2846f11fbf757162ba0e1fda4ce9614412
|
File details
Details for the file chalk_pypi-0.3.0-py3-none-any.whl.
File metadata
- Download URL: chalk_pypi-0.3.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f2c9bbb46f86d19875f049627fea216acec516264ca6aa1d7065002d1f1ce31
|
|
| MD5 |
dbd75243af48bbf99fe4379f564c34f1
|
|
| BLAKE2b-256 |
a13e32e3a3db9e3bfba797ef7fbb1a6dee176d556d1736c471525e45ed17a265
|