{"id":"mem-search","name":"mem-search","summary":"claude-memの永続的なクロスセッションメモリデータベースを検索してください。ユーザーが「もう解いたの?」「前回どうやってXをやったの?」「前のセッションで課題が必要だ」と尋ねたときに使います。","body":"# Memory Search\n\nSearch past work across all sessions. Simple workflow: search -> filter -> fetch.\n\n## When to Use\n\nUse when users ask about PREVIOUS sessions (not current conversation):\n\n- \"Did we already fix this?\"\n- \"How did we solve X last time?\"\n- \"What happened last week?\"\n\n## 3-Layer Workflow (ALWAYS Follow)\n\n**NEVER fetch full details without filtering first. 10x token savings.**\n\n### Step 1: Search - Get Index with IDs\n\nUse the `search` MCP tool:\n\n```\nsearch(query=\"authentication\", limit=20, project=\"my-project\")\n```\n\n**Returns:** Table with IDs, timestamps, types, titles (~50-100 tokens/result)\n\n```\n| ID | Time | T | Title | Read |\n|----|------|---|-------|------|\n| #11131 | 3:48 PM | 🟣 | Added JWT authentication | ~75 |\n| #10942 | 2:15 PM | 🔴 | Fixed auth token expiration | ~50 |\n```\n\n**Parameters:**\n\n- `query` (string) - Search term\n- `limit` (number) - Max results, default 20, max 100\n- `project` (string) - Project name filter\n- `type` (string, optional) - \"observations\", \"sessions\", or \"prompts\"\n- `obs_type` (string, optional) - Comma-separated: bugfix, feature, decision, discovery, change\n- `dateStart` (string, optional) - YYYY-MM-DD or epoch ms\n- `dateEnd` (string, optional) - YYYY-MM-DD or epoch ms\n- `offset` (number, optional) - Skip N results\n- `orderBy` (string, optional) - \"date_desc\" (default), \"date_asc\", \"relevance\"\n\n### Step 2: Timeline - Get Context Around Interesting Results\n\nUse the `timeline` MCP tool:\n\n```\ntimeline(anchor=11131, depth_before=3, depth_after=3, project=\"my-project\")\n```\n\nOr find anchor automatically from query:\n\n```\ntimeline(query=\"authentication\", depth_before=3, depth_after=3, project=\"my-project\")\n```\n\n**Returns:** `depth_before + 1 + depth_after` items in chronological order with observations, sessions, and prompts interleaved around the anchor.\n\n**Parameters:**\n\n- `anchor` (number, optional) - Observation ID to center around\n- `query` (string, optional) - Find anchor automatically if anchor not provided\n- `depth_before` (number, optional) - Items before anchor, default 5, max 20\n- `depth_after` (number, optional) - Items after anchor, default 5, max 20\n- `project` (string) - Project name filter\n\n### Step 3: Fetch - Get Full Details ONLY for Filtered IDs\n\nReview titles from Step 1 and context from Step 2. Pick relevant IDs. Discard the rest.\n\nUse the `get_observations` MCP tool:\n\n```\nget_observations(ids=[11131, 10942])\n```\n\n**ALWAYS use `get_observations` for 2+ observations - single request vs N requests.**\n\n**Parameters:**\n\n- `ids` (array of numbers, required) - Observation IDs to fetch\n- `orderBy` (string, optional) - \"date_desc\" (default), \"date_asc\"\n- `limit` (number, optional) - Max observations to return\n- `project` (string, optional) - Project name filter\n\n**Returns:** Complete observation objects with title, subtitle, narrative, facts, concepts, files (~500-1000 tokens each)\n\n## Examples\n\n**Find recent bug fixes:**\n\n```\nsearch(query=\"bug\", type=\"observations\", obs_type=\"bugfix\", limit=20, project=\"my-project\")\n```\n\n**Find what happened last week:**\n\n```\nsearch(type=\"observations\", dateStart=\"2025-11-11\", limit=20, project=\"my-project\")\n```\n\n**Understand context around a discovery:**\n\n```\ntimeline(anchor=11131, depth_before=5, depth_after=5, project=\"my-project\")\n```\n\n**Batch fetch details:**\n\n```\nget_observations(ids=[11131, 10942, 10855], orderBy=\"date_desc\")\n```\n\n## Why This Workflow?\n\n- **Search index:** ~50-100 tokens per result\n- **Full observation:** ~500-1000 tokens each\n- **Batch fetch:** 1 HTTP request vs N individual requests\n- **10x token savings** by filtering before fetching\n\n## Knowledge Agents\n\nWant synthesized answers instead of raw records? Use `/knowledge-agent` to build a queryable corpus from your observation history. The knowledge agent reads all matching observations and answers questions conversationally.","author":"@thedotmack","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/thedotmack/claude-mem/tree/main/plugin/skills/mem-search","license":"Apache-2.0","category":"productivity","lang":"en","tokens":1021,"stars":0,"calls30d":1,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":[]}}