/CodeTrain

CodeTrain: the AI that won't write your code

An AI trainer that teaches you on your own codebase and never writes the code for you. Free, no card, live today.

CodeTrain is an AI trainer that teaches developers on their own codebase and refuses to write the code for them. It breaks a request into two to six steps, you type every line, and it runs and grades what you wrote against each step’s criteria. The free tier needs no card.

Somewhere on your team right now, a pull request is getting approved by someone who couldn’t rewrite it from scratch. Not because they’re lazy. The assistant wrote it, the tests passed, the diff looked plausible, and the sprint doesn’t stop for philosophy. Do that for a year and you get a team that ships faster every quarter and understands a little less of its own codebase every quarter too.

I ran into this a few times while building the start of InferHaven. The whole point of this company is that you shouldn’t have to hand your code to someone else to get the benefits of AI. But there’s a second thing quietly leaving the building, and no firewall catches it: the skill. When the model types and the human tabs through, the knowledge of how your system actually works stops living in your engineers and starts living in a vendor’s autocomplete.

So I built the opposite tool. Today I’m launching CodeTrain: a hands-on AI trainer that teaches developers on their own codebase, and refuses to write the code for them.

What does a lesson actually look like?

A lesson is two to six steps, each one concrete thing to write in an editor with a Run button. Your code executes immediately, the tutor grades it against that step’s criteria and shows a check or a cross beside each one, then either advances you or asks the question that makes the gap visible. Fail repeatedly and it splits the step rather than handing over the answer.

You ask CodeTrain something real. “Walk me through adding a health check to this Dockerfile.” “I don’t actually understand our retry logic, teach it to me.” It breaks that into a short lesson, usually two to six steps, each one small enough to hold in your head.

Each step is one concrete thing to write in a syntax-highlighted editor with a Run button. You type it. The code executes immediately: Python and JavaScript run right in your browser, shell and a few other runtimes run in an isolated sandbox, web stuff renders in a live preview. Then the tutor reviews what you wrote against the step’s criteria, shows you ✓ and ✗ per criterion, and either advances you or asks the question that makes you see what’s off. Fail a step multiple times and it doesn’t dump the solution on you. It cuts the step in half.

lighthouse@InferHaven · ~/work/inferhaven-core
$ codetrain start --mode repo
Session a6502084e8254276a394d5be578e9229 started (repo mode).
  Plan:     team
  Modes:    sandbox, repo
  Sessions: 0/1000 this month
  Usage:    0% of your monthly allowance (100% left)
  Models:   haiku, sonnet

Your tutor is open in the browser:
    http://127.0.0.1:7341
(workspace: /tmp/codetrain-repo-v555lhi7/repo)

Tutoring is live in your browser keep this window open. Ctrl-C to stop.
Before the lesson: pick your level, how much help you want, and whether the session may build toward a real edit. The goal here is the health check from the terminal above.
CodeTrain session tuner in the browser: comfort level, hint strength, Explore or Guided change on your repo, and a free-text goal

Before the lesson: pick your level, how much help you want, and whether the session may build toward a real edit. The goal here is the health check from the terminal above.

That’s repo mode, the paid tier. The tutor reads your actual repository, builds lessons out of your actual code, and at the end of a guided lesson (can run exploration only if desired) it proposes one integrated patch that lands the code you wrote onto your real branch. You review it like any other diff. Free tier does not include repo mode and drops you into sandbox practice instead: same tutor, same you-type-it rule, generated exercises from natural language.

Here is that health-check lesson, start to finish. Step 2 has you draft the probe on a scratch Dockerfile where mistakes are free:

You write the HEALTHCHECK on scratch first. Run gives you the linter, Send gives you the tutor's verdict against the step's criteria.
Step 2 of 3: drafting a HEALTHCHECK instruction on a scratch Dockerfile, with the task criteria on the left and a green tutor verdict below the editor

You write the HEALTHCHECK on scratch first. Run gives you the linter, Send gives you the tutor's verdict against the step's criteria.

Step 3 moves the line you wrote into the real Dockerfile, all 360-odd lines of it, in the one spot where Docker will actually honour it:

Same instruction, real file. Placement is the lesson here: Docker only honours the last HEALTHCHECK, so it goes right before ENTRYPOINT/CMD.
Step 3 of 3: placing the HEALTHCHECK instruction immediately before ENTRYPOINT and CMD in the repository's real Dockerfile

Same instruction, real file. Placement is the lesson here: Docker only honours the last HEALTHCHECK, so it goes right before ENTRYPOINT/CMD.

Pass the final step and the tutor offers the one targeted patch it guided you on: the diff of what you typed, applied to your working tree only after you approve it.

Every criterion checked, then the patch-back: your change as a reviewable diff. A .codetrain.bak backup is saved before anything is written.
Per-criterion checkmarks and the apply-to-your-repo prompt showing a reviewable diff of the learner's change, with a backup noted before writing

Every criterion checked, then the patch-back: your change as a reviewable diff. A .codetrain.bak backup is saved before anything is written.

Change shipped. A real HEALTHCHECK lives in the repo, and the recap lists what you practiced, not what was generated for you.
Session complete screen titled Change shipped, recapping the concepts practiced during the health-check lesson

Change shipped. A real HEALTHCHECK lives in the repo, and the recap lists what you practiced, not what was generated for you.

This is not another assistant

An assistant’s job is producing code. CodeTrain’s job is producing engineers who understand code, and those two goals pull in opposite directions: the fastest way to ship a diff is to write it for you, and the fastest way to teach is to refuse. Use both tools, for different reasons.

Don’t get me wrong. I use coding assistants daily and they’re great at their job. Their job is producing code. CodeTrain’s job is producing engineers who understand code, and those jobs basically pull in opposite directions.

AI assistant (Cursor, Copilot, Claude Code)

Default: it types

  • You describe, it writes
  • Output: working code, fast
  • Understanding is optional
  • Great when shipping is the goal
CodeTrain

Default: you type

  • It plans tiny steps, you write them
  • Output: a developer who gets it
  • Understanding is graded, per step
  • Great when the goal IS your team

Use both. Seriously. Let the assistant ship the sprint while CodeTrain makes sure the person accepting its diffs could have written them.

Code got cheap. Understanding didn’t. Train the part that’s still expensive.

— The CodeTrain wager

An InferHaven product

The agent runs on your machine, sandbox lessons execute in your browser rather than on our servers, and repo mode works against your local checkout. You can also route lessons through your own model account. It is the same instinct as running your models offline by default, applied to a second thing that leaks: the skill.

InferHaven exists because your code is yours and should stay on your hardware. CodeTrain extends the same instinct to where your code lives secondly: wetware, brains, good ol’ humans. Keep the code in-house, keep the skill in-house with it.

It’s built the way you’d expect from us. The agent runs on your machine. Sandbox lessons execute in your browser, not on a stranger’s box. Repo mode works against your local checkout. And if you’d rather run lessons through your own model account, bring your own key: Anthropic, OpenRouter, Bedrock, Vertex, or even an Ollama endpoint you host yourself!

What does it cost, honestly?

The free tier is real: the in-browser trainer, ten lessons a month, streaks and progress tracking, no credit card. It’s capped because every managed lesson costs us actual inference money.

TierPriceWhat it adds
Free$0, no cardIn-browser trainer, ten lessons a month, streaks and progress
Pro$24 / monthRepo mode on your real projects, fair-use limits, sync across devices, optional BYOK
Team$32 / seatRamp dashboard, per-seat budgets, central billing, onboarding journeys for new hires
EnterpriseTalk to usSSO, and code that can’t leave your network

Team is the one managers keep asking me about, because the dashboard answers a question nobody could answer before: who on this team actually understands what they merged. If Enterprise is you, sales@codetrain.ai.

The build itself is written up separately in how I built a tutor that refuses to write your code, including why the free tier costs so little to run.

Go type something

CodeTrain is live at codetrain.ai. Sign in, ask it to teach you something you’ve been faking your way around, and see how it feels to be the one controlling the keyboard again. There’s a real two-step lesson on the landing page now, no account needed, if you want to try it before you commit to the free tier’s grand total of… zero dollars. The bug it teaches is one that passes its own test.

InferHaven keeps your code yours. CodeTrain keeps the skill yours. Same haven, different cargo. The beacon is active!

— Ethan L.