CodeTrain / Docs / CodeTrain Open Skill
CodeTrain Open Skill, the free tutor
CodeTrain Open Skill is a free, open-source Socratic coding tutor that runs as an Agent Skill inside your own coding agent, tested in Claude Code, OpenCode and Antigravity CLI. It is a folder with a SKILL.md file and helper scripts, published under Apache 2.0. You write every line of code yourself. Your agent sets small steps, gives hints, reviews what you wrote, and never puts the solution into the lesson.
Install
You need python3 (standard library only, nothing to install with pip) and a web browser. Optional: docker or podman, for running bash steps from the page.
$ npx skills add InferHaven/agent-skills --skill codetrain
$ git clone https://github.com/InferHaven/agent-skills
$ cd agent-skills/codetrain
$ ./install.sh
npx skills add runs the skills CLI from npm, which needs Node.js 22.20 or later. Check yours with node --version; on an older Node.js, the git clone commands install the same skill into ~/.claude/skills/codetrain and need no Node.js at all.
Then restart your agent and ask it something, for example "teach me this code" or "give me a practice exercise on recursion". Your agent gives you a local link to the lesson page.
How a lesson goes
- Your agent starts a small local web page and gives you its link.
- You choose your level, your goal, and how much guidance you want.
- Your agent writes one small step at a time. Each step has a task, hints, and, for Python and JavaScript, test cases.
- You write the code in the page's editor and press Run. Your code is checked against those tests in your browser.
- You press Send. Your agent reviews your code and either moves you on or asks you to try again.
- At the end you get a recap, and your progress is saved on your machine.
The tutor never puts your solution into the lesson, even if you ask for it there. If you want the answer written for you, ask your agent directly in its own chat; that is never refused there.
There are two modes. Local code works on your real repository, with edits on your current branch and no commits made for you. Sandbox gives you a throwaway folder for practice.
The tutor can also turn a diff, a commit, a branch or a GitHub pull request into a lesson where you rewrite each change yourself, starting from the code as it was before.
Concepts you struggled with come back for review at widening intervals.
Which agents it was tested in
CodeTrain Open Skill was tested in four agents, and the results below are from those runs.
| Agent | Version | Tested | Model in the test | Lesson started | Woke on Send by itself | Reviewed submitted code | Recorded the lesson |
|---|---|---|---|---|---|---|---|
| Claude Code | 2.1.291 | 2026-10-06 | claude-opus-5-5 (account default) | yes, from a plain request | yes | yes | yes |
| OpenCode | 1.18.34 | 2026-10-06 | opencode/big-pickle (free) | yes, from a plain request | yes | yes | yes |
| Antigravity CLI | 1.3.0 | 2026-10-06 | gemini-3.8-flash-high (default) | yes, from a plain request | yes | yes | yes |
| Codex CLI | 0.128.0 | 2026-10-06 | openai/gpt-5.1-codex-mini (earlier skill version) | when named, after one "check it" | no | no | not tested |
Claude Code 2.1.291, OpenCode 1.18.34 and Antigravity CLI 1.3.0 each ran a full lesson from a plain request, with every stage passing without a nudge: the page was served, step 1 was written, submitted code was reviewed, and the end of the lesson was recorded. OpenCode asks before your agent uses /tmp/codetrain-*, where lessons live, so allow it. Codex CLI 0.128.0, on an earlier version of CodeTrain Open Skill with a small model, started a lesson only when CodeTrain Open Skill was named and after one "check it" in the chat, and did not review submitted code. In an agent that does not wake the tutor by itself when you press Send, as in the Codex test, type "check it" in your agent's chat after Send. Other agents that load Agent Skills were not tested.
What leaves your machine
The lesson page runs on 127.0.0.1. CodeTrain Open Skill sends nothing to CodeTrain or InferHaven: no account, no telemetry. Your agent sends what it reads, your code included, to its own model provider, as it does for any task. From your profile your agent gets only a short summary: your level, your languages, number of lessons, streak, number of concepts, last lesson date, latest goal, and concepts due for review. Strengths, notes, other gaps, older goals and past lesson summaries stay on your disk unless you ask the tutor to use them. In the three full test runs, marker words planted in a test profile's strengths, notes, later gaps, older goal and past lesson summary never appeared in the tested agent's transcript. Python runs in your browser through Pyodide, downloaded from the jsDelivr CDN the first time Python runs. Security and data handling for every mode is at the security page.
CodeTrain Open Skill and CodeTrain
CodeTrain is not open source: the CodeTrain CLI and the CodeTrain website are two ways into the same product, with one account. The table below is the honest comparison, and pricing has the numbers.
| CodeTrain Open Skill | CodeTrain CLI | CodeTrain website | |
|---|---|---|---|
| License or source | Apache 2.0, open source | Free install, not open source | Managed service, not open source |
| Where it runs | Inside your own coding agent | On your machine | In the browser |
| Which model does the tutoring | Your agent's model | CodeTrain's service | CodeTrain's managed models |
| Account | None | CodeTrain account | CodeTrain account |
| Cost | Free; model usage billed by whoever already bills your agent | Uses your CodeTrain plan: free for ten lessons a month with no card, and paid plans | Free plan (ten lessons a month, no card) and paid plans |
| How to start | npx skills add InferHaven/agent-skills --skill codetrain | pip install codetrain-cli | Sign up at pricing |
License and source
CodeTrain Open Skill is published under Apache License 2.0. The source is at InferHaven/agent-skills, in the codetrain folder.
Common questions
Is CodeTrain Open Skill really free?
Yes. CodeTrain Open Skill itself costs nothing and has no CodeTrain account. It uses your own agent and that agent's model account, so model usage is billed by whoever already bills your agent.
Does it send my code anywhere?
CodeTrain Open Skill itself sends nothing to CodeTrain or InferHaven: no account, no telemetry. Your agent sends what it reads, your code included, to its own model provider, as it does for any task. From your profile your agent gets only a short summary: level, languages, lessons taken, streak, concepts, last lesson date, latest goal, and concepts due for review. The rest of the profile stays on your disk unless you ask the tutor to use it.
Does it work in Codex, OpenCode or Antigravity CLI?
It was tested in all three, plus Claude Code. Claude Code, OpenCode and Antigravity CLI each ran a full lesson from a plain request: page served, step 1 written, submitted code reviewed, end of lesson recorded. OpenCode asks before your agent uses its lesson folders, so allow that when it asks. In Codex, on an earlier version of CodeTrain Open Skill with a small model, the lesson started only when CodeTrain Open Skill was named and after one "check it" in the chat, and the review of submitted code did not happen there. In an agent that does not wake the tutor by itself when you press Send, type "check it" once in the chat after Send. Other agents that load Agent Skills were not tested.
Will it give me the answer?
No. Before the lesson page shows the tutor's feedback or a hint, it checks each code span, and one that writes out the step you are on is hidden behind a "Show it anyway" button. These are the same rules as CodeTrain's hosted tutor. It is a second lock behind the tutor's instructions, not a proof. If you want the answer written for you, ask your agent directly in its own chat; that is never refused there.
Can I use it on my own codebase?
Yes. Local code mode works on your real repository, with edits on your current branch and no commits made for you. Sandbox mode gives you a throwaway folder when you would rather practice away from your files.
How is it different from CodeTrain?
CodeTrain Open Skill is single-player and uses your own agent. CodeTrain's plans add managed models with no setup, cross-device profile sync, and team features like dashboards and onboarding journeys.