learn

A post-merge workflow that updates a project's long-term memory after code is merged into the main branch. It also maps project instructions and suggests rules that could become automated checks.

In plain words
What is it for?
Use it after a merge to reconcile reference files, update AGENTS.md guidance, identify project invariants, and prepare a reviewable pull request with proposed improvements.
Why use it?
It keeps future coding agents aligned with the code's latest structure and decisions instead of relying on outdated instructions or memory.

Skill for Claude CodeCodex

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/capitalone/context-specs/learn
Any agent
npx skills add capitalone/context-specs --skill learn
Clone the repo
git clone --depth 1 https://github.com/capitalone/context-specs

Made for: Claude Code, Codex.

Per session 120 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,869 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00120 $0.03869
Opus 5 $0.00060 $0.01935
Sonnet 5 $0.00024 $0.00774
Haiku 4.5 $0.00012 $0.00387

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

Security

Grade B, and why

learn scanned grade B with 1 finding 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.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/check-agents-md.sh, scripts/check-expert-links.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Enumerates other installed skillsmediumAgent snooping

Other skills' SKILL.md files reveal prompts, capabilities and secrets that should be invisible to peers.

files (`ls .claude/skills/expert/references/*.md` plus their contents); the
skills/harness/learn/SKILL.md · 251 lines

How it starts

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

learn

This is how the project gets better on every merge. When code lands on main, /learn reconciles the project's long-term memory with what just landed: it updates the Expert (procedural + semantic memory, pulled on demand) and the AGENTS.md map (eager memory, loaded as agents traverse the repo), discovers project invariants, and drafts candidate lints (the highest-value memory, because a lint is a rule the agent cannot ship past).

You run headless, invoked by the memory loop (scripts/learn-dispatch.sh in the harness repo, driven by the context-specs supervisor on its own interval) as the post-merge step — in a dedicated ../<repo>-harness-learn worktree on a learn/<sha> branch off origin/main, never in the developer's clone. The memory loop runs independently of the feature/build loop, so a from-scratch Expert bootstrap blocks neither. Your output is a single reviewable PR — never an auto-merge. Humans steer at merge.

What memory is (read this first)

The memory is the developer's. It holds facts about the code as it is and decisions, direction, and aspirations the developer has written that the code hasn't caught up to. Your input is the merged diff — that's why you run post-merge — and your job is to reconcile memory with it: add what the merge taught, update what it invalidated, and advance any direction it touches (fulfilled → rewrite as cited fact; contradicted → edit and note it). Direction is never stale merely because it isn't observable in code yet.

You are the automated writer; the developer writes memory directly, any time, and their edits are authoritative (P7). STUCK features are handled by the human directly (their first job there is to identify the context defect that misled the agent, correct it on the feature branch, then fix the code); their corrections ride into main with the feature merge, and you observe them in the diff you read.

The philosophy

  • P1 — Write from the merged diff. Your own additions are evidence-based: cite the diff. But memory as a whole is not diff-shaped — developer-written direction lives beside your facts, and you maintain it (advance or close it when a merge fulfills or contradicts it), never delete it for lacking a code anchor.
  • P2 — Two memory shapes, opposite costs. The Expert is pulled on demand (cheap until consulted). AGENTS.md is eager — loaded automatically every session that touches a folder, paid in tokens whether or not it's relevant. So the bar for putting something in AGENTS.md is far higher than for the Expert.
  • P3 — The four destinations. Every fact worth remembering routes to exactly one place: a lint (if mechanically checkable), eager prose (AGENTS.md, if it clears the high bar), lazy prose (an Expert reference file — one of how-to-* / concept-* / pattern-* / invariant-* / example-* / decision-*), or nowhere. Most things go nowhere or to the Expert. The decision-* prefix is forward-looking direction — human-authored, never one you seed; you only retire it when a merge fulfills or reverses it (P9). See references/routing-rules.md and references/expert-structure.md.
  • P4 — Map, not encyclopedia. AGENTS.md is the table of contents that points into the Expert; it never duplicates it. A monolithic AGENTS.md rots, crowds out the task, and turns "everything important" into "nothing important." Keep it a map. See references/agents-md-guidance.md.
  • P5 — Progressive disclosure inside the Expert. Reference files are small and topic-focused, cross-linked via Obsidian [[wikilinks]]. SKILL.md is an index — one line per file. An agent reads the index, opens only what's relevant, then follows wikilinks to discover related context. See references/expert-structure.md and references/wikilink-convention.md.
  • P6 — Invariants are discovered, then promoted. You may notice architectural rules the codebase upholds. Record each as its own invariant-<rule>.md file (one rule per file); flag the mechanically checkable ones as candidate lints (the highest-value memory, because a lint is a rule the agent cannot ship past). See references/invariant-discovery.md.
  • P7 — Human-authored memory edits are authoritative. When the merged diff already touches AGENTS.md, an Expert reference file, or a spec, treat those changes as authoritative — extend them, never second-guess them. They came from a human resolving a STUCK or making a deliberate correction. Your job there is to extend (what else, given this correction, now needs to change?) — not to vote on whether to apply it.
  • P8 — Reviewable, revertible, human-merged. Everything lands on a learn/<sha> PR. Never auto-merge.
  • P9 — Reconcile, don't accumulate. Memory is a current model of the project — its code and its intent — not an append-only log. Every run must look for deleted concepts (the code is gone → the reference file goes), inter-file contradictions (two files disagree → merge or scope-qualify), and claims invalidated by the merged diff. Adds, edits, and deletes all ride on the same PR. See references/reconcile.md.
  • P10 — Nothing to learn is a valid outcome. Most merges produce nothing for memory. When reconcile finds zero adds, edits, deletes, AGENTS.md pointer changes, or candidate lints, print learn: nothing to learn from <sha>, skipping PR to stdout, exit 0, and do not push a branch or open a PR. The outer loop advances refs/harness/last-learned regardless.

Read the full file on GitHub · 251 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 251 lines · 120 tokens per session scan B dc4ea57135c1

Subscribe to this mod's changes

learn is a skill published in the GitHub repository capitalone/context-specs (41 stars, last pushed 8d ago), licensed Apache-2.0. It adds 120 tokens to every session and 3,869 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it B with 1 finding (enumerates other installed skills). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens