lessons

lessons is a command for Claude Code from JuanMarchetto/agent-skills. It costs 27 tokens per session (795 once invoked), scanned A, original, MIT.

A command for browsing, searching, and managing saved error lessons.

In plain words
What is it for?
Use it to list lessons, search by a term, view statistics, remove old entries, or export the collection.
Why use it?
It makes accumulated lessons easier to find, review, measure, clean up, or export.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the learn-by-mistake plugin — 1 skill, 4 commands, 3 hooks 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/juanmarchetto/agent-skills/lessons
Clone the repo
git clone --depth 1 https://github.com/JuanMarchetto/agent-skills

Made for: Claude Code.

Or install learn-by-mistake, the plugin that ships this one along with the rest of its 1 skill, 4 commands, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lessons

README.md
[![agentmods](https://agentmods.dev/badge/commands/juanmarchetto/agent-skills/lessons.svg)](https://agentmods.dev/commands/juanmarchetto/agent-skills/lessons)
Your own site
<a href="https://agentmods.dev/commands/juanmarchetto/agent-skills/lessons"><img src="https://agentmods.dev/badge/commands/juanmarchetto/agent-skills/lessons.svg" alt="Measured on agentmods" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 795 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.1 $0.00027 $0.00795
Opus 5 $0.00014 $0.00398
Sonnet 5 $0.00005 $0.00159
Haiku 4.5 $0.00003 $0.00080

Measured 3d ago against content hash 6c0b97527054, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

lessons 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.

skills/learn-by-mistake/commands/lessons.md · 92 lines

How it starts

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

/lessons — Browse, Search & Manage Lessons

You are the Learn-by-Mistake skill's lesson manager. The user has triggered /lessons to interact with their learned lessons stored in .claude/lessons.md.

Sub-commands

Parse the user's input after /lessons to determine which sub-command to run. If no argument is given, default to showing all lessons.

/lessons (no arguments) — Show All Lessons

  1. Read .claude/lessons.md
  2. Display all Active Lessons grouped by category
  3. Format as a clean table or grouped list:
    ## Active Lessons (14 total)
    
    ### syntax (3)
    1. Quote variables in bash conditionals
    5. Use double brackets [[ ]] for string comparison
    9. Escape special chars in sed patterns
    
    ### config (2)
    3. Set NODE_ENV before running build
    7. Include trailing slash in API base URLs
    
    ... etc
    
  4. Also show count of Pending and Archived lessons at the bottom

/lessons search <term> — Search Lessons

  1. Search across all sections (Active, Pending, Archive) in .claude/lessons.md
  2. Match against: summary, error, root cause, fix, and prevention fields
  3. Case-insensitive search
  4. Display matching lessons with their section indicated:
    Found 3 lessons matching "docker":
    
    [Active] #4. Mount volumes with correct permissions
    [Active] #11. Use BuildKit for multi-stage builds
    [Archive] #2. Pin base image versions
    

/lessons stats — Show Statistics

  1. Read .claude/lessons.md and compute:
    • Total lessons (active + pending + archived)
    • Breakdown by section (Active / Pending / Archive)
    • Breakdown by category
    • Top 5 most-hit lessons (highest Hits count)
    • 5 most recently added lessons
    • Lessons with 0 hits (candidates for pruning)
  2. Display as a formatted summary

/lessons prune — Archive Stale Lessons

  1. Find Active lessons where:
    • Hits is 0, AND
    • Added date is older than 30 days
  2. List the candidates and ask user for confirmation
  3. On approval, move each lesson to the Archive section
  4. Update the lesson format to include **Archived**: [YYYY-MM-DD]

Read the full file on GitHub · 92 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 · 92 lines · 27 tokens per session scan A 6c0b97527054

Subscribe to this mod's changes

lessons is a command published in the GitHub repository JuanMarchetto/agent-skills (5 stars, last pushed 5mo ago), licensed MIT. It adds 27 tokens to every session and 795 once invoked, about $0.0001 per session on Opus 5. 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-09-03.