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.
npx agentmods add skills/inferhaven/agent-skills/codetrainnpx skills add InferHaven/agent-skills --skill codetraingit clone --depth 1 https://github.com/InferHaven/agent-skillsWrote 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.
[](https://agentmods.dev/skills/inferhaven/agent-skills/codetrain)<a href="https://agentmods.dev/skills/inferhaven/agent-skills/codetrain"><img src="https://agentmods.dev/badge/skills/inferhaven/agent-skills/codetrain.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00078 | $0.04324 |
| Opus 5 | $0.00039 | $0.02162 |
| Sonnet 5 | $0.00016 | $0.00865 |
| Haiku 4.5 | $0.00008 | $0.00432 |
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 4d ago.
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. How it starts
The opening of the file, as written. The whole thing — 272 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 (token-cheap)
CodeTrain remembers the learner across sessions in small files under
$HOME/.codetrain/: profile.json (compact — languages+level, goals, strengths,
scheduled gaps, notes, streak, totals) and history/<date>-<slug>.md (one summary
per finished session).
- At start, Read ONLY
profile.json(Read tool, one small file): greet a returning learner, default their level, suggest a topic, and if any gap is due (due≤ today) offer a quick review drill (spaced repetition — seereferences/spaced-repetition.md). Surface it via theprofileblock + intakeintro. Do not readhistory/unless resuming a specific past session. - At end, write two small files (Write/Edit tools): append
history/<date>-<slug>.mdand updateprofile.json(reschedule reviewed gaps + log new ones). First run / no profile: create the dir + a freshprofile.json. Local-only data — no secrets.
What ships with it
32 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.
- app/checkpoint-hook.sh 1.2 KB runs code
- app/ctl.sh 3.9 KB runs code
- app/install-permissions.py 5.9 KB runs code
- app/patch.py 4.1 KB runs code
- app/server.py 16 KB runs code
- app/static/app.js 42 KB runs code
- app/static/editor.js 4.4 KB runs code
- app/static/f-fraunces-400.woff2 66 KB
- app/static/f-fraunces-500i.woff2 41 KB
- app/static/f-fraunces-600.woff2 66 KB
- app/static/f-fraunces-900.woff2 66 KB
- app/static/f-hanken-400.woff2 34 KB
- app/static/f-hanken-500.woff2 34 KB
- app/static/f-hanken-600.woff2 34 KB
- app/static/f-hanken-700.woff2 34 KB
- app/static/f-jbmono-400.woff2 31 KB
- app/static/f-jbmono-500.woff2 31 KB
- app/static/fonts-OFL.txt 13 KB
- app/static/fonts.css 3.5 KB
- app/static/index.html 5.7 KB
- app/static/js-worker.js 1.7 KB runs code
- app/static/logo-anim.svg 1.9 KB
- app/static/prism.js 21 KB runs code
- app/static/pyodide-worker.js 2.6 KB runs code
- app/static/runner.js 4.4 KB runs code
- app/static/styles.css 33 KB
- app/watch.sh 2.5 KB runs code
- install.sh 2.0 KB runs code
- README.md 5.9 KB
- references/session-protocol.md 16 KB
- references/spaced-repetition.md 3.3 KB
- references/teach-on-diff.md 2.5 KB
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.
- 4d ago First seen · 272 lines · 78 tokens per session scan E bda61443670f
codetrain is a skill published in the GitHub repository InferHaven/agent-skills (2 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 78 tokens to every session and 4,324 once invoked, about $0.0004 per session on Opus 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.
Other skills, from other repositories
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…
study-assistant
Study tutor (main orchestrator) for any exam — 考研, 期末考试, certifications. Use whenever the user wants to systematically learn or prepare for an exam from study material. Chinese triggers: uploading a textbook/课件/讲义 with "开始学习" "带我系统过一遍" "复习第X章" "帮我复习"; "继续学习" "上次学到哪了"; "做成思维导图"; uploading/mentioning past exam papers…
study-quiz
Quiz & assessment sub-skill (orchestrated by study-assistant; also usable standalone). Use when the learner uploads past papers/questions ("真题", 历年试卷, 样题), wants AI to search for school-style questions, asks to be tested ("出题" "考我" "测验" "模拟题" "来套模拟卷"), submits answers for grading, or asks to review mistakes. Maintains…
study-feynman
Feynman-technique verification sub-skill (orchestrated by study-assistant; also usable standalone). Use when the user says "费曼检验" "我来讲给你听" "检验我的掌握程度" "看看我学得怎么样", or when a chapter is finished and needs final mastery sign-off. The learner explains a point in their own words; Codex plays a sharp beginner, probes gaps…
study-mindmap
Mind-map sub-skill (orchestrated by study-assistant; also usable standalone). Use whenever a chapter knowledge-point mind map needs to be generated or refreshed — the user says "思维导图" "知识图谱" "脑图", or any knowledge point's mastery/status changed. Renders knowledge.json into a zero-dependency offline-capable interactive…
agent-tutor
Turn any coding agent into a structured personal tutor with a markdown knowledge vault. Interviews the learner to build a personal learning profile (how they think, which explanations they receive best, tone and pace preferences), builds a phased plan shaped by that profile, writes complete lesson notes in the…