Inspiration
A math teacher once told me something that stuck: a wrong answer isn't just wrong, it's a window into what a kid actually believes. When a student writes $\frac{1}{9} + \frac{1}{4} = \frac{2}{13}$, they're not being careless — they've invented a rule that makes sense to them ("add the tops, add the bottoms"). The teacher's real job is to see that rule and gently take it apart.
The problem is time. Teachers spend their evenings making three versions of the same lesson for kids who are in three different places. I wanted to hand some of that back — take one photo of a student's mistake and turn it into a ready-to-teach lesson, without the teacher ever losing control of the teaching.
I picked fractions on purpose. They're the wall a huge number of kids hit in middle school, the misconceptions are well studied, and — this part mattered most — "correct" is something a computer can actually check.
What it does
A teacher uploads a photo of a student's handwritten work (or picks a sample). Then Chalk:
- Reads it. GPT-5.6 vision transcribes the work and matches it to a small, fixed library of known fraction misconceptions, showing the evidence it used, a confidence level, and alternative explanations. It's framed as a hypothesis, and the teacher has to confirm it before anything gets built.
- Builds the lesson. Once confirmed, it generates a differentiated pack: a scaffolded version, a core version, and an extension, plus an interactive fraction-bar model and targeted practice.
- Checks its own work. A verifier runs real math assertions on the lesson. If something's off, GPT-5.6 repairs just that piece and it's re-checked. Nothing is shown as "verified" unless it actually passed. It handles addition and subtraction of fractions today.
How I built it
Codex built the whole thing — the app, the pipeline, and the part I care most about: the verifier and its repair loop. GPT-5.6 does the thinking at runtime: vision for the diagnosis, a multi-agent step that drafts the lesson pieces in parallel, and a repair call that fixes only the artifact that failed a check.
A few decisions that mattered:
- The model proposes; code disposes. GPT-5.6 returns a declarative spec for the manipulative, and a fixed, vetted component renders it. The app never runs generated code.
- A fixed misconception library. The model can only pick from known misconceptions, which keeps the diagnosis grounded instead of freewheeling.
- Verify on math, not vibes. For $\frac{1}{3} + \frac{1}{4}$, the checker confirms the common denominator is $12$, that the bar shades $4 + 3 = 7$ of $12$ parts, and that every practice answer computes. The renderer and the verifier share one arithmetic module so they can't drift. Privacy was a hard line from the start: images are stripped of metadata, sent with no storage, and never saved. Chalk assists a teacher; it never grades or labels a child on its own.
What I learned
The hard part of an AI teaching tool isn't generating a lesson — models are good at that. The hard part is trusting it. That's the whole reason the self-verifier exists, and building it changed the product from "an AI that writes worksheets" into "an AI that won't hand you a lesson it can't prove is right."
I also learned to keep the model humble. An early version reported 99% confidence on a diagnosis while also asking the teacher to review it — those two things don't belong together. Calibrating that, and always showing the evidence, is what made it feel trustworthy.
And I learned that narrow wins. Every time I was tempted to add another subject, the honest answer was that it would make the one thing Chalk does well a little worse.
Challenges I ran into
- Keeping explanations human. Early lessons leaked internal field names and JSON into the text a teacher would read. I had to teach both the generator and the verifier that a lesson step is a sentence, not a data structure.
- The 36-piece problem. A real upload of $\frac{1}{9} + \frac{1}{4}$ needs a common denominator of $36$, and a 36-segment bar is unreadable. Keeping the visual both honest and legible for messy real-world numbers took several tries.
- Making the repair loop honest. It's easy to fake "self-healing." Making it real — catch a specific failed assertion, fix only that piece, re-run the same checks, then stop — while never showing an unverified lesson, was the trickiest and most rewarding part. ## What's next
Multiplication and division (each needs its own visual model), then other subjects where correctness is checkable. After that, a batch mode: photograph a whole class set, and Chalk clusters the thirty papers into the four or five misconceptions actually present — one targeted lesson per group instead of thirty. And deeper accessibility, including audio and tactile versions of every lesson for blind and low-vision students.
Built With
- codex
- css
- gpt-5.6
- next.js
- node.js
- openai
- openai-api
- react
- sharp
- typescript

Log in or sign up for Devpost to join the conversation.