Skip to main content
Glama

mine_sessions

Idempotent

Extract architectural decisions, tech choices, bug root causes, and preferences from Claude Code session logs. Supports regex, LLM, or hybrid extraction strategies.

Instructions

Mine Claude Code / Claw Code session logs for architectural decisions, tech choices, bug root causes, and preferences. Strategies: "regex" (default, free, fast, ~20-40% recall — pattern-based), "llm" (uses configured AI provider for higher recall, costs tokens), "hybrid" (regex + LLM safety net, dedups overlap). Skips already-mined sessions unless force=true. Honours memory.mining.incrementalCursor for byte-offset cursor reuse; pass incremental_cursor to override per call. Mutates the decision store; idempotent. Returns JSON: { mined, decisions_extracted, sessions_processed, strategy?, llm_sessions?, llm_decisions_extracted? }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_rootNoOnly mine sessions for this project path (default: all projects)
forceNoRe-mine already processed sessions (default: false)
min_confidenceNoLegacy reject floor — drops decisions below this. Superseded by reject_threshold; kept for back-compat.
review_thresholdNoMemoir auto-approve cutoff (default: decisions.review_threshold from config, fallback 0.75). Decisions ≥ this enter the active knowledge graph immediately.
reject_thresholdNoMemoir reject floor (default: decisions.reject_threshold from config, fallback 0.45). Decisions in [reject_threshold, review_threshold) go into the review queue; below reject_threshold they are dropped.
strategyNoExtraction strategy. regex (default): free, fast, low recall. llm: uses AI provider, costs tokens, higher recall. hybrid: regex + LLM safety net (recommended when AI configured). Falls back to regex with a warning if llm/hybrid is requested but no AI provider is configured.
incremental_cursorNoPer-call override for `memory.mining.incrementalCursor`. When true (default), reuse byte-offset cursors so appended turns get re-processed; when false, fall back to legacy binary mined/unmined semantics.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses that the tool mutates the decision store and is idempotent, aligning with annotations (idempotentHint=true, destructiveHint=false). It details force, incremental cursor, and threshold behavior. However, it omits edge cases like invalid project_root or error states.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense and informative, front-loaded with the main purpose. At ~150 words, it covers key aspects efficiently, though it could be slightly more streamlined by grouping related details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 7 parameters and no output schema, the description covers purpose, strategies, skipping, cursor, mutation, idempotency, and return format. It lacks error handling or performance details but is largely complete for an experienced user.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All 7 parameters have schema descriptions (100% coverage). The description adds value by explaining strategy enum details, incremental_cursor semantics, and threshold interactions, but these are supplementary to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Mine' and the resource 'session logs', specifying the types of information extracted (architectural decisions, tech choices, etc.). It distinguishes this tool from siblings like search_sessions by focusing on mining for decisions and preferences.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use each strategy (regex, llm, hybrid) with trade-offs (cost, recall), and notes fallback behavior. It also mentions skipping already-mined sessions unless force=true. However, it lacks explicit when-not-to-use guidance or alternatives beyond the three strategies.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nikolai-vysotskyi/trace-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server