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.
npx agentmods add commands/runnithan/claudex-setup/consolidate-lessonsgit clone --depth 1 https://github.com/runnithan/claudex-setupWrote 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.
[](https://agentmods.dev/commands/runnithan/claudex-setup/consolidate-lessons)<a href="https://agentmods.dev/commands/runnithan/claudex-setup/consolidate-lessons"><img src="https://agentmods.dev/badge/commands/runnithan/claudex-setup/consolidate-lessons.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00034 | $0.01254 |
| Opus 5 | $0.00017 | $0.00627 |
| Sonnet 5 | $0.00007 | $0.00251 |
| Haiku 4.5 | $0.00003 | $0.00125 |
Grade A, and why
consolidate-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.
How it starts
The opening of the file, as written. The whole thing — 52 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Consolidate Lessons
/extract-lessons only ever adds (newer supersedes older on direct contradiction). Over many runs the archive accumulates near-duplicate active lessons and dead superseded files. This command does the periodic cleanup the extract loop can't: it merges overlapping lessons, splits compound ones whose sub-tips are invisible downstream, and prunes stale ones, so INDEX.md stays signal-dense.
Argument: $ARGUMENTS
- empty (default): propose a consolidation plan and apply it after listing the changes.
dry-run: produce the plan only, list proposed merges/prunes, change nothing.- a category (e.g.
agents): scope consolidation tolessons/<category>/only.
Steps
-
Load the archive:
Read lessons/INDEX.mdandlessons/README.md(for the file format + supersession rules).Glob lessons/**/*.md(excludeINDEX.md,README.md). Read each one's frontmatter (id,status,category,supersedes/superseded_by,created) and TL;DR.
-
Spawn Explore subagents to find redundancy and buried sub-tips (keep the bulk reading out of main context). One subagent suffices up to ~150 active lessons; above that, fan out over category batches, all launched in one message. Give each the per-lesson
{id, category, status, tldr, created}records for its batch plus the full active slug list for dedupe, and ask it to return JSON identifying:- merge clusters: 2+ active lessons that cover the same idea and should become one canonical lesson (e.g. several "keep it under 200 lines" lessons). Pick the strongest as canonical; the rest get superseded by it. Same-claim redundancy ONLY: never merge two distinct actionable claims into one body, since that bundling is exactly the burial the split pass below exists to undo.
- split candidates: an active lesson whose body carries one or more independently-actionable sub-tips absent from its title and TL;DR (a setting, a hook, a keyboard habit inside a bigger workflow's body). The subagent must read candidate bodies, not just TL;DRs. Downstream routing (
/optimisehabits,/top-tipstracing) reads titles and TL;DRs, so a buried sub-tip never surfaces; this pass is the retroactive counterpart of the/extract-lessons§5 atomicity rule for the corpus mined before 2026-08-29. A split-out tip that duplicates an existing active lesson is not a split, it is already covered: skip it. - stale: lessons whose advice is outdated/contradicted or whose feature no longer exists.
- Tell it: be conservative, only cluster lessons that are genuinely redundant, not merely adjacent. Distinct nuances stay separate.
{ "merges": [ {"canonical_id": "keep-context-lean", "merge_in": ["id-a", "id-b"], "merged_tldr": "...", "merged_body": "...", "reason": "..."} ], "splits": [ {"source_id": "compound-lesson-slug", "new_lessons": [{"id": "sub-tip-slug", "title": "...", "tldr": "...", "why": "...", "how": "...", "category": "workflows", "tool": "claude-code"}], "reason": "..."} ], "prune_stale": [ {"id": "...", "reason": "..."} ] }
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.
- 5d ago First seen · 52 lines · 34 tokens per session scan A f45a2e741e6e
consolidate-lessons is a command published in the GitHub repository runnithan/claudex-setup (1 stars, last pushed 4d ago), licensed MIT. It adds 34 tokens to every session and 1,254 once invoked, about $0.0002 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-31.
Other commands, from other repositories
factcheck
Verify BibTeX entries and cited claims against DBLP and web sources. Checks author names, venues, years, and specific numerical claims.
translate-review-to-single-human
Translate a multi-reviewer code review into a single human-voice GitHub PR comment.
address
Address code review feedback — corroborate, validate, and implement changes from a review's final.md.
map
Generate a Code Review Map to help navigate large, complex changesets.
post
Post the current OCR review to a GitHub PR.
show
Display a past OCR review session.