Prompt-Level Distillation for Coding Agents: What I Learned from 146 Claude Code Sessions
Fable was out and I was using it within the limits to see what it's capable of doing, and I thought to myself, why not try to see if I can use fable to teach my day to day models some lessons to improve them, so I still retain some of its judgements and discipline before it's locked behind a paywall.
My existing Claude code sessions were the best source for it. I asked fable to analyze it for me and this is what it came up with:
146 sessions, 1,586 human turns, 687 flagged as corrections/frustration
That's actually enough data to identify where the models I used often (Opus 4.8 and Sonnet) did less than I expected. Look at the 687 corrections!
here's an actual breakdown of it :
| Rank | Failure mode | Hits |
|---|---|---|
| 1 | Unwanted changes / scope creep ("don't touch that", "revert", "I only asked for X") | 354 |
| 2 | Act-before-plan ("wait", "explain first", "why did you") | 275 |
| 3 | Didn't follow instructions ("I already said", "follow the pattern") | 149 |
| 4 | Repetition / looping (same mistake N times) | 104 |
| 5 | Didn't check first | 79 |
| 6 | Assumptions / hallucination (referenced things that don't exist) | 69 |
| 7 | Claimed done but broken | 65 |
So I asked fable how differently it would have worked if it was given these same tasks, and I captured its judgments to a reusable set of Skills and hooks.
One technical limitation to clarify though: Model distillation is an actual technique where you can use a Large, well performing LLM to act as a teacher for smaller student models. I was inspired to try this out after coming across the Gemma4 12B parameter model which was distilled and trained using Fable and Composer 2.5 by someone recently. [https://huggingface.co/yuxinlu1/gemma-4-12B-agentic-fable5-composer2.5-v2-3.5x-tau2-GGUF]
I've tried both Gemma4 native version and the distilled version locally and noticed clear differences and thought I should really try something similar..
But again, the limitation: This is not traditional distillation in the ML sense. We cannot transfer the weights or the latent reasoning of Fable into Sonnet or Opus (Like they did to Gemma4), but this is a different distillation technique called Prompt-Level Distillation (PLD) [https://arxiv.org/abs/2602.21103].
After the analysis, I identified two kinds of failures:
- Judgment failures - The fixes for these issues depend largely on how Claude works. A skill affects behavior only when it is invoked. But whether a skill invoked depends on the skills description matching the prompt. So we can't put the fixes for these issues as a skill. So this must be an always-on instructions (preferably in CLAUDE.md file)
- Mechanical failures - These are actually costly mistakes. For example, in several instances it pushed to the repository without my permission. It edited files without reading the file first etc. These kinds of failures do not depend on the prompt and these can be deterministically checked, and we can use hooks to control this.
There are a few real lessons learned.
I tried prompting similar tasks to Sonnet, Opus and Fable. They all worked equally well on some tasks. This does not mean all three are the same, but it proves Sonnet and Opus are already doing good. My realization was that mostly, the gap between a stronger model and a cheaper model on most tasks is not in the model's IQ, but in the discipline.
Final outcome: Honestly, you can't teach the cheaper model to have the Large model's brain. That's not going to work. The final outcome is a distillation of my own standards, reverse-engineered from where i kept asking the same things from the model, with the help of a larger model like Fable.
I have uploaded the final artefacts to my github and wrote this same thing in medium. Feel free to check it out.
https://github.com/Nimeshka/claude-code-discipline