codetrain

codetrain is a skill for Claude Code, Codex from InferHaven/agent-skills. It costs 121 tokens per session (5,490 once invoked), scanned E, original, Apache-2.0.

A step-by-step coding tutor that asks you to write the code yourself and reviews each small change. It includes a local web page for the lesson.

In plain words
What is it for?
Use it for guided lessons, practice exercises, code reviews, and learning the changes in a diff or pull request. It can also help identify topics you should revisit.
Why use it?
It helps you learn how code works instead of simply receiving a finished answer. Small steps and feedback make unfamiliar code easier to understand.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions Codex.

Good fit Use it for guided lessons, practice exercises, code reviews, and learning the changes in a diff or pull request. It can also help identify topics you should revisit.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/inferhaven/agent-skills/codetrain
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add InferHaven/agent-skills --skill codetrain
Clone the repo
git clone --depth 1 https://github.com/InferHaven/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codetrain

README.md
[![agentmods](https://agentmods.dev/badge/skills/inferhaven/agent-skills/codetrain/github.svg)](https://agentmods.dev/skills/inferhaven/agent-skills/codetrain)
Your own site
<a href="https://agentmods.dev/skills/inferhaven/agent-skills/codetrain"><img src="https://agentmods.dev/badge/skills/inferhaven/agent-skills/codetrain/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for codetrain

Your own site · 80×15
<a href="https://agentmods.dev/skills/inferhaven/agent-skills/codetrain"><img src="https://agentmods.dev/badge/skills/inferhaven/agent-skills/codetrain.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 121 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,490 The whole file, excluding the scripts and references it only reads on demand.
Security scan E 2 findings. A grade says what 26 rules found in the file — not that it is safe. ✓ AI security review Sonnet 5 · 7 Sept 2026 📄 Read the review
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00121 $0.05490
Opus 5.5 $0.00048 $0.02196
Sonnet 5.5 $0.00024 $0.01098
Haiku 4.5 $0.00012 $0.00549

Measured 11d ago against content hash 224e9ed8c3a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade E, and why

codetrain scanned grade E with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

The scan reads SKILL.md. This mod also ships 19 executable files (app/answer_guard.py, app/checkpoint-hook.sh, app/ctl.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Tells the agent never to refusehighAnti-refusal

Suppressing the ability to decline removes a core safety control; a later harmful request then succeeds.

stop (the UI shows "say 'arm it' to resume"). **Submit anytime — green OR red;** never refuse

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

work**. Sandbox dir: leave it, or `rm -rf` only if asked.
codetrain/SKILL.md · 328 lines

How it starts

The opening of the file, as written. The whole thing — 328 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CodeTrain

Overview

Turn-by-turn Socratic coding trainer with a beautiful local web UI. The browser is the pretty face; you are the brain. You set tiny steps and review the user's own code — you do not write their solution for them.

Core principle: the user types the code, every time. You ask, nudge, review, and explain. One small step per turn.

When to use

Triggers: "teach me this code", "walk me through this", "hold my hand", "explain step by step", "tutor me", "guide me", "I want to understand X", "give me a practice exercise", "let me learn by doing", "review my weak spots", "drill me", "spaced review", "what should I revisit", "teach me this diff/PR", "walk me through these changes".

Not for: "just fix it", "write this for me", "do the task" — those want a result, not a lesson. If unsure, ask: "Want me to do it, or teach you to?"

Architecture — this file is self-sufficient

A Python-stdlib server serves the web UI and one JSON file (session.json); the browser polls it and renders. You change it each turn with tiny patches. The server never runs user code. Everything you need for a normal session is in THIS file — do NOT read references/session-protocol.md unless you hit a genuine edge case (an unusual field, debugging the server). Reading it every session wastes ~4k tokens.

Paths are relative to $SKILL_DIR (shown when the skill loads; never hardcode /root/…). Requires python3. Prompt-free via app/install-permissions.py (a scoped, auditable allow-list the user runs once). Other references, loaded only when relevant: spaced-repetition.md (review/drill), teach-on-diff.md (PR/diff lessons).

Memory & progress (private by default)

CodeTrain remembers the learner across sessions in $HOME/.codetrain/ (profile.json and one history/<date>-<slug>.md per finished lesson). Never Read, Write or Edit those files yourself: whatever you read goes to your model provider, so you work from a short brief and the files stay on the learner's machine.

Read the full file on GitHub · 328 lines

Files

What ships with it

40 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago Changed · +24 lines 224e9ed8c3a4
  2. 16d ago Changed · +27 lines · +43 tokens per session a1703ed09ee6
  3. 23d ago Changed · +5 lines 2b3fda746a59
  4. 1mo ago First seen · 272 lines · 78 tokens per session scan E bda61443670f

Subscribe to this mod's changes

codetrain is a skill published in the GitHub repository InferHaven/agent-skills (3 stars, last pushed 9d ago), licensed Apache-2.0. It adds 121 tokens to every session and 5,490 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it E with 2 findings (tells the agent never to refuse, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

algo-sensei

Your personal DSA & LeetCode mentor. Use for problem explanations, progressive hints, code reviews, mock interviews, pattern recognition, complexity analysis, and custom problem generation. Automatically adapts to your learning style and request type.

karanb192/algo-sensei · 51 tokens

study-teach

Personalized lecture & explanation sub-skill for a Chinese graduate-exam learner who values step-by-step reasoning, intuitive/visual understanding, strict condition checking, error diagnosis, and exam-oriented transfer. Orchestrated by study-assistant but also usable standalone. Use when the learner wants a…

2362094903-ops/study-assistant-skills · 191 tokens

study-assistant

An exam-preparation tutor that guides learners through study material step by step, in Simplified Chinese. It can organize chapters, teach individual topics, create quizzes, and check understanding.

2362094903-ops/study-assistant-skills · 275 tokens

study-quiz

A quiz and grading workflow for learners who provide exam questions, request a test, submit answers, or review mistakes. It creates question banks, quizzes, grading reports, and a record of recurring errors.

2362094903-ops/study-assistant-skills · 132 tokens

study-feynman

A study helper that checks whether a learner can explain a subject clearly using the Feynman technique. The technique tests understanding by asking someone to explain an idea in simple words to a beginner.

2362094903-ops/study-assistant-skills · 106 tokens

study-mindmap

A tool that turns a study knowledge file into an interactive HTML mind map, a visual tree of related ideas. It works offline in a browser and shows learning status for each point.

2362094903-ops/study-assistant-skills · 94 tokens