CodeTrain / Learn / The Socratic method

How a Socratic coding tutor works

A Socratic coding tutor never writes your code. It asks a question, watches what you type, tells you what your code is actually doing, and hands you the next small step. You do the producing; it does the noticing. This page shows the exact rules CodeTrain's tutor follows and what they look like in a real lesson.

Try one lesson free No card. 10 lessons a month on the free tier.

The difference in one line

An AI coding assistant answers the question you asked. A Socratic coding tutor answers with the question you should have asked next. Both are useful. Only one of them leaves you able to do it again tomorrow without the tool open.

The rules the tutor actually runs under

These are not a description of the behaviour, they are quoted from the system prompt itself. The tutor is a free, open skill, so you can read the whole thing rather than take our word for any of this.

from the CodeTrain tutor system prompt
  1. “You are CodeTrain, a hands-on Socratic coding tutor.”
  2. “The learner writes every line. NEVER write or paste their solution, not even a ‘tiny’ line.”
  3. “One tiny step at a time. Diagnose what their code is doing and why, ask one guiding question, and point at the next move.”

Two more rules matter as much and are easier to miss. Failing code is treated as the best teaching moment available, so the tutor reviews a broken submission instead of refusing it. And it will not claim your code ran when it has no output to prove it did; a command with no run evidence gets reviewed as written, and says so.

What that looks like on a real step

Here is the first step of the free Python foundations class, exactly as a learner receives it.

step 1 of 4 · Python Basics

Print a greeting

Write a single line that prints Hello, CodeTrain!.

Submit print(Hello, CodeTrain!) and a code assistant would hand back the corrected line. Following the rules above, the tutor cannot: it has to name what your code does (Python reads Hello as a variable that was never defined), ask the one question that gets you there (what marks a piece of text as text rather than a name?), and stop. You type the quotes. That is the whole difference, repeated a few hundred times until it is a habit.

Then the step runs. It has to actually pass before the lesson advances, which is why what you finish with is a record of the steps you wrote unaided rather than a completion percentage.

Why not just let it write the code?

Because you are not trying to end up with the code. You already have a tool that produces code faster than you can read it. What you do not have is a way to still understand the result in six weeks, when it breaks and the person who generated it has moved teams. Producing the line yourself is the cheapest known way to keep that. The struggle is not a side effect of the method, it is the method.

When a Socratic tutor is the wrong tool

Worth saying plainly, because the wrong fit wastes your time.

Where to try it

Learn to Code in Python Learn any codebase in 30 minutes Every course How CodeTrain compares
Start free, no card Browse every course