Skip to main content
Glama

mine_sessions

Idempotent

Extract architectural decisions, tech choices, bug root causes, and preferences from session logs. Choose regex, LLM, or hybrid strategy to improve recall.

Instructions

Mine Claude Code / Claw Code session logs for architectural decisions, tech choices, bug root causes, and preferences. Strategies: "regex" (default, free, ~20-40% recall), "llm" (higher recall, costs tokens), "hybrid" (regex + LLM safety net). Skips already-mined sessions unless force=true. Mutates the decision store; idempotent. Returns JSON: { mined, decisions_extracted, sessions_processed, strategy?, llm_sessions?, llm_decisions_extracted? }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoRe-mine already processed sessions (default: false)
strategyNoExtraction strategy: regex (default, free/fast/low recall), llm (AI provider, costs tokens, higher recall), hybrid (regex + LLM safety net). Falls back to regex with a warning if no AI provider is configured.
project_rootNoOnly mine sessions for this project path (default: all projects)
min_confidenceNoLegacy reject floor — drops decisions below this. Superseded by reject_threshold; kept for back-compat.
reject_thresholdNoReject floor (default: config decisions.reject_threshold, fallback 0.45). Decisions in [reject_threshold, review_threshold) queue for review; below it, dropped.
review_thresholdNoAuto-approve cutoff (default: config decisions.review_threshold, fallback 0.75). Decisions ≥ this enter the active graph immediately.
incremental_cursorNoPer-call override for `memory.mining.incrementalCursor`. true (default) reuses byte-offset cursors for appended turns; false falls back to legacy mined/unmined semantics.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed5 schema fields changedv3.3.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • changedInput schema / properties / incremental_cursor / description
      Previous value: -"Per-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."New value: +"Per-call override for `memory.mining.incrementalCursor`. true (default) reuses byte-offset cursors for appended turns; false falls back to legacy mined/unmined semantics."
    • changedInput schema / properties / reject_threshold / description
      Previous value: -"Memoir 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."New value: +"Reject floor (default: config decisions.reject_threshold, fallback 0.45). Decisions in [reject_threshold, review_threshold) queue for review; below it, dropped."
    • changedInput schema / properties / review_threshold / description
      Previous value: -"Memoir auto-approve cutoff (default: decisions.review_threshold from config, fallback 0.75). Decisions ≥ this enter the active knowledge graph immediately."New value: +"Auto-approve cutoff (default: config decisions.review_threshold, fallback 0.75). Decisions ≥ this enter the active graph immediately."
    • changedInput schema / properties / strategy / description
      Previous value: -"Extraction 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."New value: +"Extraction strategy: regex (default, free/fast/low recall), llm (AI provider, costs tokens, higher recall), hybrid (regex + LLM safety net). Falls back to regex with a warning if no AI provider is configured."
  2. Addedv1.41.0
  3. Removedv1.38.0
  4. Changed4 schema fields changedv1.35.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / min_confidence / description
      Previous value: -"Minimum confidence threshold for extracted decisions (default: 0.6)"New value: +"Legacy reject floor — drops decisions below this. Superseded by reject_threshold; kept for back-compat."
    • addedInput schema / properties / reject_threshold
      Added value: +{
      +  "description": "Memoir 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.",
      +  "maximum": 1,
      +  "minimum": 0,
      +  "type": "number"
      +}
    • addedInput schema / properties / review_threshold
      Added value: +{
      +  "description": "Memoir auto-approve cutoff (default: decisions.review_threshold from config, fallback 0.75). Decisions ≥ this enter the active knowledge graph immediately.",
      +  "maximum": 1,
      +  "minimum": 0,
      +  "type": "number"
      +}
  5. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

The description explicitly states "Mutates the decision store; idempotent," and "Skips already-mined sessions unless force=true." This adds meaningful behavioral context beyond the annotations, specifying exactly what side effect occurs, the idempotency guarantee, and the skip behavior. It aligns with idempotentHint=true and readOnlyHint=false, with no contradictions.

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

Conciseness5/5

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

The description is compact and dense: two sentences carrying purpose, strategy tradeoffs, behavioral notes, and return shape. It front-loads the core purpose, uses structured lists for strategies, and contains no filler. Every clause earns its place.

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

Completeness5/5

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

For a tool with 7 optional parameters, no output schema, and moderate complexity, the description supplies the return JSON structure, strategy cost/recall tradeoffs, mutation behavior, and skip logic. Combined with 100% schema coverage, an agent has everything needed to select and invoke the tool correctly.

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?

Schema coverage is 100%, and the schema already documents all 7 parameters with detailed descriptions, including enum choices, thresholds, and the incremental_cursor override. The description merely summarizes strategy and force, adding no new semantic information beyond what the schema already provides. Baseline 3 is appropriate.

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 opens with a specific verb and resource: "Mine Claude Code / Claw Code session logs for architectural decisions, tech choices, bug root causes, and preferences." This clearly distinguishes it from sibling read/query tools like search and query_decisions by stating it processes session logs and mutates the decision store. The purpose is unambiguous.

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 gives concrete guidance on strategy selection (regex vs llm vs hybrid) and explains the skip-already-mined behavior with force=true. However, it never explicitly names alternatives or states when NOT to use this tool (e.g., "use query_decisions instead to read stored decisions"). Context is clear but exclusions are absent.

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

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