promote-lessons

promote-lessons is a command for Claude Code from kumaran-is/claude-code-onboarding. It costs 25 tokens per session (731 once invoked), scanned A, original, MIT.

A maintenance process for an agent's stored lessons and rules. It promotes repeated lessons into lasting rules, combines unused memory entries, and removes stale ones.

In plain words
What is it for?
Use it periodically or at the end of a session to maintain lessons, memory entries, and project rules.
Why use it?
It keeps agent guidance current and reduces duplication or outdated instructions over time.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths.

Good fit Use it periodically or at the end of a session to maintain lessons, memory entries, and project rules.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kumaran-is/claude-code-onboarding/promote-lessons
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/kumaran-is/claude-code-onboarding

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/promote-lessons/github.svg)](https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/promote-lessons)
Your own site
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/promote-lessons"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/promote-lessons/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 promote-lessons

Your own site · 80×15
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/promote-lessons"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/promote-lessons.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 731 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.00025 $0.00731
Opus 5 $0.00013 $0.00365
Sonnet 5 $0.00005 $0.00146
Haiku 4.5 $0.00003 $0.00073

Measured 5d ago against content hash 17dba93ff06c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

promote-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 5d 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/promote-lessons.md · 73 lines

How it starts

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

Promote Lessons

Run the full lessons lifecycle: promote, consolidate, and prune.

Step 1: Check lessons.md for x3+ promotions

Read .claude/rules/lessons.md. For each entry with [x3] or higher:

  1. Identify the target rules file from the entry's **Applies:** field:

    • "all tasks" → core-behaviors.md
    • "specific tech" → code-standards.md or the tech's skill reference
    • "specific pattern" → leverage-patterns.md
    • Category Tech:Flutter.claude/skills/flutter-mobile/ reference files
    • Category Tech:NestJS.claude/skills/nestjs-api/ reference files
    • Category Tech:Java.claude/skills/java-spring-api/ reference files
    • Category Scopecore-behaviors.md
    • Category Verificationverification-and-reporting.md
    • Category Code Stylecode-standards.md
    • Category Communicationcore-behaviors.md
    • Category Architecturecore-behaviors.md or leverage-patterns.md
  2. Read the target file. Find the most relevant section.

  3. Append the **Rule:** line as a new bullet or paragraph in that section.

  4. Delete the entry from lessons.md.

  5. Report what was promoted and where.

Step 2: Consolidate agent-memory orphans

Check if .claude/agent-memory/ exists. If it does, for each MEMORY.md or *.md file:

  1. Read the file.

  2. Classify each item:

    • Mistake/trap/gotcha → Write as a lesson entry in lessons.md (4-line format, [x1])
    • Reusable pattern/fix template → Append to the matching skill's reference file under .claude/skills/<agent-name>/reference/
    • Project-specific coordinates/config → Skip (ephemeral, not worth keeping)
  3. After consolidation, delete the processed .claude/agent-memory/ files.

  4. If the directory is empty after cleanup, delete it.

Step 3: Prune stale entries

If lessons.md has more than 15 entries after consolidation:

  1. Identify entries that are still [x1] and older than 30 days.
  2. List them and ask: "These lessons never recurred. Remove them to stay under the 15-entry cap?"
  3. Only delete after confirmation.

Read the full file on GitHub · 73 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. 5d ago First seen · 73 lines · 25 tokens per session scan A 17dba93ff06c

Subscribe to this mod's changes

promote-lessons is a command published in the GitHub repository kumaran-is/claude-code-onboarding (35 stars, last pushed 2mo ago), licensed MIT. It adds 25 tokens to every session and 731 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.