/llm-tutor:tutor-codebasefrom LLM Tutor
Guides Socratic tutoring through a real codebase by using Read/Grep/Glob to build a file-anchored curriculum. Invoke with a path and optional aspect like '/tutor-codebase ./my-repo' or '/tutor-codebase ./my-repo auth flow'.
Ships in LLM Tutor. 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.
None: SKILL.md is the whole skill.
The distinctive skill of llm-tutor. While /tutor-start teaches abstract topics from world knowledge, /tutor-codebase teaches this specific codebase by reading actual files and building a learning path grounded in real code. Per the research catalog, no commercial LLM tutor handles "teach me this codebase" — that's our wedge.
The mechanics parallel /tutor-start (calibration, cycle charge, persona handoff) but with three real differences:
Read/Grep/Glob) before generating the path. The path's concept ordering reflects the real architecture, not generic textbook ordering."<abstract framing> (<file>:<symbol>)". The tutor knows what to reference during the dialogue.src/auth/middleware.ts before?"Zero deps: this skill uses Read/Grep/Glob (built-in Claude Code tools) for all codebase exploration. It does NOT call out to other plugins' codebase-exploration skills.
STATE="$CLAUDE_PLUGIN_ROOT/scripts/state.sh"
TIER="$CLAUDE_PLUGIN_ROOT/scripts/tier.sh"
bash "$STATE" init >/dev/null
bash "$STATE" refill-cycles >/dev/null 2>&1 || true
CYCLES=$(bash "$STATE" get .user.cycles)
If $CYCLES < 1, refuse:
"Out of cycles — they refill once per day. Run
/tutor-statusto see when next refill is due."
Exit.
The user invokes /tutor-codebase <path> or /tutor-codebase <path> "aspect description".
<path> is required. Without it, refuse: "Need a path. Try /tutor-codebase . for the current directory, or /tutor-codebase ./auth for a subdirectory."<path> isn't a directory I can read." Exit.Resolve to absolute path:
ABS_PATH=$(cd "$USER_PATH" && pwd)
'auth flow', 'how requests are routed'), use it. Slugify it for the slug."overview".ASPECT="${ASPECT:-overview}"
ASPECT_SLUG=$(printf "%s" "$ASPECT" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]/-/g' | sed 's/-\+/-/g; s/^-\|-$//g')
Per locked decision B2: slug = "{repo-basename}-{aspect-slug}".
REPO_BASENAME=$(basename "$ABS_PATH")
SLUG="${REPO_BASENAME}-${ASPECT_SLUG}"
Examples:
/tutor-codebase . from ~/Dev/claude-statusline → claude-statusline-overview/tutor-codebase . 'auth flow' → claude-statusline-auth-flow/tutor-codebase ./agent-skills 'release workflow' → agent-skills-release-workflowIf a topic with this slug already exists, branch:
EXISTING_STATUS=$(bash "$STATE" get ".topics[\"$SLUG\"].status // \"new\"")
in_progress: print "Resuming $SLUG (you've already paid the cycle for this topic). Picking up where we left off." Skip to Step 5.completed: print "You marked this complete already. To revisit as fresh, use a different aspect name." Exit.new: continue to Step 1.This is the part /tutor-start doesn't have. Before generating concepts, you actually read the code. The depth of exploration depends on the aspect:
Goal: build a high-level architectural picture.
Read in this order (use the Read tool for each):
README.md, readme.md, or similar). Always read first if it exists.package.json, pyproject.toml, Cargo.toml, go.mod, pom.xml, Gemfile. Read whichever exists.Glob (e.g., * to see what's at the root).main.py, src/index.ts, cmd/main.go)..github/workflows/, docker-compose.yml, Makefile.Stop here — for overview, you're building a 30-90 minute tutoring session, not a deep dive. Don't read every file; you'll generate concepts that the tutor will read more carefully during the dialogue.
Goal: locate files relevant to that aspect and read enough to scope the learning path.
Grep for auth|session|login|token|middleware|jwt (case-insensitive)Grep for request|handler|route|controller|api$ABS_PATH is large. Scope it to a sub-aspect — try /tutor-codebase $USER_PATH 'how the X module works' instead." Exit.Now with code in your context, generate 5-8 concepts as the curriculum. Per the locked decision A3, each concept has the mixed format:
"<abstract framing> (<file>:<symbol or section>)"
Examples (for an "overview" of a typical Express auth flow):
request entry and routing (src/server.ts:app.use)session middleware ordering (src/middleware/index.ts)auth middleware (src/auth/middleware.ts:requireAuth)session validation (src/auth/session.ts:validateSession)token refresh path (src/auth/refresh.ts:refreshToken)unauthenticated fallback (src/auth/middleware.ts:requireAuth — 401 branch)For each concept, identify which earlier concepts it directly depends on (by 1-based index). The dependency rules are the same as in /tutor-start's D2 — only list direct dependencies, let chains transitively cover the rest.
bash "$STATE" maybe-init-topic "$SLUG"
# Add codebase-specific fields beyond the standard topic schema
bash "$STATE" set ".topics[\"$SLUG\"].codebase_path" "\"$ABS_PATH\""
bash "$STATE" set ".topics[\"$SLUG\"].aspect" "\"$ASPECT\""
Then populate the concepts array. The schema is the same as /tutor-start plus an optional anchor field on each concept:
CONCEPTS_JSON=$(jq -nc '[
{ "name": "request entry and routing", "anchor": "src/server.ts:app.use",
"depends_on": [], "status": "pending", "first_attempt": null, "applications_distinct": 0 },
{ "name": "session middleware ordering", "anchor": "src/middleware/index.ts",
"depends_on": [1], "status": "pending", "first_attempt": null, "applications_distinct": 0 },
{ "name": "auth middleware", "anchor": "src/auth/middleware.ts:requireAuth",
"depends_on": [2], "status": "pending", "first_attempt": null, "applications_distinct": 0 }
]')
bash "$STATE" set ".topics[\"$SLUG\"].concepts" "$CONCEPTS_JSON"
The anchor field carries the file path (and optional :symbol) the tutor will reference during the dialogue. /tutor-path doesn't display anchors by default — they're for the tutor's use, not user-facing browsing.
Same as /tutor-start:
bash "$STATE" add .user.cycles -1
bash "$STATE" set ".topics[\"$SLUG\"].cycles_paid" true
NEW_BAL=$(bash "$STATE" get .user.cycles)
"Tutoring you on $REPO_BASENAME ($ASPECT). ⚡ Charged 1 cycle. Balance: $NEW_BAL remaining today."
Same structure as /tutor-start's Step 3 (3 turns, escalating), but the questions probe familiarity with THIS codebase, not the technology in general.
"Three quick check-in questions before we start the real tutoring — these calibrate where I should pitch. Say 'too easy' / 'too hard' / 'start over' anytime to recalibrate, or 'just teach me' to skip the rest of the calibration."
Probe familiarity with the repo at all.
For overview aspect: "Have you worked in this codebase before? Read the README, poked at any files, run any commands?"
For specific aspect: "What do you currently think happens when [aspect-relevant trigger]? E.g., for 'auth flow': when a logged-in user makes a request, what do you think happens between the browser and the database?"
Wait for response. One question. No lecturing.
Concrete probe of a real file. Use a file from your exploration.
"Open
<a-relevant-file-you-read>. What's the first thing you'd predict it does, just from the file name?"
Or:
"If I removed
<file-or-function>, what would break first?"
The user attempts. If they get it right, they have some familiarity. If they're way off, they're starting fresh.
Based on Round 2:
<file-A> relate to <file-B>?"bash "$STATE" set ".topics[\"$SLUG\"].calibration" '"intermediate"' # or "novice"
Same interrupts honored: "too easy" / "too hard" / "start over" / "just teach me".
Same as /tutor-start's Step 4. Mark calibration-demonstrated concepts as acquired with first_attempt: "success" and applications_distinct: 1. Set current_concept_index to the first non-demonstrated concept and mark it in_progress.
Print the handoff. Codebase tutoring almost always wants productive-failure framing (the user is here to learn the code, and reading + failing + understanding is the path):
"OK. You've got [concepts 1, …, N] already. We're starting at concept (N+1): [name] (anchored in
[file:symbol]).Productive-failure approach — I'll point you at the file, you read it and tell me what you think it's doing. We'll talk about it after you've attempted.
[Pose the first concrete question — match the active persona's voice. Echo asks discovery questions; Cipher poses puzzles; Vex demands precise predictions.]"
"OK. Let's start at the foundations. We're at concept 1: [name] (anchored in
[file:symbol]).Worked-example approach — I'll walk you through this one in detail, then you'll do the next concept more independently.
[Show what the file does, anchoring claims to specific lines. End with a question that requires understanding to answer.]"
After this point, the persona's instructions govern. The persona has the codebase-path context now (the topic's codebase_path field) and can request more file reads during the dialogue as needed.
null?"), let the user try; don't pre-empt./tutor-codebase on the same slug resumes for free./tutor-resume invocations on this topic can reference where the code lives — and surface a clear error if the directory has moved or been deleted since.| Failure | Prevention |
|---|---|
| Tutor reads 50 files trying to "understand the codebase" before generating the path | Step 1's hard cap (~10 reads). After 10, generate the path with what you have. |
| Concepts are too abstract (no file anchors) | Per A3, every concept must have an anchor. If the LLM generates an unanchored concept, append (?) and flag — better to acknowledge missing detail than fake it. |
| Calibration questions reveal the canonical solution | Pose questions about what the user thinks, not what the file actually does. Even if you know, ask. |
| Path generation gives generic "auth in a TypeScript app" concepts that ignore the actual code | The exploration step is supposed to prevent this. If after 10 reads you can't ground the concepts in the actual code, refuse: "I'm not seeing enough structure in $ABS_PATH to scaffold a path. Could you point me at a starting file?" |
| User's path moves between sessions | /tutor-resume checks codebase_path exists; if not, surfaces an error. Not this skill's job to handle, but the field is here for it. |
$ABS_PATH is empty." Exit./tutor-start for the underlying topic instead?"cd into it for the duration of exploration if needed ((cd "$ABS_PATH" && command)), then return to the user's cwd for state writes./tutor-start's broad-subject pushback. Refuse and ask for narrowing.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub flagrare/llm-tutor --plugin llm-tutor12 skills in this plugin
/tutor-doneClose an active tutoring topic. Calculates XP earned from per-concept first-attempt quality, marks the topic complete in state, runs the hybrid feedback flow (thumbs + targeted rotating question with cycles rewards), and logs feedback for later analysis. Invoke when you're done with a topic. Use with no arg to close the currently-active topic, or pass a slug (/tutor-done python-decorators) to close a specific one. Triggers: '/tutor-done', 'I'm done with this topic', 'close out this tutoring session', 'mark this complete'./tutor-pathShow the learning path for an active or completed tutoring topic — the ordered list of prerequisite concepts with progress markers and dependency annotations. Internal-by-default; the path is generated by /tutor-start but kept hidden unless the user explicitly asks to see it. Invoke with no arg to show the current in-progress topic, or pass a slug (/tutor-path python-decorators) for a specific one. Triggers: '/tutor-path', 'show me the path', 'what are we covering', 'show me the curriculum', 'how many concepts left'./tutor-projectStart a tutoring session on the current working directory — convenience wrapper for /tutor-codebase against $PWD. Accepts an optional aspect: /tutor-project (defaults to overview) or /tutor-project 'how requests flow'. Triggers: '/tutor-project', 'tutor me on this project', 'tutor me on what I'm working on', 'teach me this'.