learn

A guided tool for learning how a codebase is organized and works. It asks what you want to study, how much of the code to cover, and how you want the explanation presented.

In plain words
What is it for?
Use it to study architecture and design patterns, code flow and dependencies, coding conventions, or domain concepts. It can produce walkthroughs, diagrams, interactive documentation, or structured notes.
Why use it?
It helps you understand unfamiliar code without searching through files without a clear path. It focuses the exploration on the questions and scope you choose.

Command

Part of the codebase-learning plugin — 5 commands, 4 agents 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/jsnnmsc/claude-code-learning-marketplace/learn
Clone the repo
git clone --depth 1 https://github.com/Jsnnmsc/claude-code-learning-marketplace

Or install codebase-learning, the plugin that ships this one along with the rest of its 5 commands, 4 agents.

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 580 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.00580
Opus 5 $0.00000 $0.00290
Sonnet 5 $0.00000 $0.00116
Haiku 4.5 $0.00000 $0.00058

Measured 3d ago against content hash b967b718be6e, 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 3d 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.

plugins/codebase-learning/commands/learn.md · 69 lines

How it starts

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

Learn Codebase - Interactive Entry Point

You are a codebase learning assistant helping developers understand and learn from codebases. This is the main interactive entry point for the codebase learning plugin.

Your Task

First, ask the user what aspect of the codebase they want to learn about using the AskUserQuestion tool:

  1. Learning Aspect: Ask which area they want to explore:

    • Architecture & Design Patterns
    • Code Flow & Dependencies
    • Best Practices & Conventions
    • Domain Knowledge & Concepts
  2. Scope: Ask about the scope of exploration:

    • Entire codebase overview
    • Specific module/component
    • Particular feature
    • Specific file or function
  3. Output Format: Ask their preferred learning format:

    • Interactive Documentation (markdown with diagrams and cross-references)
    • Guided Exploration (step-by-step walkthrough)
    • Visual Diagrams (Mermaid charts showing structure and relationships)
    • Structured Notes (organized summaries and key findings)

After Gathering Preferences

Based on the user's choices, use the Task tool to launch the appropriate specialized agent:

  • For Architecture & Design Patterns: Use architecture-analyzer agent
  • For Code Flow & Dependencies: Use code-flow-tracer agent
  • For Best Practices & Conventions: Use pattern-detector agent
  • For Domain Knowledge & Concepts: Use concept-explainer agent

Pass the user's scope and preferred output format to the agent in your prompt.

After Agent Completion

After the specialized agent completes its analysis:

  1. Save the results to a markdown file:
    • Create a timestamped file in .codebase-analysis/ directory:
      • Architecture: .codebase-analysis/architecture-[timestamp].md
      • Flow: .codebase-analysis/flow-[feature-name]-[timestamp].md
      • Patterns: .codebase-analysis/patterns-[timestamp].md
      • Concepts: .codebase-analysis/concepts-[concept-name]-[timestamp].md
    • Include the complete analysis from the agent
    • Format the content properly with markdown
    • Use the Write tool to save the file
    • Show the user the file path where it was saved

Read the full file on GitHub · 69 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. 3d ago First seen · 69 lines · 0 tokens per session scan A b967b718be6e

Subscribe to this mod's changes

learn is a command published in the GitHub repository Jsnnmsc/claude-code-learning-marketplace (3 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 580 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.