claude_memory 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/memory.sqlite3 +0 -0
  3. data/.claude/memory.sqlite3-shm +0 -0
  4. data/.claude/memory.sqlite3-wal +0 -0
  5. data/.claude/settings.json +78 -6
  6. data/.claude/settings.local.json +5 -2
  7. data/.claude/skills/improve/SKILL.md +113 -25
  8. data/.claude-plugin/commands/distill-transcripts.md +98 -0
  9. data/.claude-plugin/commands/memory-recall.md +67 -0
  10. data/.claude-plugin/marketplace.json +1 -1
  11. data/.claude-plugin/plugin.json +1 -2
  12. data/CHANGELOG.md +74 -1
  13. data/CLAUDE.md +32 -6
  14. data/README.md +1 -1
  15. data/docs/improvements.md +51 -91
  16. data/docs/influence/lossless-claw.md +409 -0
  17. data/docs/quality_review.md +119 -224
  18. data/hooks/hooks.json +39 -7
  19. data/lib/claude_memory/commands/checks/distill_check.rb +61 -0
  20. data/lib/claude_memory/commands/checks/hooks_check.rb +2 -2
  21. data/lib/claude_memory/commands/checks/vec_check.rb +2 -1
  22. data/lib/claude_memory/commands/completion_command.rb +179 -0
  23. data/lib/claude_memory/commands/doctor_command.rb +2 -0
  24. data/lib/claude_memory/commands/help_command.rb +4 -0
  25. data/lib/claude_memory/commands/hook_command.rb +2 -1
  26. data/lib/claude_memory/commands/index_command.rb +100 -65
  27. data/lib/claude_memory/commands/initializers/database_ensurer.rb +16 -0
  28. data/lib/claude_memory/commands/initializers/global_initializer.rb +2 -1
  29. data/lib/claude_memory/commands/initializers/hooks_configurator.rb +55 -11
  30. data/lib/claude_memory/commands/initializers/project_initializer.rb +2 -1
  31. data/lib/claude_memory/commands/install_skill_command.rb +78 -0
  32. data/lib/claude_memory/commands/registry.rb +3 -1
  33. data/lib/claude_memory/commands/skills/distill-transcripts.md +98 -0
  34. data/lib/claude_memory/commands/skills/memory-recall.md +67 -0
  35. data/lib/claude_memory/core/fact_ranker.rb +2 -2
  36. data/lib/claude_memory/core/rr_fusion.rb +23 -6
  37. data/lib/claude_memory/core/snippet_extractor.rb +7 -3
  38. data/lib/claude_memory/core/text_builder.rb +11 -0
  39. data/lib/claude_memory/domain/provenance.rb +0 -1
  40. data/lib/claude_memory/embeddings/api_adapter.rb +96 -0
  41. data/lib/claude_memory/embeddings/dimension_check.rb +23 -0
  42. data/lib/claude_memory/embeddings/fastembed_adapter.rb +4 -0
  43. data/lib/claude_memory/embeddings/generator.rb +4 -0
  44. data/lib/claude_memory/embeddings/resolver.rb +18 -0
  45. data/lib/claude_memory/hook/context_injector.rb +58 -2
  46. data/lib/claude_memory/hook/distillation_runner.rb +46 -0
  47. data/lib/claude_memory/hook/handler.rb +11 -2
  48. data/lib/claude_memory/index/vector_index.rb +15 -2
  49. data/lib/claude_memory/infrastructure/schema_validator.rb +3 -3
  50. data/lib/claude_memory/mcp/error_classifier.rb +171 -0
  51. data/lib/claude_memory/mcp/handlers/context_handlers.rb +38 -0
  52. data/lib/claude_memory/mcp/handlers/management_handlers.rb +145 -0
  53. data/lib/claude_memory/mcp/handlers/query_handlers.rb +115 -0
  54. data/lib/claude_memory/mcp/handlers/setup_handlers.rb +211 -0
  55. data/lib/claude_memory/mcp/handlers/shortcut_handlers.rb +37 -0
  56. data/lib/claude_memory/mcp/handlers/stats_handlers.rb +202 -0
  57. data/lib/claude_memory/mcp/instructions_builder.rb +64 -5
  58. data/lib/claude_memory/mcp/query_guide.rb +51 -22
  59. data/lib/claude_memory/mcp/response_formatter.rb +4 -1
  60. data/lib/claude_memory/mcp/server.rb +1 -0
  61. data/lib/claude_memory/mcp/text_summary.rb +28 -1
  62. data/lib/claude_memory/mcp/tool_definitions.rb +33 -3
  63. data/lib/claude_memory/mcp/tool_helpers.rb +43 -0
  64. data/lib/claude_memory/mcp/tools.rb +47 -681
  65. data/lib/claude_memory/recall/dual_engine.rb +105 -0
  66. data/lib/claude_memory/recall/legacy_engine.rb +138 -0
  67. data/lib/claude_memory/recall/query_core.rb +371 -0
  68. data/lib/claude_memory/recall.rb +29 -616
  69. data/lib/claude_memory/shortcuts.rb +4 -4
  70. data/lib/claude_memory/store/retry_handler.rb +61 -0
  71. data/lib/claude_memory/store/schema_manager.rb +68 -0
  72. data/lib/claude_memory/store/sqlite_store.rb +85 -201
  73. data/lib/claude_memory/sweep/maintenance.rb +126 -0
  74. data/lib/claude_memory/sweep/sweeper.rb +81 -75
  75. data/lib/claude_memory/templates/hooks.example.json +26 -7
  76. data/lib/claude_memory/version.rb +1 -1
  77. data/lib/claude_memory.rb +12 -0
  78. data/v0.6.0.ANNOUNCE +32 -0
  79. metadata +27 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfbba4c01acb3ad07b9114c6781ee7b6dbb197007ff61c72d7fa8b2ec164643e
4
- data.tar.gz: 41df94bae4dc18bd00321ebca1fc80145faa6b180bb3ec00ff3d72a8cf091041
3
+ metadata.gz: 1483a3663c9c589abad58f80c71d772c592f13727d3fd1339418c2ba1a3db875
4
+ data.tar.gz: 34beebdf5e3cc8a70d383757ffaf7e21fde0724f963532e2d2548ec2e63ba329
5
5
  SHA512:
6
- metadata.gz: f9e8278553ef1ba3c6d490304c9118c519612d5c6cd61230e94dc0dccca40ef653118e7c364e35ba2e58b2fb66d6b7fea39455f12723df6ddf8a8a9d55bc4d71
7
- data.tar.gz: db870500e372150fbb6133ce43396aa57c2338e9aa392939219c4e2435d8bcaaac0724f858f387c97c3c9187a7b1409268b7246d91ad6018324935089daa149e
6
+ metadata.gz: 514022df68751e4421942d914c003a1e104a5c2b5ab4a639619ca05bb4d6bafd722d87009dc898a5b578f1b7efdae50df68b5b8232e1cf42a8bb5e88a06e66c3
7
+ data.tar.gz: 68c5a36361d3048e4c92bba7127e7fa0bc9ff09f6de3779ae59f7799cd4152d63030386ea2b124a90b345063545028b0da0401c9144f284c7e34290b2d674ba7
Binary file
Binary file
Binary file
@@ -6,7 +6,16 @@
6
6
  {
7
7
  "type": "command",
8
8
  "command": "claude-memory hook ingest",
9
- "timeout": 10
9
+ "timeout": 5
10
+ }
11
+ ]
12
+ },
13
+ {
14
+ "hooks": [
15
+ {
16
+ "type": "command",
17
+ "command": "claude-memory hook ingest --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
18
+ "timeout": 5
10
19
  }
11
20
  ]
12
21
  }
@@ -14,11 +23,6 @@
14
23
  "SessionStart": [
15
24
  {
16
25
  "hooks": [
17
- {
18
- "type": "command",
19
- "command": "claude-memory hook ingest",
20
- "timeout": 10
21
- },
22
26
  {
23
27
  "type": "command",
24
28
  "command": "claude-memory hook context",
@@ -41,6 +45,20 @@
41
45
  "timeout": 30
42
46
  }
43
47
  ]
48
+ },
49
+ {
50
+ "hooks": [
51
+ {
52
+ "type": "command",
53
+ "command": "claude-memory hook ingest --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
54
+ "timeout": 30
55
+ },
56
+ {
57
+ "type": "command",
58
+ "command": "claude-memory hook sweep --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
59
+ "timeout": 30
60
+ }
61
+ ]
44
62
  }
45
63
  ],
46
64
  "SessionEnd": [
@@ -57,6 +75,60 @@
57
75
  "timeout": 30
58
76
  }
59
77
  ]
78
+ },
79
+ {
80
+ "hooks": [
81
+ {
82
+ "type": "command",
83
+ "command": "claude-memory hook ingest --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
84
+ "timeout": 30
85
+ },
86
+ {
87
+ "type": "command",
88
+ "command": "claude-memory hook sweep --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
89
+ "timeout": 30
90
+ }
91
+ ]
92
+ }
93
+ ],
94
+ "TaskCompleted": [
95
+ {
96
+ "hooks": [
97
+ {
98
+ "type": "command",
99
+ "command": "claude-memory hook ingest",
100
+ "timeout": 10
101
+ }
102
+ ]
103
+ },
104
+ {
105
+ "hooks": [
106
+ {
107
+ "type": "command",
108
+ "command": "claude-memory hook ingest --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
109
+ "timeout": 10
110
+ }
111
+ ]
112
+ }
113
+ ],
114
+ "TeammateIdle": [
115
+ {
116
+ "hooks": [
117
+ {
118
+ "type": "command",
119
+ "command": "claude-memory hook ingest",
120
+ "timeout": 15
121
+ }
122
+ ]
123
+ },
124
+ {
125
+ "hooks": [
126
+ {
127
+ "type": "command",
128
+ "command": "claude-memory hook ingest --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
129
+ "timeout": 15
130
+ }
131
+ ]
60
132
  }
61
133
  ]
62
134
  }
@@ -46,8 +46,11 @@
46
46
  "Bash(claude-memory recall:*)",
47
47
  "Bash(claude-memory stats:*)",
48
48
  "Bash(claude-memory search:*)",
49
- "Bash(bundle exec:*)"
49
+ "Bash(bundle exec:*)",
50
+ "Skill(improve)",
51
+ "Skill(improve:*)"
50
52
  ]
51
53
  },
52
- "enableAllProjectMcpServers": true
54
+ "enableAllProjectMcpServers": true,
55
+ "outputStyle": "memory-aware"
53
56
  }
@@ -3,23 +3,88 @@ name: improve
3
3
  description: Incrementally implement feature improvements from docs/improvements.md with tests and atomic commits. Focuses on new functionality rather than refactoring.
4
4
  agent: general-purpose
5
5
  allowed-tools: Read, Grep, Edit, Write, Bash
6
+ arguments:
7
+ - name: mode
8
+ description: "Execution mode: 'sub-agent' (default, sequential) or 'agent-team' (parallel via agent teams)"
9
+ required: false
10
+ default: "sub-agent"
6
11
  ---
7
12
 
8
13
  # Feature Improvements - Incremental Implementation
9
14
 
10
15
  Systematically implement feature improvements from `docs/improvements.md`, making tested, atomic commits for each feature addition.
11
16
 
17
+ ## Execution Modes
18
+
19
+ This skill supports two modes, passed as the first argument:
20
+
21
+ - **`sub-agent`** (default): A single agent works through improvements sequentially. Best for small batches (1-3 features) or features with dependencies.
22
+ - **`agent-team`**: Spawns a coordinated team of agents that implement independent features in parallel. Best for larger batches (3+) of independent features.
23
+
24
+ ---
25
+
26
+ ## Mode: agent-team
27
+
28
+ When invoked with `agent-team`, follow this process:
29
+
30
+ ### Step 1: Read and Assess Improvements
31
+
32
+ Read `docs/improvements.md` and identify all implementable features using the same feasibility criteria as sub-agent mode (skip Categories D-F, "Features to Avoid", "If Requested" items).
33
+
34
+ ### Step 2: Group Independent Features
35
+
36
+ Partition implementable features into independent groups:
37
+ - Features touching **different files** can be parallelized
38
+ - Features sharing files or with dependencies must be sequential
39
+ - Aim for 3-5 teammates maximum
40
+
41
+ ### Step 3: Create the Agent Team
42
+
43
+ Create an agent team. For each teammate:
44
+
45
+ 1. **Assign one or two related features** per teammate
46
+ 2. **Provide full context** — teammates don't share your conversation history
47
+ 3. **Include these instructions for each teammate**:
48
+ - Read relevant existing code before making changes
49
+ - Follow the project's code style (Standard Ruby, frozen_string_literal)
50
+ - Write tests for all new functionality
51
+ - Run `bundle exec rake standard:fix` before committing
52
+ - Run relevant spec file after each edit, full suite before committing
53
+ - Run `bundle exec rspec` to verify all tests pass
54
+ - Make atomic commits with `[Feature]` prefix format
55
+ - Update `docs/improvements.md` to mark features as implemented
56
+ - Reference `.claude/skills/improve/feature-patterns.md` for implementation recipes
57
+
58
+ ### Step 4: Monitor and Coordinate
59
+
60
+ - Wait for all teammates to complete their tasks
61
+ - If a teammate reports a blocker or conflict, help resolve it
62
+ - Do NOT implement tasks yourself — let teammates do the work
63
+
64
+ ### Step 5: Validate and Report
65
+
66
+ After all teammates finish:
67
+
68
+ 1. Run the full test suite: `bundle exec rspec`
69
+ 2. Run the linter: `bundle exec rake standard:fix`
70
+ 3. If any failures, fix them or coordinate with the relevant teammate
71
+ 4. Provide a consolidated progress report (same Final Report format as sub-agent mode)
72
+
73
+ ---
74
+
75
+ ## Mode: sub-agent (default)
76
+
12
77
  ## Process Overview
13
78
 
14
79
  1. **Check memory health** by calling `memory.check_setup` to verify the system is operational
15
80
  2. **Read the improvements document** from `docs/improvements.md`
16
- 2. **Identify unimplemented features** from "Remaining Tasks" section
17
- 3. **Prioritize by stated priority** (Medium → Low)
18
- 4. **Assess feasibility** (skip if too complex or requires external services)
19
- 5. **Implement features incrementally** (one logical feature at a time)
20
- 6. **Run tests after each change** to ensure nothing breaks
21
- 7. **Make atomic commits** that capture the feature and its purpose
22
- 8. **Update improvements.md** to mark features as implemented
81
+ 3. **Identify unimplemented features** from "Remaining Tasks" section
82
+ 4. **Prioritize by stated priority** (Medium → Low)
83
+ 5. **Assess feasibility** (skip if too complex or requires external services)
84
+ 6. **Implement features incrementally** (one logical feature at a time)
85
+ 7. **Run tests after each change** to ensure nothing breaks
86
+ 8. **Make atomic commits** that capture the feature and its purpose
87
+ 9. **Update improvements.md** to mark features as implemented
23
88
 
24
89
  ## Detailed Steps
25
90
 
@@ -100,11 +165,15 @@ For each feature:
100
165
  ```bash
101
166
  bundle exec rake standard:fix
102
167
  ```
103
- 5. **Run tests**:
168
+ 5. **Run targeted tests** after each edit:
169
+ ```bash
170
+ bundle exec rspec spec/claude_memory/<relevant_spec>.rb
171
+ ```
172
+ 6. **Run full suite** before committing:
104
173
  ```bash
105
174
  bundle exec rspec
106
175
  ```
107
- 6. **Fix any test failures** before proceeding
176
+ 7. **Fix any test failures** before proceeding
108
177
 
109
178
  ### Step 5: Make Atomic Commit
110
179
 
@@ -300,9 +369,15 @@ Is it marked "Features to Avoid"?
300
369
 
301
370
  Category D (Background)?
302
371
  ├─ YES → Assess carefully, may skip
303
- └─ NO → Implement (Categories A-C safe)
372
+ └─ NO → Continue
304
373
 
305
- Implement the feature
374
+ Does it have dependencies on other features?
375
+ ├─ YES → Are dependencies complete?
376
+ │ ├─ NO → SKIP, note dependency
377
+ │ └─ YES → Continue
378
+ └─ NO → Implement (Categories A-C safe)
379
+
380
+ Implement the feature
306
381
 
307
382
  Run tests
308
383
 
@@ -324,11 +399,15 @@ Is it marked "Features to Avoid"?
324
399
  ## Time Budgets
325
400
 
326
401
  **Per Feature:**
327
- - Category A (Schema): Max 20 minutes
328
- - Category B (Reporting): Max 30 minutes
329
- - Category C (CLI): Max 30 minutes
330
- - Category D (Background): Max 60 minutes (or skip)
331
- - Category E (External): Max 45 minutes (or skip)
402
+ - Category A (Schema): Max 15 minutes — skip if stuck after 15
403
+ - Category B (Reporting): Max 20 minutes — skip if stuck after 20
404
+ - Category C (CLI): Max 30 minutes — skip if stuck after 30
405
+ - Category D (Background): Max 45 minutes (or skip at first sign of daemon complexity)
406
+ - Category E (External): Max 30 minutes (or skip at first sign of dependency issues)
407
+
408
+ **Per Debug Cycle:**
409
+ - Test failure fix: Max 15 minutes — if you can't fix it in 15 minutes, revert and skip
410
+ - Understanding code: Max 10 minutes — if unclear after 10 minutes, skip and report
332
411
 
333
412
  **Session Total:** Max 2 hours
334
413
 
@@ -337,26 +416,35 @@ If time budget exceeded: SKIP remaining features and report.
337
416
  ## Testing Strategy
338
417
 
339
418
  ### Test Frequency
340
- - After schema changes: Run all specs
341
- - After new command: Run command specs + integration
342
- - After reporting changes: Run relevant specs
343
- - Before commit: Full test suite
419
+ - After each file edit: Run the relevant spec file
420
+ - After schema changes: Run `spec/claude_memory/store/`
421
+ - After new command: Run `spec/claude_memory/commands/`
422
+ - Before each commit: Full test suite
423
+ - If >5 files changed: Full test suite immediately
344
424
 
345
425
  ### Test Commands
346
426
  ```bash
347
- # Specific command tests
348
- bundle exec rspec spec/claude_memory/commands/
427
+ # Single relevant spec (fastest feedback)
428
+ bundle exec rspec spec/claude_memory/commands/metrics_command_spec.rb
349
429
 
350
- # Schema tests
430
+ # Module-level specs
431
+ bundle exec rspec spec/claude_memory/commands/
351
432
  bundle exec rspec spec/claude_memory/store/
352
433
 
353
- # Full suite
434
+ # Full suite (before commit)
354
435
  bundle exec rspec
355
436
 
356
- # With linting
437
+ # With linting (final check)
357
438
  bundle exec rake
358
439
  ```
359
440
 
441
+ ### Test Failure Response
442
+ 1. Read error message carefully
443
+ 2. Check if your change caused it (vs pre-existing)
444
+ 3. If your change: fix within 15 minutes or revert and skip
445
+ 4. If pre-existing: note and continue
446
+ 5. If unsure: revert change and skip item
447
+
360
448
  ### New Feature Tests
361
449
 
362
450
  Always add tests for new features:
@@ -0,0 +1,98 @@
1
+ # Distill Transcripts
2
+
3
+ Extract structured knowledge (facts, entities, decisions) from undistilled transcript content and persist it to long-term memory.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /distill-transcripts
9
+ /distill-transcripts --limit 10
10
+ ```
11
+
12
+ ## Instructions
13
+
14
+ You are a knowledge extraction specialist. Your job is to read raw transcript content and extract structured facts, entities, and decisions, then persist them via the memory.store_extraction MCP tool.
15
+
16
+ ### Step 1: Get Undistilled Content
17
+
18
+ Call `memory.undistilled` with `limit: 10` to get transcript content that hasn't been processed yet.
19
+
20
+ If no items are returned, report "No undistilled content found" and stop.
21
+
22
+ ### Step 2: Extract Knowledge (per item)
23
+
24
+ For each content item, carefully read the raw_text and extract:
25
+
26
+ **Entities** — Named things mentioned:
27
+ - type: database, framework, language, platform, repo, module, person, service
28
+ - name: Canonical name (e.g., "PostgreSQL" not "postgres")
29
+ - confidence: 0.0-1.0
30
+
31
+ **Facts** — Knowledge learned:
32
+ - subject: Entity name or "repo" for project-level facts
33
+ - predicate: uses_database, uses_framework, convention, decision, auth_method, deployment_platform, depends_on, testing_strategy
34
+ - object: The value
35
+ - confidence: 0.0-1.0
36
+ - quote: Source excerpt (max 200 chars)
37
+ - strength: "stated" (explicitly said) or "inferred" (implied)
38
+ - scope_hint: "project" (this project only) or "global" (all projects)
39
+
40
+ **Decisions** — Choices made:
41
+ - title: Short summary (max 100 chars)
42
+ - summary: Full description
43
+ - status_hint: "accepted", "proposed", or "rejected"
44
+
45
+ ### What to Extract
46
+
47
+ - Technology choices ("we use PostgreSQL", "switched to React")
48
+ - Conventions ("always use frozen_string_literal", "test files go in spec/")
49
+ - Architectural decisions ("API uses REST", "auth via JWT")
50
+ - Preferences ("prefer 4-space indent", "use Standard Ruby")
51
+ - Project structure ("migrations in db/migrations/", "commands in commands/")
52
+
53
+ ### What to Skip
54
+
55
+ - Debugging steps and transient errors
56
+ - Code output and tool observations
57
+ - File contents that were just being read
58
+ - Ephemeral task details ("fix this test", "run the linter")
59
+ - Information already obvious from the codebase itself
60
+
61
+ ### Scope Detection
62
+
63
+ Set scope_hint to "global" when the text contains signals like:
64
+ - "I always...", "in all my projects...", "my preference is..."
65
+ - "everywhere", "across all repos"
66
+
67
+ Default to "project" for everything else.
68
+
69
+ ### Step 3: Persist Each Extraction
70
+
71
+ For each content item with extracted knowledge:
72
+
73
+ 1. Call `memory.store_extraction` with the entities, facts, and decisions arrays
74
+ 2. Call `memory.mark_distilled` with the content_item_id and facts_extracted count
75
+ 3. If nothing was extracted, still call `memory.mark_distilled` with facts_extracted: 0
76
+
77
+ ### Step 4: Report
78
+
79
+ Return a summary:
80
+
81
+ ```
82
+ ## Distillation Complete
83
+
84
+ - Items processed: N
85
+ - Facts extracted: N
86
+ - Entities found: N
87
+ - Decisions captured: N
88
+ - Items skipped (nothing to extract): N
89
+ ```
90
+
91
+ ### Guidelines
92
+
93
+ - Process items one at a time to keep extractions focused
94
+ - Use `compact: true` on `memory.undistilled` for smaller responses
95
+ - Be conservative — only extract facts you're confident about (>0.7)
96
+ - Prefer "stated" strength over "inferred" unless clearly implied
97
+ - Do NOT fabricate facts — only extract what's actually in the text
98
+ - If text is mostly code/tool output with no conversational knowledge, mark as distilled with 0 facts
@@ -0,0 +1,67 @@
1
+ # Memory Recall Agent
2
+
3
+ Search long-term memory for facts, decisions, conventions, and architectural knowledge. Chains multiple memory tools to build comprehensive answers while saving main-agent context.
4
+
5
+ ## Usage
6
+
7
+ Provide a natural language query describing what you want to recall:
8
+
9
+ ```
10
+ /memory-recall database migration strategy
11
+ /memory-recall authentication decisions
12
+ /memory-recall testing conventions
13
+ ```
14
+
15
+ ## Workflow
16
+
17
+ 1. **Fast lookup** — Start with `memory.recall` for keyword matches
18
+ 2. **Semantic search** — If recall returns few results, try `memory.recall_semantic` for conceptual matches
19
+ 3. **Shortcuts** — For known categories, use `memory.decisions`, `memory.conventions`, or `memory.architecture`
20
+ 4. **Deep dive** — For specific facts, use `memory.explain` to get provenance and `memory.fact_graph` to see relationships
21
+ 5. **Synthesize** — Combine findings into a concise, structured answer
22
+
23
+ ## Instructions
24
+
25
+ You are a memory recall specialist. Given a query, search ClaudeMemory using the available MCP tools and return a synthesized answer.
26
+
27
+ ### Step 1: Initial Search
28
+
29
+ Run `memory.recall` with the user's query. If the query mentions decisions, conventions, or architecture, also run the appropriate shortcut tool in parallel.
30
+
31
+ ### Step 2: Expand if Needed
32
+
33
+ If Step 1 returns fewer than 3 results:
34
+ - Try `memory.recall_semantic` with a rephrased version of the query
35
+ - Try `memory.search_concepts` with 2-3 key concepts extracted from the query
36
+
37
+ ### Step 3: Enrich Key Facts
38
+
39
+ For the top 2-3 most relevant facts:
40
+ - Run `memory.explain` to get provenance (where the fact came from)
41
+ - If relationships matter, run `memory.fact_graph` to see connected facts
42
+
43
+ ### Step 4: Synthesize
44
+
45
+ Return a structured response:
46
+
47
+ ```
48
+ ## Memory Recall Results
49
+
50
+ ### Key Facts
51
+ - [Fact 1 with provenance]
52
+ - [Fact 2 with provenance]
53
+
54
+ ### Context
55
+ [How these facts relate to the query]
56
+
57
+ ### Confidence
58
+ [High/Medium/Low based on number and freshness of supporting facts]
59
+ ```
60
+
61
+ ### Guidelines
62
+
63
+ - Prefer `memory.recall` (fast, token-efficient) before escalating to semantic search
64
+ - Use `compact: true` on all tool calls to minimize token usage
65
+ - Do NOT fabricate facts — only report what memory tools return
66
+ - If no relevant facts found, say so clearly rather than guessing
67
+ - Include fact IDs so the main agent can reference them
@@ -7,7 +7,7 @@
7
7
  "plugins": [
8
8
  {
9
9
  "name": "claude-memory",
10
- "version": "0.7.0",
10
+ "version": "0.8.0",
11
11
  "source": "./",
12
12
  "description": "Long-term self-managed memory for Claude Code with fact extraction, truth maintenance, and provenance tracking",
13
13
  "repository": "https://github.com/codenamev/claude_memory"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-memory",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Long-term self-managed memory for Claude Code with fact extraction, truth maintenance, and provenance tracking",
5
5
  "author": {
6
6
  "name": "Valentino Stoll",
@@ -16,7 +16,6 @@
16
16
  "args": []
17
17
  }
18
18
  },
19
- "hooks": "./hooks/hooks.json",
20
19
  "skills": "./skills/",
21
20
  "commands": "./commands/",
22
21
  "outputStyles": "./output-styles/"
data/CHANGELOG.md CHANGED
@@ -4,6 +4,79 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.0] - 2026-03-30
8
+
9
+ ### Added
10
+
11
+ **Three-Layer Distillation Pipeline**
12
+ - Automatic distillation via NullDistiller in ingest pipeline (Layer 1: regex-based, P95 < 5ms)
13
+ - Context hook injection for LLM-based extraction at SessionStart (Layer 2: Claude Code as distiller, zero extra cost)
14
+ - `/distill-transcripts` skill for manual deep extraction (Layer 3: on-demand, depth-aware prompts)
15
+ - `memory.undistilled` and `memory.mark_distilled` MCP tools for distillation tracking
16
+ - `Hook::DistillationRunner` extracted from Handler for context hook injection
17
+ - `TaskCompleted` and `TeammateIdle` hook events for ingest triggers
18
+ - Distillation metrics backfill on database initialization
19
+ - Doctor check for undistilled content
20
+ - Pending distillation count in `memory.status` output
21
+
22
+ **Recall Enhancements**
23
+ - Intent parameter for recall query disambiguation (#3)
24
+ - Retrieval score traces for semantic search (#5)
25
+ - Configurable embedding providers with dimension checking
26
+
27
+ **Hook Enhancements**
28
+ - `statusMessage` on all hooks for descriptive spinner text during hook execution
29
+ - `StopFailure` hook to capture transcript data even on session errors (rate limits, server errors)
30
+ - `Notification` hook with `idle_prompt` matcher for opportunistic sweep during idle
31
+
32
+ **New Commands & Skills**
33
+ - `install-skill` command and `memory-recall` agent (#8, #12)
34
+ - Shell completion command for bash and zsh (#18)
35
+
36
+ **Distillation Benchmark Results**
37
+ - NullDistiller: Concept Recall 0.952, Fact Precision/Recall 1.000 (31 test cases)
38
+ - Claude Code LLM: Concept Recall 0.902 (all 41 cases), 0.900 on semantic cases (vs 0.333 for regex)
39
+ - Average 1.6 facts stored per case across LLM extraction
40
+ - E2E distillation recall benchmark and extraction quality benchmarks
41
+ - Concept-based matching for distiller-agnostic benchmark comparison
42
+
43
+ ### Fixed
44
+
45
+ - `--allowedTools` added to `ClaudeCliRunner` for MCP tool permissions
46
+ - Test isolation for context hook when global database has facts
47
+
48
+ ### Internal
49
+ - Extracted `RetryHandler` and `SchemaManager` modules from `SQLiteStore`
50
+ - Extracted `Recall` into engine strategy pattern with `DualEngine`, `LegacyEngine`, and shared `QueryCore`
51
+ - Extracted `Tools` god object into 6 handler modules
52
+ - Added 36 specs for 5 previously untested files
53
+ - All 3 god objects eliminated, 0 files over 500 lines
54
+
55
+ ## [0.7.1] - 2026-03-17
56
+
57
+ ### Added
58
+
59
+ **Three-Level Sweep Escalation**
60
+ - `Maintenance` class with light/standard/deep sweep levels for progressive database maintenance
61
+ - Exposed sweep escalation via `memory.sweep_now` MCP tool with configurable level
62
+ - Tool escalation workflow added to MCP QueryGuide documentation
63
+
64
+ **Embedding Deduplication**
65
+ - Content-addressed deduplication for embeddings using SHA256 hashing
66
+ - Deduplication before vector scoring in fallback path to prevent duplicate results
67
+
68
+ **MCP Enhancements**
69
+ - Structured error classification for MCP tools via `ErrorClassifier` module
70
+ - Dynamic knowledge summary in MCP server instructions via `InstructionsBuilder`
71
+
72
+ ### Fixed
73
+
74
+ - **Plugin hook loading error**: Removed explicit `hooks` reference from `plugin.json` manifest — Claude Code auto-loads `hooks/hooks.json` from the plugin root, so declaring it caused "Duplicate hooks file detected" errors on plugin install
75
+
76
+ ### Internal
77
+ - Influence study: lossless-claw v0.3.0 DAG-based lossless context management
78
+ - Marked 7 improvements as implemented (#10, #11, #14, #15, #16, #19, #20)
79
+
7
80
  ## [0.7.0] - 2026-03-12
8
81
 
9
82
  ### Added
@@ -20,7 +93,7 @@ All notable changes to this project will be documented in this file.
20
93
  - Opt-out: set `CLAUDE_MEMORY_ISOLATE_WORKTREES=1` for per-worktree isolation
21
94
 
22
95
  **MCP Enhancements**
23
- - Tool annotations: `readOnlyHint`, `idempotentHint`, `destructiveHint` on all 21 tools
96
+ - Tool annotations: `readOnlyHint`, `idempotentHint`, `destructiveHint` on all 23 tools
24
97
  - Stdout protection: MCP server redirects `$stdout` to `$stderr` to prevent protocol corruption from accidental `puts`/`print` calls
25
98
  - Self-excluding agent conversations via `SELF_CONTEXT_MARKER` to prevent meta-pollution
26
99