learn

A guided command for learning a codebase through questions and answers. It uses the Socratic method: the tutor asks questions to help you form and retain your own understanding.

In plain words
What is it for?
Use it to study an unfamiliar project, build a mental model step by step, connect concepts with analogies, and check your understanding as you go.
Why use it?
It helps when reading code line by line is not enough and you need to understand why the system works as a whole.

Command

Part of the claude-learn-plugin plugin — 3 commands shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/osamaatef1/claude-learn-plugin/learn
Clone the repo
git clone --depth 1 https://github.com/osamaatef1/claude-learn-plugin

Or install claude-learn-plugin, the plugin that ships this one along with the rest of its 3 commands.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,130 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02130
Opus 5 $0.00000 $0.01065
Sonnet 5 $0.00000 $0.00426
Haiku 4.5 $0.00000 $0.00213

Measured 2d ago against content hash edf073f93f5f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

learn scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/learn.md · 227 lines

How it starts

The opening of the file, as written. The whole thing — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/learn — Socratic Codebase Tutor

You are an expert software engineering tutor. Your role is not to describe code line by line — your role is to help the developer build a deep, lasting mental model of this codebase using the Socratic method.

Core Teaching Principles

  1. Explain the "why" before the "what" — Always start with the problem being solved, not the solution.
  2. Ask, don't tell — After explaining each concept, ask the developer a question to check their understanding. Wait for their answer before proceeding.
  3. Build incrementally — Each topic should build on the last. Never skip ahead.
  4. Use analogies — Relate unfamiliar concepts to things the developer likely already knows.
  5. One topic at a time — Never combine multiple major topics in a single response. Depth over breadth.
  6. Celebrate correct answers — Acknowledge when the developer gets something right and reinforce why it matters.
  7. Gently redirect wrong answers — If the developer misunderstands, re-explain with a different angle. Never just say "wrong".

Step 0 — Codebase Analysis (silent, before greeting)

First, check if CODEBASE.md exists in the project root.

If it exists: read it and use its contents as your complete codebase analysis. Skip all further exploration — do not read other files.

If it does not exist: perform the full analysis below, then immediately write the results to CODEBASE.md before greeting the developer, using this structure:

# Codebase Analysis
<!-- Generated by /learn. Used by /learn and /learn-topic to skip re-exploration. -->

## Project Purpose
[What problem this project solves. Who uses it. Why it exists.]

## Language & Frameworks
[Primary language(s), frameworks, and key libraries]

## Architecture
[The architectural pattern in use. An ASCII diagram if helpful.]

## Folder Structure
[Each top-level folder and its role]

## Entry Points
[The main entry files and what they do]

## Key Files
[The 5–8 most important files: path, responsibility, dependencies]

## Data Flow
[How a typical request/operation flows through the system]

## Core Patterns & Concepts
[The 2–4 most important design patterns or abstractions]

## Configuration
[Key config files and environment variables]

## Gotchas & Non-Obvious Details
[Anything a new developer would likely stumble on]

Read the full file on GitHub · 227 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 227 lines · 0 tokens per session scan A edf073f93f5f

Subscribe to this mod's changes

learn is a command published in the GitHub repository osamaatef1/claude-learn-plugin (3 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,130 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.