learn

learn is a command for coding agents from xu-xiang/everything-claude-code-zh. It costs 11 tokens per session (437 once invoked), scanned A, original, MIT.

A command that reviews the current conversation and code changes to extract reusable patterns, good practices, mistakes, and code snippets.

In plain words
What is it for?
Use it to record session learnings and suggest updates to skills, rules, or development guidance.
Why use it?
It turns useful lessons from a completed session into notes that can be reused later instead of being forgotten.

Command

Part of the everything-claude-code-zh plugin — 17 skills, 26 commands, 13 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/xu-xiang/everything-claude-code-zh/learn
Clone the repo
git clone --depth 1 https://github.com/xu-xiang/everything-claude-code-zh

Or install everything-claude-code-zh, the plugin that ships this one along with the rest of its 17 skills, 26 commands, 13 agents.

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/xu-xiang/everything-claude-code-zh/learn.svg)](https://agentmods.dev/commands/xu-xiang/everything-claude-code-zh/learn)
Your own site
<a href="https://agentmods.dev/commands/xu-xiang/everything-claude-code-zh/learn"><img src="https://agentmods.dev/badge/commands/xu-xiang/everything-claude-code-zh/learn.svg" alt="Measured on agentmods" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 437 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.00011 $0.00437
Opus 5 $0.00005 $0.00218
Sonnet 5 $0.00002 $0.00087
Haiku 4.5 $0.00001 $0.00044

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

.opencode/commands/learn.md · 62 lines

What it actually says

学习命令 (Learn Command)

从当前会话(Session)中提取模式(Patterns)、学习心得(Learnings)和可复用的见解:$ARGUMENTS

你的任务

分析对话和代码变更以提取:

  1. 发现的模式 (Patterns discovered) - 重复出现的解决方案或方法
  2. 应用的最佳实践 (Best practices applied) - 效果良好的技术
  3. 应避免的错误 (Mistakes to avoid) - 遇到的问题及其解决方案
  4. 可复用代码段 (Reusable snippets) - 值得保存的代码模式

输出格式

发现的模式 (Patterns Discovered)

模式:[名称]

  • 上下文(Context):何时使用此模式
  • 实现(Implementation):如何应用它
  • 示例(Example):代码片段

应用的最佳实践 (Best Practices Applied)

  1. [实践名称]
    • 为什么有效
    • 何时应用

应避免的错误 (Mistakes to Avoid)

  1. [错误描述]
    • 出了什么问题
    • 如何防止

建议的技能更新 (Suggested Skill Updates)

如果发现的模式具有重要意义,请建议更新以下文件:

  • skills/coding-standards/SKILL.md
  • skills/[domain]/SKILL.md
  • rules/[category].md

本能格式 (Instinct Format - 用于 continuous-learning-v2)

{
  "trigger": "[触发此学习的情况]",
  "action": "[该做什么]",
  "confidence": 0.7,
  "source": "session-extraction",
  "timestamp": "[ISO 时间戳]"
}

提示 (TIP):在长会话期间定期运行 /learn,以便在上下文压缩(Context Compaction)之前捕获见解。

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. 4d ago First seen · 62 lines · 11 tokens per session scan A f7e3697f4ad6

Subscribe to this mod's changes

learn is a command published in the GitHub repository xu-xiang/everything-claude-code-zh (1,927 stars, last pushed 6mo ago), licensed MIT. It adds 11 tokens to every session and 437 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-08-30.