lesson-capture

lesson-capture is a command for coding agents from SaigonXIII/evc. It costs 0 tokens per session (1,271 once invoked), scanned A, original, MIT.

A lesson-capture command records structured notes about important tasks, debugging sessions, corrections, and discoveries in a persistent knowledge base.

In plain words
What is it for?
It is for saving what went wrong or worked, documenting fixes, and reviewing recent lessons.
Why use it?
It prevents useful lessons from being lost after a task is finished and makes earlier patterns easier to review.

Command

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/saigonxiii/evc/lesson-capture
Clone the repo
git clone --depth 1 https://github.com/SaigonXIII/evc

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 lesson-capture

README.md
[![agentmods](https://agentmods.dev/badge/commands/saigonxiii/evc/lesson-capture.svg)](https://agentmods.dev/commands/saigonxiii/evc/lesson-capture)
Your own site
<a href="https://agentmods.dev/commands/saigonxiii/evc/lesson-capture"><img src="https://agentmods.dev/badge/commands/saigonxiii/evc/lesson-capture.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,271 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.00000 $0.01271
Opus 5 $0.00000 $0.00635
Sonnet 5 $0.00000 $0.00254
Haiku 4.5 $0.00000 $0.00127

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

Security

Grade A, and why

lesson-capture 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.

_templates/commands/lesson-capture.md · 179 lines

How it starts

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

Lesson Capture

Record structured lessons after significant tasks. Builds a persistent knowledge base that improves future agent performance. Run with an optional summary or use review to read past lessons.

Trigger

User invokes /lesson-capture [SUMMARY] or says "capture lesson", "what did we learn", "record this"

Examples:

/lesson-capture Fixed the content pipeline to handle missing images gracefully
/lesson-capture The blog QA caught 3 canon violations — updated banned phrases
/lesson-capture review

Input: A brief summary of what happened, or review to read recent lessons. Output: A formatted lesson entry appended to the monthly lessons file, or a pattern analysis of recent lessons.


When to Capture

Record a lesson after:

  • Multi-phase tasks — pipelines, proposals, audits (what phase was hardest? what would you skip?)
  • Debugging sessions — root cause analysis (what was the actual problem vs what you initially suspected?)
  • User corrections — any time the user said "no, not that" or "actually, do it this way" (what assumption was wrong?)
  • Non-obvious discoveries — workarounds, undocumented behaviors, surprising file locations
  • Failed approaches — something you tried that did not work (save others from the same mistake)
  • Validated approaches — something non-obvious that worked well (reinforce the pattern)

Do not capture: routine tasks, trivial fixes, or lessons already documented in existing commands.


Auto-Lesson on QA Failure

When /lesson-capture is invoked after a QA failure (content-qa, blog-qa, or any validation step that returned failures), automatically detect and capture the failure pattern:

Detection

Check the current session for recent QA results by looking for:

  • Files matching {{CONTENT_OUTPUT_DIR}}/**/qa-report*.md
  • Recent conversation mentions of "FAIL", "violation", "rejected", "not compliant"
  • Output from /content-qa or /blog-qa within this session

Auto-Capture Format

Read the full file on GitHub · 179 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 · 179 lines · 0 tokens per session scan A 6af2e6caa6e1

Subscribe to this mod's changes

lesson-capture is a command published in the GitHub repository SaigonXIII/evc (56 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,271 tokens. 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.