CodeTrain / Docs

CodeTrain documentation

Everything published about how CodeTrain works, in one place. Pick the section that matches what you are doing.

When to use CodeTrain

Reach for CodeTrain when the goal is that a person ends up able to do the work, and reach for something else when the goal is that the work gets done.

Good fits:

  • A developer has to learn an unfamiliar codebase, and reading a summary of it will not survive contact with the first ticket. Point CodeTrain at the repository and it teaches from the code that is really there.
  • A team lead needs evidence of what an engineer can do without help, for onboarding, for a promotion case, or after a stretch of heavy AI assistance. CodeTrain records unaided completion per step and reports "no data" rather than zero when nothing assessable happened.
  • Somebody wants to learn a specific concept by writing it rather than watching it. Name the topic and a lesson is written on the spot.
  • You want a stepwise lesson generated from any public repository, with secrets and ignored files refused rather than read.
  • A developer already works in Claude Code, or in OpenCode, and wants a tutor inside it. CodeTrain Open Skill, free and open source, installs with npx skills add InferHaven/agent-skills --skill codetrain: same rule that you write every line, no account. See CodeTrain Open Skill.

Bad fits, and we would rather say so:

  • You want the code written. CodeTrain will not do it, by design and with a code-level guard on top of the prompt rule. Use a coding assistant.
  • You want a video course, a quiz, or a certificate. There are none.
  • You want to grade somebody without their knowledge. Every record here is attached to work the person did in front of them.

Which CodeTrain is which?

CodeTrain is one product with one account, and there are two ways in today: the website at codetrain.ai and the CodeTrain CLI on your own machine. CodeTrain Open Skill is a separate, free tool that needs no account.

Best forWho teachesWhere your code goesAccount needed
CodeTrain website (codetrain.ai)Learning in your browser, on any topic you name, on any public GitHub repository, or from curated courses. The homepage also runs a real lesson with no account.CodeTrain's tutor, which writes the lesson.Python and JavaScript run in your browser; languages a browser cannot run, such as bash, run on CodeTrain's servers. Code you submit, and files you attach, reach CodeTrain's servers and the model provider, and are stored in your lesson.A CodeTrain account, with a free plan and no card.
CodeTrain CLIWorking on the repository in your current folder, or on a practice project, from your own machine.CodeTrain's tutor, running on your machine and serving its interface on 127.0.0.1.Your repository stays on your machine: the CodeTrain CLI reads the checkout in place, and only the prompt snippets needed for one tutoring turn go to the model provider. CodeTrain never copies or stores the repository. Lessons stay in your project folder.Signs in to your CodeTrain account, and your plan's limits apply. With your own model key in its config file, model calls go straight to your provider.
CodeTrain Open SkillLearning inside the coding agent you already use, such as Claude Code or OpenCode.Your agent's own model, teaching with CodeTrain's method: you write every line, and it sets the steps, gives hints and reviews your work.The lesson page runs on 127.0.0.1. Your agent sends what it reads, your code included, to its own model provider, as it does for any task. Python runs in your browser.No account, and nothing goes to CodeTrain: no telemetry either. Free and open source, Apache 2.0.

Delivery numbers and the read-through before review

Two commands that work on your own repository and your own change.

codetrain metrics

codetrain metrics prints a delivery report for one repository: how much code is rewritten soon after it lands, how long pull requests wait for a real review, how often checks fail, and how often a deployment is a fix. No login, no account, nothing uploaded by default. It reads the local git history and pull requests, checks and deployments from GitHub through your gh login when gh is installed and signed in.

$ codetrain metrics
  • --repo PATH: the repository to measure, default the current folder.
  • --days N: days to measure, 1 to 365, default 30.
  • --json: print the report as JSON.
  • --no-gh: read git alone, without asking GitHub through gh.
  • --me: measure only your own commits, found by git config user.email, and never upload them.
  • --upload: send the repository's numbers to your team. It needs a login, and the person must be a team owner or admin. It runs once a day per repository, and a second upload the same day is refused. It cannot be combined with --me.
  • --label NAME: the name the team sees for this repository, 1 to 40 plain characters, only with --upload.
  • --team NAME_OR_ID: the team an upload is for, by name or id. It is needed only when the account manages more than one team and the repository has no remembered choice. The CODETRAIN_TEAM variable does the same, and the flag wins over it.

By default the command sends nothing. With --upload, it sends counts only: lines introduced and reworked, review waits as a histogram, pull request counts, failed check counts, deployment counts, distinct authors, the period, an optional label, and a key made from the team and the repository's first commit. No code, file names, commit messages, names or email addresses.

codetrain defend

codetrain defend is a short read-through of your own change before review: the tutor reads your own git diff and asks about three questions, on why the change was made, what it could break, and its edge cases. It is on the Team and Enterprise plans and needs a login.

$ codetrain defend
  • --base REF: the branch or commit the change is read from, default main.
  • --status: posts a codetrain/defend commit status on HEAD with your own gh login. It says success only when every question was answered and none skipped.
  • --terminal: answer the questions in the terminal instead of the browser.
  • --model ID: the tutor model, one of haiku, claude, or an id from codetrain models.

codetrain defend sends parts of the developer's git diff and the answers they type to the AI model. On the managed plan both pass through CodeTrain's model proxy; with the developer's own model key they go straight to the provider. CodeTrain does not store the diff or the answers, but records the model name, token counts and cost of each call, and for the run how many questions were answered and skipped. A commit status is posted only with --status.

The free rework report that codetrain metrics prints

Using the product

  • The homepage runs a real lesson in the browser with no account. It is the fastest way to see what a step looks like and what happens when your code does not pass.
  • The course catalog lists every curated course and class. These are the starting point rather than the product: the tutor writes a lesson on any topic you name, or on any public repository you paste.
  • How the Socratic method works here is the exact contract the tutor keeps, quoted from the code that enforces it.
  • Learning an unfamiliar codebase covers repo mode and what it refuses to read.
  • CodeTrain Open Skill is the free, Apache 2.0 tutor you install into your own coding agent. It covers the install, what was tested where, and what leaves your machine.

Building against CodeTrain

  • Developer API: the public REST endpoints, rate-limit headers, the versioning policy, and how to install the command line tool.
  • /llms.txt: when to reach for CodeTrain, and every page as markdown. Read this first if you are an agent.
  • Any page on this site serves markdown to a client that asks for it with Accept: text/markdown.

Trust and data

What is changing

  • Changelog: what shipped and when, newest first.
  • Roadmap: what is being built, what is next, and what we are still thinking about. Shipped items link to the changelog entry that proves it.
  • Comparisons: CodeTrain against five categories, general AI study modes, AI coding assistants, coding course platforms, AI course builders, and AI onboarding tools, with each page conceding where the other category wins. Two comparison pages name real products: a roundup of Socratic AI coding tutors, and alternatives to Copilot and Cursor for learning.
  • Conductor Network: the affiliate program. What a referral earns, what the rate ladder pays, and how payouts work.