Use when user wants to learn a topic or create a study plan. Triggers on "teach me", "I want to learn", "explain X to me", "study", "help me understand", "where do I start with", "how do I get into", or any request to understand a subject in depth. Covers both technical topics (programming, system design, DevOps) and general knowledge (history, science, languages, music theory). Also use when someone asks for a "learning path", "roadmap", or "curriculum" for a topic — even if they don't explicitly say "learn".
Guide the user from a vague "I want to learn X" into a structured, researched learning plan with curated resources. Ask clarifying questions, research the topic, and produce a module-by-module plan saved to disk.
The learning system uses three separate directories. Each directory has ONE purpose:
| Directory | Stores | Allowed fields |
|---|---|---|
~/.claude/learning/plans/ | Learning plans ONLY | topic, slug, created, level, goal, depth, timeCommitment, modules, totalEstimatedTime, diagnostic |
~/.claude/learning/progress/ | Quiz progress ONLY | topic, quizzes, weakAreas, strongAreas, overallScore, spacedRepetition |
~/.claude/learning/ (root) | index.json + profile.json ONLY | topics (index), learningStyle/background/createdTopics (profile) |
CORRECT — saving a learning plan: WRONG — saving a learning plan:
~/.claude/learning/plans/dns-2026-03-29.json~/.claude/learning/progress/dns.jsonCORRECT — saving quiz progress: ~/.claude/learning/progress/dns.json
WRONG — saving quiz progress: ~/.claude/learning/plans/dns-2026-03-29.json
CORRECT — saving any learning data: ~/.claude/learning/plans/dns-2026-03-29.json
WRONG — saving to project directory: ./learning/plans/dns-2026-03-29.json
Always use the ABSOLUTE path ~/.claude/learning/ — never a relative path like ./learning/.
Never add quiz fields (quizzes, weakAreas, strongAreas, spacedRepetition, overallScore) to plan files.
Never add plan fields (modules, resources, goal, depth, timeCommitment) to progress files.
Verify the path is correct BEFORE writing.
Before starting a new plan, check if this topic already exists.
Read ~/.claude/learning/index.json and look for a matching topic (fuzzy match same as quiz skill: "k8s" → "kubernetes").
If the topic exists:
── Resuming: [Topic] ────────────────────
Level: [level] | Modules: [completed]/[total] | Score: [score]%
Last activity: [date]
──────────────────────────────────────────
If the topic is new: proceed to Phase 0 (profile) and Phase 1 (scope).
Read ~/.claude/learning/profile.json if it exists.
If profile exists:
If no profile exists (first time):
~/.claude/learning/profile.json (create directory if needed):
learningStyle: the user's choice (e.g., "hands-on")background: extracted from level + goal answerscreatedTopics: array with the current topic slugIf profile exists and this is a new topic:
createdTopics arrayALWAYS use the AskUserQuestion tool when asking the user questions, in any context. If you have too many questions for the tool, split them up into multiple calls.
Ask 2-5 clarifying questions, skipping any already answered by the user's initial message.
Rules:
Question 1 — Current level:
Ask "What's your current experience with [topic]?" with options:
Question 2 — Learning goal:
Ask "What do you want to be able to do after learning [topic]?" with 3 topic-specific goal options. Each option needs a label and a description.
Question 3 — Depth (optional):
Ask "How deep do you want to go?" with options:
Question 4 — Focus areas (optional):
Ask which areas to focus on. Allow selecting multiple from 2-4 topic-specific subtopics, each with a label and description.
Question 5 — Time commitment (optional):
Ask "How much time do you want to invest?" with options:
If no learner profile exists, also ask "How do you prefer to learn?" with options:
Skip this phase if the user said they have "no experience" or are a "complete beginner."
For users with some background, generate a 5-question diagnostic quiz to calibrate their actual level. This prevents wasting time on material they already know.
How to run the diagnostic:
Generate 5 multiple choice questions testing foundational concepts at increasing difficulty. Ask ONE question per message — wait for the answer before the next.
Each question should have 4 options with descriptions. Label them "Diagnostic Q1/5" through "Q5/5".
After the diagnostic, note which level the user actually tested at:
Store the diagnostic results in the plan JSON by adding a diagnostic field:
{
"diagnostic": {
"taken": true,
"score": 3,
"total": 5,
"calibratedLevel": "intermediate",
"skipModules": []
}
}
Use these results in Phase 3 (Generate Learning Plan) to mark introductory modules as "skippable" or compress them into a quick review.
Perform 3-5 web searches with varied queries:
"[topic] learning roadmap [year]" — find structured learning paths"best [topic] tutorial for [level]" — find recommended resources"[topic] official documentation" — find authoritative sources"[topic] [specific subtopic] guide" — drill into focus areas"[topic] common mistakes beginners" — anticipate pitfallsFor each search:
Synthesize the research into a coherent structure. Don't just list links — understand what the community recommends and why.
Create a structured plan with modules. Present it to the user in readable markdown:
## Learning Plan: [Topic]
**Level:** [beginner/intermediate/advanced]
**Goal:** [user's goal]
**Estimated time:** [total]
### Module 1: [Title]
**Time:** [estimate]
**Objectives:**
- [what the user will understand/be able to do]
**Key concepts:** [list]
**Resources:**
- [resource with link and type]
### Module 2: [Title]
...
Rules:
keyConcepts with at least 2 concept strings — the quiz system uses these to generate questions. A module with empty keyConcepts is broken.Ask the user: "Does this plan look good? Want to adjust anything — add, remove, or reorder modules?"
After user approves the plan:
~/.claude/learning/plans/{topic-slug}-{YYYY-MM-DD}.json/plans/ — NOT /progress/~/.claude/learning/plans/ if it doesn't exist (use Bash: mkdir -p)The JSON format:
{
"topic": "Topic Name",
"slug": "topic-name",
"created": "YYYY-MM-DD",
"level": "beginner|intermediate|advanced",
"goal": "user's stated goal",
"depth": "overview|working-knowledge|deep",
"timeCommitment": "a few hours|a weekend|a week|ongoing",
"modules": [
{
"id": 1,
"title": "Module Title",
"objectives": ["objective 1", "objective 2"],
"keyConcepts": ["concept1", "concept2"],
"estimatedTime": "2 hours",
"resources": [
{
"title": "Resource Name",
"url": "https://...",
"type": "docs|video|tutorial|book|course",
"free": true
}
]
}
],
"totalEstimatedTime": "15 hours"
}
~/.claude/learning/index.json:
{"topics":{}}{
"displayName": "Topic Name",
"planFile": "plans/topic-name-2026-03-01.json",
"progressFile": "progress/topic-name.json",
"created": "2026-03-01",
"lastActivity": "2026-03-01",
"level": "beginner",
"modulesCompleted": 0,
"modulesTotal": 5,
"quizzesTaken": 0,
"overallScore": null
}
Update profile at ~/.claude/learning/profile.json:
{} if missing)learningStyle if determined in Phase 1background from the levelcreatedTopics array (if not already present)Confirm to the user: "Learning plan saved! You can now use /quiz [topic] to test your knowledge, or /resources [topic] to see all resources."
After saving the plan (or when resuming an existing topic), offer to teach the next incomplete module.
Ask: "Ready to start Module [N]: [title]? I can walk you through it now, or you can study on your own and come back for a quiz."
If the user wants to be taught:
Teach the module interactively. The goal is genuine understanding, not information dumping.
Teaching structure for each module:
Connect to prior knowledge — "In the last module you learned [X]. [Topic] builds on that by..." If this is Module 1 or you don't know the user's background, connect to general knowledge or the user's stated goals.
Explain core concepts — Cover each key concept from the module's keyConcepts list. For each concept:
Check understanding — After every 2-3 concepts, ask a quick multiple choice comprehension question. This isn't a quiz — it's a "does this make sense?" check. If the user gets it wrong, re-explain differently before moving on.
Reference resources — Point to specific resources from the module: "For a deeper dive on this, check out [Resource Title] — it covers [specific aspect]."
Summarize — At the end of the module, recap the 3-5 key takeaways.
Bridge to next — "Next up is Module [N+1]: [title], which builds on [concept] you just learned."
Suggest quiz — "Want to test what you've learned? Run /quiz [topic] (and mention the module you just covered) to check your understanding."
Teaching guidelines:
If the user declines teaching:
/quiz [topic] to test your knowledge."Convert topic to kebab-case for filenames: "Kubernetes Networking" → "kubernetes-networking", "Spanish Grammar" → "spanish-grammar". Use lowercase, replace spaces with hyphens, remove special characters.