agentsclimarketplace

Learn from sessions

Skill CloseTheLoops/moradin/skills/learn-from-sessions

A workshop for accumulating build-taste across projects. Cross-tool dev brain (Claude Code, Cursor, Codex, Gemini).

Install
npx -y skills add CloseTheLoops/moradin --skill learn-from-sessions

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Extract user preferences from accumulated Claude Code session history. One-time bootstrap that mines your past corrections, preferences, and lessons into reviewable candidates.

SKILL.md

3.6 KB, 883 tokens by cl100k_base, as published. Nobody here has run it

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

  1. Set up. Confirm ANTHROPIC_API_KEY is in env. If not, ask operator to set it or use --local-only mode.

  2. Discover sessions. Run scripts/session_scanner.py --since 180 --count-only to show operator how many sessions/turns will be scanned.

  3. Estimate cost. Roughly $0.001 per turn for pre-filter + $0.01 per extracted candidate. For ~10k turns: typically $8-15.

  4. Confirm with operator before running the expensive extraction.

  5. Run extraction.

    python scripts/extract_preferences.py --since 180 --min-count 5 --min-sessions 3
    

    This:

    • 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
  6. 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
  7. Walk operator through review (optional). For each candidate ask:

    • ACCEPT → write to memory/preferences/<title>.md (or principles/ or lessons/ based on category)
    • EDIT → rewrite statement, then accept
    • REJECT → skip
  8. After approval session. Run python scripts/refresh_indexes.py to update _INDEX.md files. Delete the review file.

Tuning knobs

FlagDefaultWhen to adjust
--since N180 daysStart with 180 to verify pipeline quality; expand to 365+ once trusted
--min-count N5Lower (3) if your corpus is small; raise (8-10) if you want only strongest signals
--min-sessions N3Same logic — diversity threshold
--project <slug>(all)Restrict to one project (e.g. C--Users-yuezh-Documents-GodTech)
--dry-runoffTest the regex pre-filter without spending LLM dollars

Privacy

  • All session reading is LOCAL (Python reads files on disk).
  • LLM calls go to Anthropic API. Per Anthropic's commercial terms, API traffic is NOT used for training.
  • If you need pure-local processing: set MORADIN_LOCAL_ONLY=1 (requires Ollama installed; future enhancement).
  • The script applies regex redaction for common secrets (API keys, emails, bearer tokens) before sending to LLM.

Don't

  • Don't run this without operator confirmation on the LLM spend.
  • Don't auto-write extracted candidates to memory/. Operator reviews each.
  • Don't include any candidate in memory/ without first cleaning the title + statement.
  • Don't run on a corpus you haven't redacted appropriately if it contains sensitive IP.

Output

  • scratch/proposed_<date>.md — reviewable candidates
  • 0 or more new files in memory/preferences/, memory/principles/, or memory/lessons/ after operator approval
  • Updated _INDEX.md files

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 327,132. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.