I Built /lesson Because AI Agents Are Quietly Killing My Ability to Learn
I'm a software engineering student. And I have a confession: most of the problems I've "solved" this year, I didn't really solve. An agent did. I pasted the error, I described the goal, and the code worked. The assignment was done, the feature shipped, the deadline met — and somewhere in the middle of that, the part where I actually learn something got skipped.
That used to be the whole point of getting stuck. You'd hit a wall, go read a docs page, form a wrong theory, try it, fail, read another page, and eventually the concept would click — and the reason it clicked was that you'd earned the understanding through every wrong turn along the way.
Agents compress all of that into a two-line fix. The wall is gone. And so is the learning that lived on the other side of it.
This isn't an anti-AI piece. I love agents. I use them constantly. The problem is that the teaching signal — the errors, the wrong assumptions, the turning point where something finally made sense — is still there in every session, it just evaporates the moment the session ends. Nobody is reading it. Nothing is learning from it. Including me.
So I built a plugin to fix that.
What /lesson actually does
/lesson react useEffect infinite loop
# work normally, get stuck, get unstuck
/lesson-done
That's it. The first command turns on tracking. You work with your agent like you always would. /lesson-done turns the whole arc into a real lesson: the concept you were actually missing, explained from first principles, using your errors and your commands as examples — with diagrams, a misconception callout, a fix explanation, and a quiz.
It doesn't invent a generic tutorial. It teaches you the thing the session was secretly about.
The insight: a working session is better teaching material than any tutorial
A generic tutorial starts from an abstract topic and invents an explanation. The examples are canned. The errors are fake. The "common mistakes" section is a guess.
A real debugging session contains the exact opposite: the commands you actually ran, the output you actually misread, the belief you actually held, and the observation that actually changed your mind. That is textbook-grade pedagogical signal. It's just unstructured and thrown away.
The whole plugin is a pipeline for catching that signal before it disappears.
How it works
A lightweight PostToolUse hook captures every tool call into arc.jsonl — no LLM calls, no latency, silent on failure. A scorer then filters hundreds of raw events down to the handful that actually mattered: errors, edits, version mismatches, vocabulary spikes. Those become typed nodes in a causal graph — not "and then" but "and because" — connected by edges like contradicted, revealed, enabled. Betweenness centrality identifies which concept everything funneled through. That's the root cause. That's what the lesson is about.
What the generated lesson looks like
Every lesson includes:
- The real goal and the real breakdown moment, in plain language
- A Foundations section built bottom-up from prerequisite concepts
- The core concept explained in depth, with a Mermaid diagram
- Why this bit you specifically — connecting your actual wrong assumption to the concept
- A flowchart of your real debugging path, auto-generated from the graph
- The verbatim fix that actually worked
- A quiz with visible answers
For concepts needing external grounding it cites real sources. For fundamentals it explains from general knowledge. One rule: grounded or nothing — if the session is too thin, it refuses to write rather than produce a weak lesson.
Growing as you grow
~/.claude/lessons/profile.json tracks your misconceptions across every project:
{
"misconceptions": [
{ "concept": "asyncio event loop — coroutine scheduling",
"count": 2, "last_seen": "2026-04-18" }
]
}
When the same wrong mental model resurfaces in a new session, the next lesson opens with a callout: "You've encountered this pattern before. Here's why it keeps appearing." An agent never remembers you made this same mistake three months ago. The profile does.
/lesson-map goes further — it builds an HTML concept graph across all your lessons, linking concepts that co-occurred across sessions. Suddenly the asyncio lesson from March and the Linux kernel lesson from April are visibly connected through a shared node about scheduling.
You stay in control
The [notes] on /lesson are the customization knob. /lesson react stale closure I know hooks basics, focus on the bug pattern skips the intro and goes deep. /regenerate make the foundations deeper and the quiz harder rewrites the last lesson with new direction. The plugin adapts to where you are, not where someone assumed you'd be.
Why any of this matters
If you're a student right now, you've probably noticed the same thing I have: agents are so good that they make the struggle optional. And the struggle is where learning lived.
I don't want to go back to pre-agent development. That's not the argument. The argument is that the teaching signal in every debugging session is still there — agents didn't delete it, they just made it easier to ignore. A plugin that captures it and turns it into a grounded lesson with your own errors as examples is, at minimum, a way to not let every session leave me exactly as dumb as I started it.
You're not supposed to hand learning off to the agent. But you can let the agent help you build the textbook version of what you just survived.
That's what /lesson is trying to be.
Plugin source: github.com/OussemaBenAmeur/lesson. MIT-licensed. Installs on 10 AI coding platforms via one script. Runs locally, no data leaves your machine.