diff-tutor for VS Code
A cat who teaches you to code by asking about the changes you just made, while
you still remember making them.
Three things it does
Quiz (Ctrl+Shift+Q). A few seconds after you change something, a panel
asks what the change does, with four answers as buttons. One click, and it tells
you whether you were right and why. The changed lines appear zoomed in right
below the question, and the full diff sits underneath.

Chat (Ctrl+Alt+M). An open conversation with the cat about whatever is
on your mind. It carries context from the file you have open, so the questions
can be about the code on screen. The cat answers in character.

Plan (command palette). Design a project architecture by dropping components
into layers, then ask the cat what it thinks. It gives an honest review:
what works, what is risky, and what is missing. Press "Build it" to generate a
starter project. Instead of dumping all the files at once, the cat walks you
through each one with a question about its role in the architecture, so you
understand the project before you start working in it.


Two cats
Mochi is a calico with glasses who teaches in English. She is patient,
encouraging, and occasionally purrs.
Manu is a tuxedo who teaches in European Portuguese. He is mellow, easily
distracted by cozy things, and his code is always precise despite the sunbeam
he is planning to nap in.
Switch between them in the Chat or Plan panels, or in the settings.
What it needs
Git, and a repository open in the window. That is the whole hard requirement.
It also needs a model, and it looks for one in this order:
- The editor's own, such as a GitHub Copilot subscription. Nothing to
configure and nothing extra to pay for. If you have Copilot, you are done.
- A key of your own, kept by the editor in the operating system's
credential store rather than in a file. Set it with the command
diff-tutor: Set the API key, and point diff-tutor.baseUrl and
diff-tutor.model at whichever provider it belongs to.
- A local runner such as Ollama, which needs no key at all. Point the base
URL at it and the key is skipped.
With none of those, the extension says so and offers the way in, rather than
sending a request that can only fail.
What the quiz does not do
It never shows a list. If you missed the last twenty questions, those are gone,
not waiting. A checkpoint older than an hour is never asked about, because by
then the reason you made the change has left your head.
It also stays quiet about changes smaller than four lines. A one-line tweak
carries no lesson, and asking about one teaches you that these notifications
are noise.
Settings
| Setting |
What it does |
diff-tutor.tutor |
mochi teaches in English, manu in European Portuguese. |
diff-tutor.subject |
code for general programming, data for data science and analytics. |
diff-tutor.useEditorModel |
Try the editor's model first. On by default. |
diff-tutor.baseUrl |
The endpoint to use when the editor has no model to lend. |
diff-tutor.model |
The model name at that endpoint. |
Building it
npm install
npm run build
esbuild bundles everything into out/extension.js, including the prompt, the
reply parser and the provider call, which are imported from the app's server/
folder rather than copied. Those three are where a second implementation would
quietly drift: a prompt worded slightly differently produces worse wrong
answers, and a parser that reads one format less loses the quiz without a word.
Then press F5 in VS Code with this folder open to launch a window with the
extension loaded, or copy the folder into ~/.vscode/extensions.
Checking it works
npm run typecheck
node smoke.cjs
The tests cover the decisions; smoke.cjs covers the wiring, by loading the
built bundle with a stand-in for the editor and activating it against this
repository.