learnings

learnings is a skill for Claude Code, Codex from MountainUnicorn/add. It costs 21 tokens per session (1,814 once invoked), scanned A, original, MIT.

A manager for a project knowledge base that stores lessons learned in JSON files. It creates smaller active views, archives old entries, and reports counts and file sizes.

In plain words
What is it for?
Migrating older notes into JSON, generating active Markdown views, archiving stale low-severity learnings, and viewing statistics for project and shared knowledge.
Why use it?
It keeps accumulated project notes easier for a coding agent to load and focus on, instead of repeatedly reading the entire history.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside the plugin that ships it — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed.

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 skills/mountainunicorn/add/learnings
Any agent
npx skills add MountainUnicorn/add --skill learnings
Clone the repo
git clone --depth 1 https://github.com/MountainUnicorn/add

Made for: Claude Code, Codex.

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 learnings

README.md
[![agentmods](https://agentmods.dev/badge/skills/mountainunicorn/add/learnings.svg)](https://agentmods.dev/skills/mountainunicorn/add/learnings)
Your own site
<a href="https://agentmods.dev/skills/mountainunicorn/add/learnings"><img src="https://agentmods.dev/badge/skills/mountainunicorn/add/learnings.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,814 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.00021 $0.01814
Opus 5 $0.00010 $0.00907
Sonnet 5 $0.00004 $0.00363
Haiku 4.5 $0.00002 $0.00181

Measured 4d ago against content hash 60fafa3f37c8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

core/skills/learnings/SKILL.md · 186 lines

How it starts

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

ADD Learnings Skill v{{VERSION}}

Manage the learnings knowledge base: generate optimized active views, archive stale entries, and report statistics.

Overview

Learnings accumulate over time in .add/learnings.json and ~/.claude/add/library.json. The full JSON files are expensive to load into agent context. This skill manages the lifecycle:

  • migrate — Generate compact -active.md views from existing JSON (or migrate legacy .md to JSON first)
  • archive — Mark old low-severity entries as archived to shrink the active set
  • stats — Show learning counts, sizes, and context savings

Default subcommand (no argument): migrate.

Pre-Flight Checks

  1. Read .add/config.json to get project name
  2. Locate learnings files:
    • .add/learnings.json (Tier 3 project learnings)
    • .add/learnings.md (legacy or generated view)
    • .add/learnings-active.md (optimized active view)
    • ~/.claude/add/library.json (Tier 2 cross-project)
    • ~/.claude/add/library-active.md (Tier 2 active view)

Subcommand: migrate

Generate -active.md files from existing JSON. Handles three scenarios:

Scenario A: JSON exists, active view missing or stale

This is the most common case — existing projects upgrading to the active view approach.

  1. Run ${CLAUDE_PLUGIN_ROOT}/hooks/filter-learnings.sh on .add/learnings.json
  2. Run ${CLAUDE_PLUGIN_ROOT}/hooks/filter-learnings.sh on ~/.claude/add/library.json (if it exists)
  3. Report what was generated and the context savings

Scenario B: Only legacy .md exists (no JSON)

Pre-v0.4.0 projects that never migrated to structured JSON.

  1. Announce: "Found legacy markdown learnings — migrating to JSON first."
  2. Back up .add/learnings.md to .add/learnings.md.pre-migration.bak
  3. Parse the markdown:
    • Each - **[{severity}] {title}** line is an entry
    • Extract body text from indented continuation lines
    • If no structured format, treat each ## section + bullet as an entry
  4. For each parsed entry, create a JSON learning object:
    • Assign ID: L-001, L-002, etc.
    • Infer category from section heading (Anti-Patterns → anti-pattern, Technical → technical, etc.)
    • Infer severity from [critical], [high], [medium], [low] markers. Default: medium
    • Set scope: project
    • Set stack: [] (stack-agnostic, can be refined during retro)
    • Set source: project name from config
    • Set date: extract from entry if present, otherwise use file modification date
    • Set classified_by: agent
    • Set checkpoint_type: retro (migrated entries treated as retro-sourced)
  5. Write .add/learnings.json with the standard wrapper
  6. Run ${CLAUDE_PLUGIN_ROOT}/hooks/filter-learnings.sh on the new JSON
  7. Report: entries migrated, JSON created, active view generated

Read the full file on GitHub · 186 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. 4d ago First seen · 186 lines · 21 tokens per session scan A 60fafa3f37c8

Subscribe to this mod's changes

learnings is a skill published in the GitHub repository MountainUnicorn/add (11 stars, last pushed 1mo ago), licensed MIT. It adds 21 tokens to every session and 1,814 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.