memory_harvest
Extract decisions, bugs, conventions, learnings, and context from Claude Code session transcripts to build tagged memories; preview candidates with dry_run before storing.
Instructions
Extract learnings from Claude Code session transcripts.
USE THIS WHEN:
End of session — auto-capture decisions, bugs, conventions, learnings
User asks to "harvest" or "extract learnings" from sessions
Building knowledge base from past sessions
MODES:
dry_run=true (DEFAULT): Preview candidates without storing
dry_run=false: Store candidates as tagged memories
MEMORY TYPES EXTRACTED:
decision: Architectural choices, tool selections
bug: Issues encountered and root causes
convention: Patterns/rules established
learning: Insights, mistakes learned from
context: Session state for continuity
LLM CLASSIFICATION (Phase 2):
use_llm=true: Validate candidates with Groq LLM (higher precision, ~$0.001/candidate)
Filters conversation fragments, deduplicates, refines content
Requires GROQ_API_KEY environment variable
Examples: {"sessions": 1, "dry_run": true} {"sessions": 3, "types": ["decision", "bug"]} {"session_ids": ["abc123"], "dry_run": false} {"min_confidence": 0.7, "sessions": 1} {"sessions": 1, "use_llm": true, "dry_run": true}
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "memory_harvest"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| types | No | Filter by memory types (default: all) | |
| dry_run | No | Preview candidates without storing (default: true) | |
| use_llm | No | Use LLM to validate and refine candidates (requires GROQ_API_KEY) | |
| agent_id | No | Agent ID for auto_commit attribution (default: MCP_AGENT_ID env or 'unknown') | |
| sessions | No | Number of recent sessions to harvest | |
| auto_commit | No | Bridge harvested candidates to commit_session_legacy (feeds bootstrap profile) | |
| session_ids | No | Specific session IDs to harvest | |
| project_path | No | Override Claude Code project directory path | |
| min_confidence | No | Minimum confidence threshold (0.0-1.0) | |
| force_reharvest | No | Re-harvest sessions already recorded in the harvest tracker (bypasses the tracker filter). Use to re-process sessions whose prior run stored nothing. |