learn

learn is a command for Claude Code from sefaertunc/Worclaude. It costs 9 tokens per session (843 once invoked), scanned A, original, MIT.

A command for saving a correction or project convention as a persistent learning in `.claude/learnings`.

In plain words
What is it for?
Use it when you want the coding agent to remember a rule, mistake, or correction for future work. It saves the learning with its category, date, and project information.
Why use it?
It records lessons from a session in a standard format and rebuilds the learning index so the files and index stay aligned.

Command for Claude Code

Written for Claude Code: UserPromptSubmit hook event. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool; mentions Claude Code.

Good fit Use it when you want the coding agent to remember a rule, mistake, or correction for future work. It saves the learning with its category, date, and project information.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/sefaertunc/worclaude/learn
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.

Clone the repo
git clone --depth 1 https://github.com/sefaertunc/Worclaude

Made for: Claude Code.

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 learn

README.md
[![agentmods](https://agentmods.dev/badge/commands/sefaertunc/worclaude/learn/github.svg)](https://agentmods.dev/commands/sefaertunc/worclaude/learn)
Your own site
<a href="https://agentmods.dev/commands/sefaertunc/worclaude/learn"><img src="https://agentmods.dev/badge/commands/sefaertunc/worclaude/learn/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for learn

Your own site · 80×15
<a href="https://agentmods.dev/commands/sefaertunc/worclaude/learn"><img src="https://agentmods.dev/badge/commands/sefaertunc/worclaude/learn.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 843 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00009 $0.00843
Opus 5.5 $0.00004 $0.00337
Sonnet 5.5 $0.00002 $0.00169
Haiku 4.5 $0.00001 $0.00084

Measured 3mo ago against content hash a4e40d747073, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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.

.claude/commands/learn.md · 98 lines

How it starts

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

The user wants to capture a learning from this session.

When invoked with arguments, use them as the learning to capture. Example: /learn Always use conventional commits for this project

If no arguments provided, ask the user what they want to remember.

Format

A learning is a [LEARN] block:

[LEARN] Category: One-line rule description
Mistake: What went wrong (optional)
Correction: What should happen instead (optional)

Write to .claude/learnings/{category-slug}.md with YAML frontmatter:

---
created: <today's date YYYY-MM-DD>
category: <from the [LEARN] block>
project: <package.json name, or directory name as fallback>
---

Do NOT add a times_applied field. The auto-capture hook never increments it; the field would be a lie. Removed in Phase 2 (2026-04).

After writing, regenerate .claude/learnings/index.json from the directory contents — never hand-maintain it. The regeneration walks .claude/learnings/*.md, parses each frontmatter, and writes the canonical { "learnings": [{file, category, created}, ...] } index. This guarantees the index never drifts from the files on disk.

Confirm to the user what was saved and where.

When to use /learn vs other memory layers

The system has multiple memory layers; pick the right one for the trigger:

Trigger Lands in Audience
Plain conversation ("user pushes back") Claude Code's auto-memory (autonomous) Personal, machine-local
/learn or [LEARN] marker .claude/learnings/ Team-relevant
/update-claude-md (later promotion path) CLAUDE.md Team, every session

/learn is the team signal. Use it when the rule belongs to the project, not your personal preferences. Examples:

  • ✅ "We always use pnpm in this repo, not npm" → /learn
  • ✅ "The conflict-resolver must not push" → /learn
  • ❌ "I prefer terse responses" → leave to auto-memory; don't /learn
  • ❌ "User pushes back on overengineering" → leave to auto-memory

Read the full file on GitHub · 98 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. 3mo ago First seen · 98 lines · 9 tokens per session scan A a4e40d747073

Subscribe to this mod's changes

learn is a command published in the GitHub repository sefaertunc/Worclaude (4 stars, last pushed 3mo ago), licensed MIT. It adds 9 tokens to every session and 843 once invoked, about $0.0000 per session on Opus 5.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.

Related

learn compared with commands from other repositories

learn next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
learnsefaertunc/WorclaudeCommand43mo agoMITA9Claude Code
memorizelucasrosati/claude-code-memory-setupCommand1.1kyesterdayMITA0Claude Code
context-statstravisjneuman/.claudeCommand1152d agoMITA7Claude Code
handofftravisjneuman/.claudeCommand1152d agoMITA8Claude Code
handoffflonat/flonat-researchCommand15516d agoMITA48Claude Code
budgetcukas/remembrallCommand67d agoMITA13Claude Code
packPierry/harness-kitCommand41mo agoMITA18Claude Code