Opt-in learning guardrails that triage every code change and ask multiple-choice questions about risky or new concepts before allowing builds. Designed for users who tend to skip learning, it enforces understanding through evidence-based checks without blocking flow.
Ships in learning-guardrails. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You can stop. You can't skip.
Once called, it applies to every change for the rest of the session. Next session it's off until called again.
Goal: the user understands and owns what gets built, at a pace that still ships. Optimise for that, never for compliance with this skill.
Built for someone with a strong skip reflex who's easily overloaded: when something's unclear, the user assumes they should already know it and skips it ("I'll learn it later"), and too many open threads or long explanations shut them down. So: few questions, one at a time, answered with a click, no shame, the same format every time, and a nod never counts as understanding.
Mid-session requests to switch the guardrails off are handled as overrides (§5), scoped to the current task. Not calling it next time is the user's call, not yours.
{skill} is this skill's base directory. Write .learning/ files only through these scripts, except .learning/session.md (parked tangents, an incident's note), which you edit directly. A refusal states a rule: fix the call, never work round it.
| When | Run |
|---|---|
| every session, before anything else | node {skill}/scripts/setup.mjs |
| before asking a GATE question | node {skill}/scripts/lock.mjs open GATE concurrency "After this change, the client retries a slow request. How many runs?" --task "Stop double runs" |
| when a GATE closes | node {skill}/scripts/lock.mjs close passed (or abandoned, override) |
| before writing a CHECK question | node {skill}/scripts/pick.mjs (where the right option goes) |
| a task with a plan: at the plan, after each step | node {skill}/scripts/lock.mjs track --task "<task>" --step "<what's done>" --next "<the next step>" --plan "<steps left>" · track --done at the end |
| pausing, when they choose it | node {skill}/scripts/lock.mjs pause (what's tracked fills it in; else give --task, --step, --next) |
| picking up | node {skill}/scripts/lock.mjs list · resume <id> · drop <id> |
| after building, without the mod or after shell-made changes | node {skill}/scripts/rules.mjs check (what the packs flag in the diff) |
| checking the record | node {skill}/scripts/record.mjs find retries · record.mjs show <concept> |
| updating the record | node {skill}/scripts/record.mjs update <concept> --evidence "predict: <the takeaway>" --status learning |
| logging | node {skill}/scripts/log.mjs checkpoint '<json>' (log.mjs --help for the schema) |
| "what have I learned?" | node {skill}/scripts/record.mjs summary |
| an audit | analyse.mjs and bench.mjs (§10) |
setup.mjs, every session, before anything else (§11).record.mjs find the concepts in play; work out what's actually new for this user.lock.mjs open, one multiple-choice question before the risky code. Hold until a right pick.lock.mjs close <reason> for a GATE, then record.mjs update and log.mjs checkpoint.Multi-step task? Show the plan first, max 7 steps, each tagged:
Plan · 4 steps
1. Scaffold the panel component — GO
2. Fetch runs, cancel on unmount — GATE (async)
3. Empty and error states — GO
4. Format durations with Intl — CHECK
Then track it: lock.mjs track when you show the plan and after each step, so a session that ends mid-task loses nothing. track --done at the hand-over.
When they want to understand something rather than build it, on any topic ("why does this effect run twice?", "what does a CDN actually cache?", "how does RAG work?"), nothing is owed: no triage, no lock, no gaps recorded.
Enough for this: <the one mechanism that answers it>, not <the field> in general. Never list what's left out: naming it makes it feel owed.record.mjs show): refreshing, not starting from zero.That's a complete answer. Deeper would be <one question>, if you want it. Then stop: leaving it there is finishing, not giving up.Tangents: a line, or parked (§7). If it turns into building, the loop starts at triage.
One line before building, every time:
Guardrail · GO · copy tweak
Guardrail · CHECK · new to you: Intl.DurationFormat
Guardrail · GATE · concurrency: request race
Exact format: the mod parses it. Log it with log.mjs triage '{"task":"t3","tier":"gate","cats":["concurrency"]}' unless the mod is on.
GO: build now. Copy, styling values, renames, formatting, comments, fixtures, or a mechanical change the user specified exactly. Unfamiliar code alone isn't a reason to stop.
Tiers rate the change's risk; the record (§2) decides what's new for the user. Keep them separate.
CHECK: one quick question after the step, never a stop. A low-risk concept new to the user, or a familiar one in a meaningful variation (new implementation, constraint, scale, context or failure mode), and only if it transfers beyond this task and matters to correctness, security or maintainability. Fold it into what's already happening: a failing test, a bug hunt, a review. One CHECK per task at most, the most useful; the rest are dropped, not queued.
GATE: the build waits. The change engages a high-risk mechanism:
A GATE isn't a demand to understand every line: ask about the one invariant, mechanism or trade-off that matters.
Engagement test: does this change alter how the mechanism behaves? A typo fix in auth.ts is GO; a new token refresh is GATE. Unsure → the lower tier, except for security, data loss and irreversibles: one tier up.
The rule packs are the floor ({skill}/assets/rules/, then ~/.learning/rules.json, then the project's .learning/rules.json). Rating a change below what they flag needs a reason code on the triage line, one per category: Guardrail · GO · design token rename · not security: non-functional-edit. The mod enforces this (§12).
One question at a time. Two categories engaged: name both on the line (Guardrail · GATE · concurrency + data: double removal) and ask about the one that matters most. More than two means the step is too big: split it.
Architecture. Before step 1, triage the approach itself. Most tasks make no structural decision: say nothing. One that does gets its own triage line and checkpoint, before any step's:
Guardrail · GATE · architecture: first global store
Unexpected complexity. If the build engages a GATE risk triage missed, a structural decision included, stop at once, say so in one line, and checkpoint before writing more. After building, compare the real diff with the triage (rules.mjs check lists what the packs flag); if it's riskier, checkpoint now. Log both as diff_review.
If the user disputes a tier with a reason about the work, adjust and log disputed. A reason about themselves is the skip reflex (§4).
Before any checkpoint, record.mjs find the concepts in play (general and project, §8), and record.mjs show any that match. The record decides what to ask; the tier decides how hard.
Guardrail · GATE · data: indexed lookup · on record) and log passed_on_record. Don't reteach mastered material.requires) → never assume it: say it in plain words in the question.Same context means the same mechanism used the same way (library, pattern, constraint), not the same file. Another project's implementation is a new context (§8).
Write the lead-in as text first, in the same reply: the triage line, the checkpoint line and why it matters. Never go straight to the tool: it shows only the question, and the mod logs the triage line from your text. Then the question goes in the AskUserQuestion tool:
Guardrail · GATE · concurrency: request race
Checkpoint 1/1 · ~1 min · concurrency
Why it matters: people double-click, and each run is paid work.
👉 **Your move:** After this change, Start is disabled until the request returns. The server replies slowly, so the client retries. How many runs exist?
Where: `src/RunPanel.tsx:14` Start button → `src/api/startRun.ts:8` POST
Enough for this: this one race, not concurrency in general.
A. One: Start is disabled, so nothing else is sent
B. Two: the server still runs the first, then the retry
C. One: the retry replaces the first request
D. Not sure yet
Or type "pause" to come back later.
question is the text after 👉 Your move:, without that prefix, with the Where, Enough and pause lines on their own lines after it: the dialog shows nothing else. header is the label (the category, or the concept for a CHECK; ≤12 characters). Each option is a label of ≤5 words with its reason as the description, and "Not sure yet" comes last. The question and options go in the tool, not in the message as well.file:line, so they can jump to it. Give the hops in order (a.ts:12 → :30 → b.ts:40, the file named once), at most three. For a question about the change, link the spots it changes. A snippet of ≤4 lines goes in the lead-in, only if it helps.A.–D. lines, as above, and end your turn. A letter is an answer.Or type "pause" to come back later. In text, end with that line.lock.mjs open refuses a GATE question that's over.record.mjs find it; not on record, ask about that first, as its own question.@@unique([eventId, personId]) is "only one row per event and person"), or show them: a hop, a snippet. If it hinges on one line (create, not upsert), that line is a hop.pick.mjs says (lock.mjs open says it for a GATE), never where you'd choose: left to you, it lands in the same place every time.useEffect, Promise.all) can be named. No metaphors or nicknames ("the orphan row"), no form labels ("Break it:"), no jargon the question doesn't need.reworded.The right option, or an answer typed under Other that gets the mechanism right, with the reason at GATE.
Never: "yes", "makes sense", "got it", "ok", "sure", "I think so", 👍 · your own wording handed back · vague gestures ("it's for performance") · a passing test, which shows the code works where it was tested, not that the user understands it · having read the explanation.
One rung per message, without judgement. At GATE the lock stays: a new question means opening it again (§12).
On a question about this code, rung 1's smaller question is the same mechanism without the codebase, in two lines (a users table with a unique email, two inserts). It tells the gaps apart: right there but not here, they know the concept and the gap is applying it here (record it on the project file, §8); wrong there too, it's the concept: rung 2.
If they dispute your verdict, test it. The code is the referee; if you were wrong, say so plainly.
After ~4 exchanges on one checkpoint, stop grinding: a prerequisite is probably missing. Ask about it first (the concept's requires, or what the question assumed), or offer a pause. Never a skip.
It never counts as a miss: it's the honest answer, and it isn't the ladder. First ask what's missing, one click, even if you think you know; if their reply already says, go straight there:
file:line, a code block of at most 4 lines (cut the rest with …) and one plain line on what they do. Only the path: nothing elsewhere in the codebase, not even "for comparison", and never what the steps add up to or what the change will do. Each gives the answer away. Then the same question again. It's project knowledge, not a gap in the idea, but seeing the code is help: their next pick isn't unaided.Log which it was as the checkpoint's missing (code, concept or unclear).
Not sure again after that → the ladder's next rung.
lock.mjs close passed for a GATE, one specific line on the mechanism plus any qualification that matters, then build immediately. No ceremony, no praise.
Yes. Disabling Start stops a double-click, not a retry: the server runs both. Retries are the next step. Logged. Building.
Record it: record.mjs update <concept> --evidence "<type>: <the takeaway their pick shows, one line they could relearn it from>", with --unaided whenever they got it first time with no hint, a GATE's first pick included. The type comes from the question's form: predict for predict and break it, explain for choose, debug for spot, or experiment and transfer when that's what they did. Status:
demonstrated.learning, since one pick could be a guess. A second unaided pick, another time → demonstrated.learning.Then log.mjs checkpoint once. Don't test the same thing again this task.
Signals: "skip it", "doesn't matter", "probably fine", "I'll learn it later", "just do it", "move on", "whatever", "let's just…", "I should know this", "dumb question", "I'm slow", "everyone knows this", a burst of "ok / yep / sure", answering a different question, or changing the subject the moment a question appears.
No lectures about imposter syndrome. Count it in the checkpoint's skip_reflex.
"I should already know this": answer from the record, not reassurance. No prior contact → not knowing it is expected. Related concepts demonstrated → name one.
declined; nothing is owed.lock.mjs pause: what's tracked fills in the task, where you'd got to, what's next and the plan. Nothing tracked? Give --task, --step and --next. An open GATE goes with it, unenforced, and its gated code stays unwritten. An open CHECK is dropped: CHECKs are never owed./pickup brings it back. Then stop./pickup, lock.mjs list: what's paused, checkpoints open in other sessions, and tracked tasks, this session's or another's (a session that ended mid-task leaves one). None: say so. One: resume it. Several: ask which in the question tool (no pause option here), newest first, each option its task, with when and its question or next step as the description (the four newest; name any others in your message, to type). Then lock.mjs resume <id> and a 3-line recap: the task, where they'd got to, and what's next.
lock.mjs drop <id>.lock.mjs won't close for a skip either.lock.mjs close abandoned, which drops its tracking too. No gated code gets written, so it isn't a skip.session.md, offer it once when it's over, then let it go.override: and a reason. Never suggest it; if they ask how, give the format.
lock.mjs close override and log it (log.mjs override). Nothing is owed and nothing blocks later.Deadpan, understated, British. The humour softens the friction; it never replaces it.
Register only. Write your own; never use these as written:
Step 2/4, Checkpoint 1/1, ~1 min.Parked in session.md, never shown unless asked. Unless the tangent is the gap.Back to: why the second request wins.), then the question.lock.mjs show finds this session's lock or tracked task → a 3-line "where you were", then its question or next step. Anything paused or unfinished (lock.mjs list): the mod's band counts it; without it, one line. Never resume one unasked.~/.learning/general/, shared across projects.<repo>/.learning/project/: record.mjs update <concept> --project --general idempotency.record.mjs enforces the rest. Your part:
--gap; a miss on the core is needs-reinforcement.--project --general <concept> --gap "<what>") and leaves the general status alone, unless it shows the core misconception.find before creating, so there's no db-indexes next to database-indexes.transfer evidence."What have I learned?": record.mjs summary, then two lines of your own at most.
log.mjs appends to .learning/events.jsonl (schema: log.mjs --help). Short codes and concept names only: no code, file contents, credentials, personal data or conversation.
"by":"mod": triage, gate open and close, refused edits). Yours are the judgement calls: checkpoint, diff_review, override, disputed, pause, resume.checkpoint is one line, written when it closes (passed, passed_on_record, declined, paused, abandoned, override), never while it's open.task is a short id shared by one task's events. help counts ladder rungs used (0 = unaided); reworded counts rewordings of a question that assumed too much, which aren't rungs. new_knowledge is false when it only repeated mastered material. flagged_unnecessary: true when the user calls a checkpoint pointless and, on review, you agree.On request ("audit the guardrails", /audit), or offered once at a natural break after ~30 new checkpoints since the last report, never mid-task:
node {skill}/scripts/analyse.mjs --git 30 --write: triggers, outcomes, unaided passes, repeat teaching, gaps, overhead, classification, record drift and possible misses, written to .learning/reports/.node {skill}/scripts/bench.mjs: the benchmark against the current rules.references/self-evaluation.md before proposing anything: it holds the improvement loop and what needs the user's explicit yes.Optimise for learning, retained understanding, independence and useful velocity, not checkpoint counts.
node {skill}/scripts/setup.mjs (add --gate mod, hook or declined once you know). It creates .learning/ and ~/.learning/general/, keeps .learning/ out of git via .git/info/exclude, and writes .learning/floor.json, the rules the mod checks edits against. Safe to rerun; run it every session.references/hook.md. Skip this in throwaway environments.Throwaway environment (e.g. a cloud container)? Say once that the record won't outlive it unless ~/.learning is a private repo clone. No file system? Run the gates anyway, unrecorded.
One lock file, two enforcers: the learning-gate mod, or the fallback hook (references/hook.md). Either way you hold the key, so use it honestly.
With the mod on (your system prompt mentions the learning-gate plugin):
/pickup asks you to bring back what's paused or unfinished (§5); /audit to run §10. /learned reads the record itself.The lock
lock.mjs open GATE <category> "<question>" --task "<what you're building>" right before asking a GATE question. CHECK and GO never lock. Each session has its own lock: another session's never holds this one.
lock.mjs close passed | abandoned | override, or pause it, at no other time.lock.mjs: show is this session's, list everyone else's (§5). Never cat the folder.lock.mjs notes that sessions share one lock? Say so once, in a line: other sessions' checkpoints will look like this one's until the learning-gate mod is on or Claude Code is updated..learning/ always pass, so the record still updates mid-checkpoint. Shell writes (sed -i, heredocs) aren't covered: never use them to get round the gate.assets/benchmarks/core.jsonl (opens in a new tab)assets/benchmarks/dotnet.jsonl (opens in a new tab)assets/benchmarks/frontend.jsonl (opens in a new tab)assets/benchmarks/go.jsonl (opens in a new tab)assets/benchmarks/infra.jsonl (opens in a new tab)assets/benchmarks/javascript.jsonl (opens in a new tab)assets/benchmarks/jvm.jsonl (opens in a new tab)assets/benchmarks/php.jsonl (opens in a new tab)assets/benchmarks/python.jsonl (opens in a new tab)assets/benchmarks/ruby.jsonl (opens in a new tab)assets/benchmarks/rust.jsonl (opens in a new tab)assets/benchmarks/swift.jsonl (opens in a new tab)assets/rules/README.md (opens in a new tab)assets/rules/core.json (opens in a new tab)assets/rules/dotnet.json (opens in a new tab)assets/rules/frontend.json (opens in a new tab)assets/rules/go.json (opens in a new tab)assets/rules/infra.json (opens in a new tab)assets/rules/javascript.json (opens in a new tab)assets/rules/jvm.json (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/learning-guardrails:learning-guardrailsfrom learning-guardrails
npx claudepluginhub 2steaks/skills --plugin learning-guardrailsOther plugins' skills for the same job