learn

A command for extracting lessons from the current conversation and saving approved ones to the toolkit. It supports rules, skills, and agents with universal or project-only scope.

In plain words
What is it for?
Use it with `/learn` or phrases such as “remember this” to find candidate lessons, select what to save, and set how broadly each lesson applies.
Why use it?
It turns useful discoveries from debugging and problem-solving into reusable guidance rather than leaving them buried in chat history.

Command

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/hknc/claude-evolve/learn
Clone the repo
git clone --depth 1 https://github.com/hknc/claude-evolve
Per session 52 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,760 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.00052 $0.01760
Opus 5 $0.00026 $0.00880
Sonnet 5 $0.00010 $0.00352
Haiku 4.5 $0.00005 $0.00176

Measured 2d ago against content hash 06c91159df43, 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.

plugins/claude-evolve/commands/learn.md · 183 lines

How it starts

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

/learn Command

Architecture Note

Commands handle ALL user interaction. The learning-extractor agent runs in two phases.

Phase 1: Agent analyzes conversation, returns candidate learnings as structured text. Phase 2: Agent creates only user-approved components with user-specified types and scopes.

Execution

Step 1: Check Toolkit

Use Bash to check: cat $HOME/.claude-evolve/active 2>/dev/null

If empty: "Run /evolve init first." and STOP.

Step 2: Check for Explicit Intent (Shortcut)

Before running discovery, check if the user's request contains explicit type and scope:

  • Explicit type from: "rule", "skill", "agent"
  • Explicit scope from: "universal", "project", "this project only"

Examples: "save this as a universal rule", "remember this as a project skill"

If both type and scope are explicit: Run Step 3 (discover) to identify what to capture, then skip Steps 4-6 (presentation and selection) and go directly to Step 7 with the user's explicit type and scope applied to all discovered candidates.

If only scope is explicit (e.g., "remember this universally"): Pre-set scope, continue to Step 3 for normal discovery and selection.

If no explicit intent detected: Continue to Step 3.

Step 3: Discover Learnings (Phase 1 -- Agent)

Spawn claude-evolve:evolve-learning-extractor via Task tool with:

  • action: "discover"
  • topic: The user's trigger text if they provided a hint (e.g., "save what we learned about Redis")

The agent analyzes the full conversation context available through its Task invocation. It also checks for session signals at $HOME/.claude-evolve/signals/${CLAUDE_SESSION_ID}.json.

The agent returns at most 4 candidates, ranked by learning value. Each candidate includes: name, summary, detail, suggested_type (skill|agent|rule), suggested_scope (universal|project), reasoning, and consolidation target if applicable.

If agent returns no candidates: Output "No significant learnings found in this session." and STOP.

Read the full file on GitHub · 183 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 · 183 lines · 52 tokens per session scan A 06c91159df43

Subscribe to this mod's changes

learn is a command published in the GitHub repository hknc/claude-evolve (8 stars, last pushed 7mo ago), licensed MIT. It adds 52 tokens to every session and 1,760 once invoked, about $0.0003 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-08-31.