cd /news/ai-agents/skill-distill-turn-a-good-claude-cod… · home › topics › ai-agents › article
[ARTICLE · art-180654] src=explainx.ai ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

skill-distill: Turn a Good Claude Code or Codex Session Into a Skill an Open Model Can Follow

Sybil Solutions published skill-distill, an MIT-licensed open-source skill that distills a finished Claude Code or Codex session into instructions an open-weight model can follow, with the repository showing about 1.1k stars and 109 forks across two commits. The tool runs a five-step teacher loop — read the session, launch the student in tmux on a fresh copy of the starting state, compare outputs, fix the first wrong step, repeat — with three trials per skill version and a final human acceptance gate. The README's five honesty rules require identical inputs, no leaked reference answer in the skill, three trials, checks validated on the reference first, and raw logs kept in a git-ignored runs/ folder; it requires tmux, git, Python 3.10+ and a student harness such as omp with DeepSeek-V4.1-Flash.

key takeaway

skill-distill distills a Claude Code or Codex session into a skill for an open-weight student model, running three trials per skill version and fixing the first wrong step each round, with no reference answer allowed in the skill.

by read9 min views4 publishedDec 3, 2026
skill-distill: Turn a Good Claude Code or Codex Session Into a Skill an Open Model Can Follow
Image: Explainx (auto-discovered)

skill-distill is an open-source skill that lets Claude Code or Codex teach a cheaper open-weight model how to repeat a task. The sybil-solutions/skill-distill repository is MIT-licensed, has only two commits, and still shows about 1.1k stars and 109 forks. Its question is stated plainly in the README: "A frontier model did a task well. Can an open-weight model do the same task, given the right instructions?"

This post explains how the teacher and student loop works, how to install it, what the rules guarantee, and what it cannot do. It is a young repository, so we focus on what the README commits to and where you should test it yourself. We covered the same authors' earlier work in Inference Optimisation Skill: hill-climb local LLM serving with an agent.

TL;DR: skill-distill at a glance #

Question Answer from the README
What does it do? Distills a good Claude Code or Codex session into a skill an open-weight model can follow
Who is the teacher? Claude Code or Codex
Who is the student? An agent harness plus a model, for example omp with DeepSeek-V4.1-Flash
Loop Write skill, run student in tmux, compare, fix the first wrong step, repeat
Trials Three per skill version
Final call You: the skill counts as done only when you accept
Requirements tmux, git, Python 3.10+, the student harness; playwright and pillow for web results
License MIT
Output The reusable operator skill plus a produced skill for one task, model and harness

How does the loop work? #

The README lists five steps the teacher repeats:

  1. Read the session. The teacher reads the finished session and writes a skill for the student.
  2. Start the student. It launches the student in tmux on a fresh copy of the starting state, with the original prompt and the new skill.
  3. Compare. It compares what the student produced with what the reference produced.
  4. Find the first wrong turn. It identifies the first place the student went wrong and fixes the skill there.
  5. Repeat. It runs again, three trials per version, until the student matches the reference.

At the end, the teacher shows the reference and the student's best results side by side, and the skill is done only when you accept it. If agent skills are new to you, our guide to what agent skills are explains the file format and how agents load them.

A large vessel pouring a stream into a small one, an image of distilling a frontier session into a skill for an open-weight model

What are the rules that keep it honest? #

The README sets five rules for the teacher. They are the most useful part of the repository, because they guard against the usual ways such an experiment fools itself.

  • Same inputs. The student gets the reference's prompt verbatim, a clean starting state and the skill, and nothing else. The student harness's own global context files and skills are turned off where the harness allows it.
  • No leaked answer. The skill may not contain the reference's finished output or a script that writes it. It teaches "the steps, decisions, traps and checks," with short snippets only where the student cannot otherwise get a part right.
  • Three trials. One lucky run proves nothing, so each skill version gets three trials.
  • Checks tested first. Checks are run on the reference before they judge the student. "A check that fails on the reference is a broken check."
  • Private logs. Raw session logs stay in a git-ignoredruns/ folder, since they contain your machine's paths and context.

Without these, a distilled skill can look good because the answer leaked in, or because one run got lucky. With them, a pass means the student followed instructions in three clean runs.

How do I install and use it? #

The README gives these steps:

git clone https://github.com/sybil-solutions/skill-distill
ln -s "$PWD/skill-distill/skills/skill-distill" ~/.claude/skills/skill-distill   # Claude Code
ln -s "$PWD/skill-distill/skills/skill-distill" ~/.agents/skills/skill-distill   # Codex

You need tmux, git, Python 3.10 or newer, and the student harness installed and pointed at its model. For web results, install playwright and pillow and run playwright install chromium.

Then, at the end of a session that went well, you ask: "distill this session into a skill for omp with deepseek-v4.1-flash on my local server." You can watch the students work with tmux attach -t distill-<task>.

What is in the repository? #

Path What it is
skills/skill-distill/SKILL.md The loop the teacher follows
scripts/distill.py Run bookkeeping: init, trial, status, wait, evidence, verdict, ledger, report, accept
scripts/extract_session.py Turns a Claude Code, Codex or omp session log into a readable reference, dropping system and AGENTS.md text
scripts/capture_web.py Serves a web app, drives it in headless Chromium and saves screenshots and errors
adapters/ One script per student harness: omp, pi, Codex, Claude Code, opencode
templates/student-skill/ The starting shape of a produced skill
examples/ Finished runs: the prompt, the produced skill, the ledger and screenshots

A teacher model passing a thin stream to a smaller one, showing model distillation between a frontier model and an open-weight student

Which student harnesses work? #

The adapter table in the README is honest about maturity:

Harness Status
omp (oh-my-pi) Tested
Codex CLI Tested as the teacher; as a student it needs a provider in STUDENT_ARGS
Claude Code Written; open models need ANTHROPIC_BASE_URL set to an Anthropic-compatible server
pi Written, untested
opencode Written, untested; its JSON log has no parser in extract_session.py yet

So the dependable path today is a Claude Code or Codex teacher with an omp student. Other combinations may need work. For background on harnesses and open-weight models together, see our post on Hugging Face harness adapters with Qwen 3.8.

Why would you do this? #

Cost and control. A frontier model can do a task well but charges for every run. If a task repeats, such as a weekly report, a refactor pattern or a web check, a skill that lets a local or cheaper open-weight model do it can cut the cost per run. Analysts at Gartner argue that open-weight models can handle most agent steps, and we looked at that claim in Gartner and Revolut on open-weight models for agent steps. A related approach, distilling a frontier model's chain of thought into Qwen3 4B, changes the model's weights. skill-distill leaves the weights alone and changes the instructions, which is faster and needs no training, but also weaker.

How should you pick a first task to distill? #

A good first candidate has four traits, and they follow from how the loop is built.

  1. It repeats. The distilled skill pays off only across future runs, so choose work you do weekly or daily, such as a formatted report, a standard refactor or a recurring web check.
  2. It has a checkable result. The loop compares the student's output with the reference. Tasks with a clear artifact, such as a file, a test result or a screenshot, are easier to compare than open-ended writing. The README's web capture script exists for the screenshot case.
  3. It starts from a clean state. The student runs on a fresh copy of the starting state, so the task must be repeatable from a known folder or repository.
  4. The reference session was good. The teacher builds the skill from what the session did. A messy session with many dead ends gives the teacher a noisy reference, so finish a clean run first and distill that one.

Plan the budget too. Count the teacher rounds, three student trials per version, and how many versions it may take. Set a limit before you start, and stop if the student has not improved after a few versions, because a task that needs much more reasoning than the student can supply will not be fixed by better instructions alone. In that case a larger open-weight model or a different harness may be the better change.

What are the limits? #

  • One task, one model, one harness. The README says the produced skill is for exactly that combination. Switch the student model and you must distill again.
  • Cost of the teacher. The loop runs a frontier teacher for several rounds and trials. For a task you run only a few times, that can cost more than it saves. The break-even is the number of future runs.
  • Three trials is a small sample. It guards against one lucky run, but it is not a statistical guarantee. Rerun on new inputs before you rely on the skill.
  • Match is defined by the teacher and you. The teacher compares output to the reference and you accept. If your checks are weak, the skill can pass without being right.
  • Young code. Two commits, two untested adapters and a missing parser for one log format. ReadSKILL.md and the scripts before you run them, since they start processes and, for web results, a browser.
  • Privacy. Session logs hold paths and context. The README keeps them in a git-ignored folder, but check what the teacher reads and what you send to any hosted model.

Where does this fit in our skills coverage? #

skill-distill is a tool for making skills, not a skill for a topic. It pairs well with skills that shape output, such as antialgorithm, and with skill directories and workflows we have covered. For teams that want hands-on practice building and testing agent skills, the explainx.ai workshops cover that workflow.

Bottom line #

The idea is simple and testable: let a strong model write the instructions, then check them on a weaker model, three times, against a reference. The README's rules for avoiding leaked answers and broken checks show the authors thought about the failure modes. With 1.1k stars and two commits, treat it as an early tool worth trying on one repeating task, not as a proven way to replace frontier models.

Details come from the skill-distill README as of December 3, 2026, and can change between commits.

── more in #ai-agents 4 stories · sorted by recency
── more on @skill-distill 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/skill-distill-turn-a…] indexed:0 read:9min 2026-12-03 · —