Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/CloseTheLoops/moradinnpx agentmods add skills/closetheloops/moradin/learn-from-sessionsWrote 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/skills/closetheloops/moradin/learn-from-sessions)<a href="https://agentmods.dev/skills/closetheloops/moradin/learn-from-sessions"><img src="https://agentmods.dev/badge/skills/closetheloops/moradin/learn-from-sessions/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.
<a href="https://agentmods.dev/skills/closetheloops/moradin/learn-from-sessions"><img src="https://agentmods.dev/badge/skills/closetheloops/moradin/learn-from-sessions.svg" alt="Reviewed on agentmods" width="80" 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.00036 | $0.00919 |
| Opus 5.5 | $0.00014 | $0.00368 |
| Sonnet 5.5 | $0.00007 | $0.00184 |
| Haiku 4.5 | $0.00004 | $0.00092 |
Grade A, and why
moradin-learn-from-sessions 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 3mo 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 — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.
moradin:learn-from-sessions
Mine your accumulated Claude Code session history for implicit preferences. Surfaces candidates for review; operator decides what becomes memory.
When to invoke
/moradin:learn-from-sessions [--since 180d] [--project <name>]
Best run ONCE at first-time setup, then again periodically (monthly or quarterly) to catch new patterns. For per-session incremental capture, use /moradin:ship after each session.
What you do
-
Set up. Confirm
ANTHROPIC_API_KEYis in env. If not, ask operator to set it or use--local-onlymode. -
Discover sessions. Run
scripts/session_scanner.py --since 180 --count-onlyto show operator how many sessions/turns will be scanned. -
Estimate cost. Roughly $0.001 per turn for pre-filter + $0.01 per extracted candidate. For ~10k turns: typically $8-15.
-
Confirm with operator before running the expensive extraction.
-
Run extraction.
python scripts/extract_preferences.py --since 180 --min-count 5 --min-sessions 3This:
- Scans matching JSONL files
- Pre-filters with regex (corrections / preferences / lessons signal patterns)
- Classifies filtered turns with Haiku (cheap)
- Extracts structured candidates with Sonnet (strong)
- Clusters similar candidates
- Applies stability thresholds (count ≥ 5, sessions ≥ 3, confidence ≥ 0.6)
- Writes review file to
scratch/proposed_<date>.md
-
Surface results to operator. Read the proposed file, summarize:
- Total candidates that passed stability
- Top 5 by occurrence count
- Distribution: how many principle / preference / lesson candidates
-
Walk operator through review (optional). For each candidate ask:
- ACCEPT → write to
memory/preferences/<title>.md(orprinciples/orlessons/based on category) - EDIT → rewrite statement, then accept
- REJECT → skip
- ACCEPT → write to
-
After approval session. Run
python scripts/refresh_indexes.pyto update_INDEX.mdfiles. Delete the review file.
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.
- 3mo ago First seen · 80 lines · 36 tokens per session scan A 6524140f863b
moradin-learn-from-sessions is a skill published in the GitHub repository CloseTheLoops/moradin (2 stars, last pushed 3mo ago), licensed MIT. It adds 36 tokens to every session and 919 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.
moradin-learn-from-sessions compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| moradin-learn-from-sessionsCloseTheLoops/moradin | Skill | 2 | 3mo ago | MIT | A | 36 | Claude Code |
| log-sessiongtrabanco/agentic-workflow | Skill | 25 | today | MIT | A | 165 | Claude Code |
| llm-wiki-company-flow-auditpo4yka/llm-wiki-skills | Skill | 6 | 2d ago | MIT | A | 72 | Claude Code, Codex |
| llm-wiki-capture-pipelinepo4yka/llm-wiki-skills | Skill | 6 | 2d ago | MIT | A | 71 | Claude Code, Codex |
| llm-wiki-orientpo4yka/llm-wiki-skills | Skill | 6 | 2d ago | MIT | A | 75 | Claude Code, Codex |
| wiki-lintpo4yka/llm-wiki-skills | Skill | 6 | 2d ago | MIT | A | 47 | Claude Code, Codex |
| llm-wiki-agent-memory-bridgepo4yka/llm-wiki-skills | Skill | 6 | 2d ago | MIT | A | 67 | Claude Code, Codex |