| name | session-mining |
| type | reference |
| description | Use when mining conversation history during dev work — recovering decisions from the top-level primary session, delegating bulk transcript reading to an explorer, or discovering all sessions tied to a work item across interruptions. |
| model-invocable | true |
session-mining
Why Mining Matters
Design decisions, rejected alternatives, and discovered constraints often live in conversation instead of code or docs. Compaction makes that context expensive to recover later, so mine it before the next implementation or documentation step starts.
Recover From the Top-Level Session First
Start from the top-level conversation. $MERIDIAN_CHAT_ID points to the primary session at the root of the chat tree, regardless of how deep in the spawn tree you are. That root context holds the primary's decisions and framing — usually the highest-leverage read.
Use a narrow read first, then widen only if needed:
meridian session log "$MERIDIAN_CHAT_ID" --last 20
Delegate Bulk Reading, Don't Inline It
When the question spans long histories or multiple sessions, spawn @session-explorer for transcript mining and synthesis. That keeps your context window focused on decisions instead of raw transcript paging.
meridian spawn -a session-explorer \
--prompt-file session-mine.md
If you are the @session-explorer, mine directly rather than spawning recursively.
Discover Sessions Per Work Item
When work spans interruptions, reopenings, or multi-day execution, list all related sessions before mining. Reading only the current session misses prior decisions.
meridian work sessions <work_id> --all
When to Skip Mining Entirely
Skip mining if the spawning prompt already includes the needed rationale, or if current design/plan artifacts already capture the decisions you need. Skim artifacts first, and mine only the gaps.