extract-lessons

extract-lessons is a command for Claude Code from runnithan/claudex-setup. It costs 29 tokens per session (6,411 once invoked), scanned A, original, MIT.

A command that reads saved transcripts from Claude Code, Claude Design, and Codex to extract reusable lessons about using coding-agent tools.

In plain words
What is it for?
Use it to process transcripts, write individual lesson files, and keep the lesson index and processed-transcript record up to date.
Why use it?
It turns scattered conversations into an organized lessons library and updates older guidance when newer advice conflicts with it.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions subagents; mentions Claude Code; reads ~/.codex paths.

Part of the claudex-setup plugin — 3 skills, 26 commands, 6 agents, 1 hook shipped together

Good fit Use it to process transcripts, write individual lesson files, and keep the lesson index and processed-transcript record up to date.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/runnithan/claudex-setup/extract-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/runnithan/claudex-setup

Made for: Claude Code.

Or install claudex-setup, the plugin that ships this one along with the rest of its 3 skills, 26 commands, 6 agents, 1 hook.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/runnithan/claudex-setup/extract-lessons/github.svg)](https://agentmods.dev/commands/runnithan/claudex-setup/extract-lessons)
Your own site
<a href="https://agentmods.dev/commands/runnithan/claudex-setup/extract-lessons"><img src="https://agentmods.dev/badge/commands/runnithan/claudex-setup/extract-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 extract-lessons

Your own site · 80×15
<a href="https://agentmods.dev/commands/runnithan/claudex-setup/extract-lessons"><img src="https://agentmods.dev/badge/commands/runnithan/claudex-setup/extract-lessons.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,411 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.00029 $0.06411
Opus 5.5 $0.00012 $0.02564
Sonnet 5.5 $0.00006 $0.01282
Haiku 4.5 $0.00003 $0.00641

Measured today against content hash 2d8285a3fc67, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

extract-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 today.

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/extract-lessons.md · 253 lines

How it starts

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

Extract Lessons

Mine reusable agent-tooling lessons from locally saved practitioner transcripts and file each one into the lessons/ library as its own markdown file, keeping lessons/INDEX.md and the processed-transcript ledger in sync. Newer lessons supersede older contradicting ones on the same topic.

A "lesson" is a concrete, transferable improvement to how someone uses the agent tooling this repo tracks, Claude Code, Claude Design, or Codex: a command, flag, hook, skill pattern, workflow, config, design-surface technique, or gotcha that a reader could apply. Marketing claims, hype, product announcements without a usable technique, and generic AI-coding platitudes are NOT lessons.

Scope covers all three tools, do not silently drop two of them. This command was Claude-Code-only until 2026-07-17, and the omission was self-confirming: Claude Design and Codex transcripts were marked processed while yielding ~0 lessons, so /optimise --design and --codex kept concluding "no relevant lessons exist" when the truth was that nobody had ever looked. A 28k-word Claude Design course and a 1-hour Codex course both extracted zero. If a transcript teaches real Claude Design or Codex technique, that is in scope and must be filed under design or codex. A zero-lesson result for a technique-dense transcript is a red flag to re-read it, not a valid outcome.

Arguments

$ARGUMENTS:

  • empty or new (default): process only transcripts not yet in lessons/.processed.json
  • all: reprocess every transcript (rare, only when the extraction criteria change). The criteria changed on 2026-07-17 (scope widened to Claude Design + Codex), so every transcript ledgered before that date was mined against Claude-Code-only criteria and its .processed.json entry is not evidence that its design or Codex content was ever considered. Re-run with all over the design/Codex-heavy scopes to backfill. They changed again on 2026-08-29 (one atomic claim per lesson), so a transcript ledgered before that date is not evidence its granular sub-tips were ever extracted: the 2026-08-31 consolidation split pass recovered only what compound lessons already carried as clauses, not what miners never wrote. Backfill with all over targeted scopes, starting with transcripts whose lessons needed splitting.
  • a path or glob (e.g. transcripts/ray-amjad/): process just that scope, minus already-processed (unless all is also passed)

Read the full file on GitHub · 253 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. today Changed · +1 lines 2d8285a3fc67
  2. 26d ago Changed · +6 lines 19cf57effcf6
  3. 1mo ago Changed · +11 lines 869fbbebd73b
  4. 1mo ago Changed 13735d9d0dc2
  5. 1mo ago First seen · 235 lines · 29 tokens per session scan A 3db34034dc4a

Subscribe to this mod's changes

extract-lessons is a command published in the GitHub repository runnithan/claudex-setup (1 stars, last pushed yesterday), licensed MIT. It adds 29 tokens to every session and 6,411 once invoked, about $0.0001 per session on Opus 5.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-31.