Building Guide

How to Build an AI Tutor Using AI

A single, carefully structured prompt is enough to have Claude Code build a full AI tutor web app for lecture slides — one that explains each slide out loud, answers questions, and never hallucinates facts.

← Installation Guide

🎓 Overview

The AI tutor sits between the instructor's slides and the student's screen: it reads a lecture deck once, then explains it and answers questions forever, without ever re-reading — or misreading — the original PDF.

📄 Lecture PDF
uploaded by instructor
→
🧠 Skeleton Notes
structured facts, once
→
🎤 Explanation + Chat
pre-baked and live Q&A
📝 The Prompt

Paste this directly into Claude Code in an empty project folder. Every bullet encodes a specific design decision — explained one by one below.

💬 Prompt to Claude Code

Goal
Build an AI tutor web app for lecture slides.
Core Flow
Instructors upload a lecture PDF into a course. Students enroll and open a lecture: the slide renders on the left, page by page; on the right, the AI streams a spoken-style explanation of that exact slide. Students can also ask it questions in a chat panel.
Anti-hallucination Design
Don't let the model read the raw slide when answering. First, turn every slide into a structured "skeleton note" (title, body, key facts, common misconceptions) using a vision-capable LLM call, once, at upload time. Every later explanation and every answer must be generated from these notes only — never the raw PDF — so the model can't invent facts, and the expensive step never repeats.
Pre-bake, Don't Generate Live
Write the slide-by-slide explanation for each lecture once (as one continuous conversation, so it reads like a real lecture), cache it, and replay it to every student for free. Only Q&A is generated live, per question.
Progressive Disclosure
The tutor may discuss anything up to the slide the student is currently on, but must refuse to teach ahead — it just says which slide covers it.
Continuity Across Lectures
Summarize each lecture into a short "what this course has covered so far," fed into later lectures' explanations and Q&A, so the tutor can connect ideas across weeks without re-reading every past deck.
Guardrails
Cap questions per day and per conversation; auto-detect and softly refuse off-topic questions, temporarily blocking repeat offenders; keep all limits admin-tunable and invisible to students until they're hit.
Access Control
Instructors own courses; students must be enrolled in a course to see any of its slides, explanations, or chats; add an admin role for usage/cost dashboards and account management.
Editability
Everything the AI generates (notes, explanations, summaries) should be viewable and hand-editable by the instructor, with old versions kept.
prompt · copy verbatim
Build an AI tutor web app for lecture slides.

- Instructors upload a lecture PDF into a course. Students enroll and open
  a lecture: the slide renders on the left, page by page; on the right,
  the AI streams a spoken-style explanation of that exact slide.
  Students can also ask it questions in a chat panel.

- Anti-hallucination design: don't let the model read the raw slide when
  answering. First, turn every slide into a structured "skeleton note"
  (title, body, key facts, common misconceptions) using a vision-capable
  LLM call, once, at upload time. Every later explanation and every
  answer must be generated from these notes only — never the raw PDF —
  so the model can't invent facts, and the expensive step never repeats.

- Pre-bake, don't generate live: write the slide-by-slide explanation for
  each lecture once (as one continuous conversation, so it reads like a
  real lecture), cache it, and replay it to every student for free.
  Only Q&A is generated live, per question.

- Progressive disclosure: the tutor may discuss anything up to the
  slide the student is currently on, but must refuse to teach ahead —
  it just says which slide covers it.

- Continuity across lectures: summarize each lecture into a short
  "what this course has covered so far," fed into later lectures'
  explanations and Q&A, so the tutor can connect ideas across weeks
  without re-reading every past deck.

- Guardrails: cap questions per day and per conversation; auto-detect
  and softly refuse off-topic questions, temporarily blocking repeat
  offenders; keep all limits admin-tunable and invisible to students
  until they're hit.

- Access control: instructors own courses; students must be enrolled in
  a course to see any of its slides, explanations, or chats; add an
  admin role for usage/cost dashboards and account management.

- Everything the AI generates (notes, explanations, summaries) should be
  viewable and hand-editable by the instructor, with old versions kept.
💡 Hand this whole prompt to Claude Code in one message. It's detailed enough that Claude can plan the data model, the upload pipeline, and the chat UI on its own — you'll mostly be reviewing and steering after that.
🛠 Why Each Bullet Is There

These aren't arbitrary requirements — each one closes a specific failure mode you'd hit if you just asked for "an AI tutor app."

1

Skeleton notes stop hallucination at the source

If the model re-reads the raw slide image every time it explains or answers, small misreadings compound and different answers can drift and contradict each other. Extracting a structured note once, at upload time, gives every later generation the same fixed set of facts to draw from — and gives the instructor one artifact to check for correctness instead of infinite live generations.

2

Pre-baking trades a one-time cost for free replay

Generating a fresh explanation for every student who opens the same slide is wasteful and lets the same slide get explained differently to different students. Writing the lecture's explanation once, end-to-end, as a single conversation makes it read coherently like an actual lecture — and every student after the first gets it for free. Only genuinely per-student work (answering a specific question) should hit the model live.

3

Progressive disclosure protects the syllabus pace

An unrestricted tutor will happily explain next week's material to a student who asks ahead, undercutting the instructor's pacing. Telling the model exactly which slide index the student is on, and instructing it to redirect ("that's covered in Lecture 5") rather than answer, keeps the tutor a supplement to the course — not a replacement for its structure.

4

Cross-lecture summaries give memory without re-reading everything

Feeding the model every past deck on every request gets expensive and slow as a course grows. A short running summary — "what this course has covered so far" — is cheap to carry forward and is usually all the model needs to connect a new idea back to something taught three weeks ago.

5

Guardrails keep cost and misuse in check without punishing normal use

Per-day and per-conversation question caps put a ceiling on API cost per student. Off-topic detection stops the chat from becoming a general-purpose assistant. Keeping the limits invisible until hit, and admin-tunable, means the product feels unrestricted to a student behaving normally, while still being controllable by whoever is paying the API bill.

6

Enrollment-based access control matches how courses actually work

Slides, explanations, and chat history are course material — they should be gated the same way a real classroom is: instructors own their courses, students see only what they're enrolled in, and an admin role exists separately for anyone who needs usage and cost visibility across the whole system.

7

Editable, versioned AI output keeps the instructor in control

AI-generated notes, explanations, and summaries will occasionally be wrong or phrased poorly. Making every generated artifact viewable and hand-editable — with old versions kept — means the instructor can correct a mistake once and have it stay fixed, instead of re-generating and hoping the model gets it right the second time.

💬 Example Follow-up Requests

Once the first version is running, keep iterating with simple, direct requests.

Refine Notes

Fix a Skeleton Note

Ask Claude to let instructors correct a specific extracted fact.

On the skeleton note editor, add a diff view so I can see exactly what changed between versions of a note.
Guardrails

Tune the Limits

Ask Claude to expose admin-tunable limits in a settings page.

Add an admin settings page where I can set the daily question cap and off-topic block duration per course.
Access Control

Add a Waitlist

Ask Claude to change how students join a course.

Instead of open enrollment, require instructor approval before a student can access a course.
Analytics

Surface Usage

Ask Claude to extend the admin dashboard.

On the admin dashboard, add a chart of questions asked per lecture, so instructors can see which slides confuse students most.
🌟 Tips for a Smooth Build

A few things that make this workflow much more reliable.

1
Ask Claude to build the pipeline before the UI

Get PDF upload → skeleton note extraction → pre-baked explanation working end-to-end for one lecture first. A working pipeline is easier to debug than a full app with a broken core.

2
Read the skeleton notes yourself before trusting the explanations

Since every later step depends on them, a bad note at upload time will quietly poison every explanation and answer generated from it. Spot-check a few slides after the first upload.

3
Test progressive disclosure explicitly

Ask the tutor a question about a later slide while on an earlier one, and confirm it redirects instead of answering. This is easy to get subtly wrong and easy to verify.

4
Iterate in small, specific requests

Instead of "make the guardrails better," describe the exact behavior you want changed. Specific requests get fixed faster and more accurately.