claude-memory-layer 1.0.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 (127) hide show
  1. package/.claude-plugin/commands/memory-forget.md +42 -0
  2. package/.claude-plugin/commands/memory-history.md +34 -0
  3. package/.claude-plugin/commands/memory-import.md +56 -0
  4. package/.claude-plugin/commands/memory-list.md +37 -0
  5. package/.claude-plugin/commands/memory-search.md +36 -0
  6. package/.claude-plugin/commands/memory-stats.md +34 -0
  7. package/.claude-plugin/hooks.json +59 -0
  8. package/.claude-plugin/plugin.json +24 -0
  9. package/.history/package_20260201112328.json +45 -0
  10. package/.history/package_20260201113602.json +45 -0
  11. package/.history/package_20260201113713.json +45 -0
  12. package/.history/package_20260201114110.json +45 -0
  13. package/Memo.txt +558 -0
  14. package/README.md +520 -0
  15. package/context.md +636 -0
  16. package/dist/.claude-plugin/commands/memory-forget.md +42 -0
  17. package/dist/.claude-plugin/commands/memory-history.md +34 -0
  18. package/dist/.claude-plugin/commands/memory-import.md +56 -0
  19. package/dist/.claude-plugin/commands/memory-list.md +37 -0
  20. package/dist/.claude-plugin/commands/memory-search.md +36 -0
  21. package/dist/.claude-plugin/commands/memory-stats.md +34 -0
  22. package/dist/.claude-plugin/hooks.json +59 -0
  23. package/dist/.claude-plugin/plugin.json +24 -0
  24. package/dist/cli/index.js +3539 -0
  25. package/dist/cli/index.js.map +7 -0
  26. package/dist/core/index.js +4408 -0
  27. package/dist/core/index.js.map +7 -0
  28. package/dist/hooks/session-end.js +2971 -0
  29. package/dist/hooks/session-end.js.map +7 -0
  30. package/dist/hooks/session-start.js +2969 -0
  31. package/dist/hooks/session-start.js.map +7 -0
  32. package/dist/hooks/stop.js +3123 -0
  33. package/dist/hooks/stop.js.map +7 -0
  34. package/dist/hooks/user-prompt-submit.js +2960 -0
  35. package/dist/hooks/user-prompt-submit.js.map +7 -0
  36. package/dist/services/memory-service.js +2931 -0
  37. package/dist/services/memory-service.js.map +7 -0
  38. package/package.json +45 -0
  39. package/plan.md +1642 -0
  40. package/scripts/build.ts +102 -0
  41. package/spec.md +624 -0
  42. package/specs/citations-system/context.md +243 -0
  43. package/specs/citations-system/plan.md +495 -0
  44. package/specs/citations-system/spec.md +371 -0
  45. package/specs/endless-mode/context.md +305 -0
  46. package/specs/endless-mode/plan.md +620 -0
  47. package/specs/endless-mode/spec.md +455 -0
  48. package/specs/entity-edge-model/context.md +401 -0
  49. package/specs/entity-edge-model/plan.md +459 -0
  50. package/specs/entity-edge-model/spec.md +391 -0
  51. package/specs/evidence-aligner-v2/context.md +401 -0
  52. package/specs/evidence-aligner-v2/plan.md +303 -0
  53. package/specs/evidence-aligner-v2/spec.md +312 -0
  54. package/specs/mcp-desktop-integration/context.md +278 -0
  55. package/specs/mcp-desktop-integration/plan.md +550 -0
  56. package/specs/mcp-desktop-integration/spec.md +494 -0
  57. package/specs/post-tool-use-hook/context.md +319 -0
  58. package/specs/post-tool-use-hook/plan.md +469 -0
  59. package/specs/post-tool-use-hook/spec.md +364 -0
  60. package/specs/private-tags/context.md +288 -0
  61. package/specs/private-tags/plan.md +412 -0
  62. package/specs/private-tags/spec.md +345 -0
  63. package/specs/progressive-disclosure/context.md +346 -0
  64. package/specs/progressive-disclosure/plan.md +663 -0
  65. package/specs/progressive-disclosure/spec.md +415 -0
  66. package/specs/task-entity-system/context.md +297 -0
  67. package/specs/task-entity-system/plan.md +301 -0
  68. package/specs/task-entity-system/spec.md +314 -0
  69. package/specs/vector-outbox-v2/context.md +470 -0
  70. package/specs/vector-outbox-v2/plan.md +562 -0
  71. package/specs/vector-outbox-v2/spec.md +466 -0
  72. package/specs/web-viewer-ui/context.md +384 -0
  73. package/specs/web-viewer-ui/plan.md +797 -0
  74. package/specs/web-viewer-ui/spec.md +516 -0
  75. package/src/cli/index.ts +570 -0
  76. package/src/core/canonical-key.ts +186 -0
  77. package/src/core/citation-generator.ts +63 -0
  78. package/src/core/consolidated-store.ts +279 -0
  79. package/src/core/consolidation-worker.ts +384 -0
  80. package/src/core/context-formatter.ts +276 -0
  81. package/src/core/continuity-manager.ts +336 -0
  82. package/src/core/edge-repo.ts +324 -0
  83. package/src/core/embedder.ts +124 -0
  84. package/src/core/entity-repo.ts +342 -0
  85. package/src/core/event-store.ts +672 -0
  86. package/src/core/evidence-aligner.ts +635 -0
  87. package/src/core/graduation.ts +365 -0
  88. package/src/core/index.ts +32 -0
  89. package/src/core/matcher.ts +210 -0
  90. package/src/core/metadata-extractor.ts +203 -0
  91. package/src/core/privacy/filter.ts +179 -0
  92. package/src/core/privacy/index.ts +20 -0
  93. package/src/core/privacy/tag-parser.ts +145 -0
  94. package/src/core/progressive-retriever.ts +415 -0
  95. package/src/core/retriever.ts +235 -0
  96. package/src/core/task/blocker-resolver.ts +325 -0
  97. package/src/core/task/index.ts +9 -0
  98. package/src/core/task/task-matcher.ts +238 -0
  99. package/src/core/task/task-projector.ts +345 -0
  100. package/src/core/task/task-resolver.ts +414 -0
  101. package/src/core/types.ts +841 -0
  102. package/src/core/vector-outbox.ts +295 -0
  103. package/src/core/vector-store.ts +182 -0
  104. package/src/core/vector-worker.ts +488 -0
  105. package/src/core/working-set-store.ts +244 -0
  106. package/src/hooks/post-tool-use.ts +127 -0
  107. package/src/hooks/session-end.ts +78 -0
  108. package/src/hooks/session-start.ts +57 -0
  109. package/src/hooks/stop.ts +78 -0
  110. package/src/hooks/user-prompt-submit.ts +54 -0
  111. package/src/mcp/handlers.ts +212 -0
  112. package/src/mcp/index.ts +47 -0
  113. package/src/mcp/tools.ts +78 -0
  114. package/src/server/api/citations.ts +101 -0
  115. package/src/server/api/events.ts +101 -0
  116. package/src/server/api/index.ts +18 -0
  117. package/src/server/api/search.ts +98 -0
  118. package/src/server/api/sessions.ts +111 -0
  119. package/src/server/api/stats.ts +97 -0
  120. package/src/server/index.ts +91 -0
  121. package/src/services/memory-service.ts +626 -0
  122. package/src/services/session-history-importer.ts +367 -0
  123. package/tests/canonical-key.test.ts +101 -0
  124. package/tests/evidence-aligner.test.ts +152 -0
  125. package/tests/matcher.test.ts +112 -0
  126. package/tsconfig.json +24 -0
  127. package/vitest.config.ts +15 -0
@@ -0,0 +1,34 @@
1
+ # /memory-history
2
+
3
+ View conversation history from memory.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /memory-history [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ - `--session <id>`: Show history for a specific session
14
+ - `--limit <n>`: Limit number of events (default: 20)
15
+ - `--type <type>`: Filter by event type (user_prompt, agent_response, session_summary)
16
+
17
+ ## Examples
18
+
19
+ ```
20
+ /memory-history
21
+ /memory-history --limit 50
22
+ /memory-history --session abc123
23
+ /memory-history --type user_prompt
24
+ ```
25
+
26
+ ## Description
27
+
28
+ Displays stored conversation events from memory. By default shows the most recent events across all sessions. Use filters to narrow down to specific sessions or event types.
29
+
30
+ ## Implementation
31
+
32
+ ```bash
33
+ node dist/cli/index.js history $ARGUMENTS
34
+ ```
@@ -0,0 +1,56 @@
1
+ # /memory-import
2
+
3
+ Import existing Claude Code conversation history into memory.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /memory-import [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ - `--project <path>`: Import from specific project path
14
+ - `--session <file>`: Import a specific session file (JSONL)
15
+ - `--all`: Import all sessions from all projects
16
+ - `--limit <n>`: Limit messages per session
17
+ - `--verbose`: Show detailed progress
18
+
19
+ ## Examples
20
+
21
+ ```
22
+ /memory-import
23
+ /memory-import --project /home/user/myproject
24
+ /memory-import --all
25
+ /memory-import --session ~/.claude/projects/xyz/abc123.jsonl
26
+ /memory-import --all --limit 100 --verbose
27
+ ```
28
+
29
+ ## Description
30
+
31
+ This command imports existing Claude Code conversation history from JSONL session files into the memory store. This allows the plugin to learn from your previous conversations and provide more relevant context in future sessions.
32
+
33
+ ### What gets imported:
34
+
35
+ - **User prompts**: Your questions and requests
36
+ - **Agent responses**: Claude's responses (truncated to 5000 chars)
37
+ - **Session metadata**: Timestamps and session IDs
38
+
39
+ ### Deduplication
40
+
41
+ The importer automatically skips duplicate messages based on content hash, so you can safely run import multiple times without creating duplicate memories.
42
+
43
+ ### Session Files Location
44
+
45
+ Claude Code stores session history in:
46
+ ```
47
+ ~/.claude/projects/<project-hash>/<session-id>.jsonl
48
+ ```
49
+
50
+ Use `/memory-list` to see available sessions before importing.
51
+
52
+ ## Implementation
53
+
54
+ ```bash
55
+ node dist/cli/index.js import $ARGUMENTS
56
+ ```
@@ -0,0 +1,37 @@
1
+ # /memory-list
2
+
3
+ List available Claude Code sessions that can be imported.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /memory-list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ - `--project <path>`: Filter sessions by project path
14
+
15
+ ## Examples
16
+
17
+ ```
18
+ /memory-list
19
+ /memory-list --project /home/user/myproject
20
+ ```
21
+
22
+ ## Description
23
+
24
+ Shows all available Claude Code session files that can be imported into memory. Each session displays:
25
+
26
+ - **Session ID**: Unique identifier for the session
27
+ - **Modified date**: When the session was last updated
28
+ - **File size**: Size of the session file
29
+ - **Path**: Full path to the JSONL file
30
+
31
+ Use this command to identify which sessions you want to import before running `/memory-import`.
32
+
33
+ ## Implementation
34
+
35
+ ```bash
36
+ node dist/cli/index.js list $ARGUMENTS
37
+ ```
@@ -0,0 +1,36 @@
1
+ # /memory-search
2
+
3
+ Search through stored memories using semantic search.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /memory-search <query>
9
+ ```
10
+
11
+ ## Arguments
12
+
13
+ - `query`: The search query to find relevant memories
14
+
15
+ ## Examples
16
+
17
+ ```
18
+ /memory-search how to implement authentication
19
+ /memory-search React component patterns
20
+ /memory-search database optimization
21
+ ```
22
+
23
+ ## Description
24
+
25
+ This command searches through all stored conversation memories using semantic similarity. It returns the most relevant memories that match your query, along with their confidence scores.
26
+
27
+ The search uses AXIOMMIND weighted scoring:
28
+ - **High confidence** (≥0.92): Strong match, likely relevant
29
+ - **Suggested** (≥0.75): May be relevant, review recommended
30
+ - **None** (<0.75): No significant matches found
31
+
32
+ ## Implementation
33
+
34
+ ```bash
35
+ node dist/cli/index.js search "$ARGUMENTS"
36
+ ```
@@ -0,0 +1,34 @@
1
+ # /memory-stats
2
+
3
+ View memory storage statistics.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /memory-stats
9
+ ```
10
+
11
+ ## Description
12
+
13
+ Displays statistics about stored memories including:
14
+
15
+ - Total number of events
16
+ - Number of vector embeddings
17
+ - Memory level distribution (L0-L4)
18
+ - Storage size information
19
+
20
+ ## Memory Levels
21
+
22
+ The graduation pipeline moves memories through these levels:
23
+
24
+ - **L0**: Raw events (EventStore)
25
+ - **L1**: Structured JSON (patterns, summaries)
26
+ - **L2**: Type candidates (validated schemas)
27
+ - **L3**: Verified knowledge (cross-session validated)
28
+ - **L4**: Active/searchable (indexed, readily available)
29
+
30
+ ## Implementation
31
+
32
+ ```bash
33
+ node dist/cli/index.js stats
34
+ ```
@@ -0,0 +1,59 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "matcher": "",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "node dist/hooks/session-start.js"
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "UserPromptSubmit": [
15
+ {
16
+ "matcher": "",
17
+ "hooks": [
18
+ {
19
+ "type": "command",
20
+ "command": "node dist/hooks/user-prompt-submit.js"
21
+ }
22
+ ]
23
+ }
24
+ ],
25
+ "PostToolUse": [
26
+ {
27
+ "matcher": "",
28
+ "hooks": [
29
+ {
30
+ "type": "command",
31
+ "command": "node dist/hooks/post-tool-use.js"
32
+ }
33
+ ]
34
+ }
35
+ ],
36
+ "Stop": [
37
+ {
38
+ "matcher": "",
39
+ "hooks": [
40
+ {
41
+ "type": "command",
42
+ "command": "node dist/hooks/stop.js"
43
+ }
44
+ ]
45
+ }
46
+ ],
47
+ "SessionEnd": [
48
+ {
49
+ "matcher": "",
50
+ "hooks": [
51
+ {
52
+ "type": "command",
53
+ "command": "node dist/hooks/session-end.js"
54
+ }
55
+ ]
56
+ }
57
+ ]
58
+ }
59
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "code-memory",
3
+ "description": "Learn from conversations to provide personalized assistance. The more you use it, the smarter it gets.",
4
+ "version": "1.0.0",
5
+ "author": {
6
+ "name": "Buzzni"
7
+ },
8
+ "homepage": "https://github.com/buzzni/code-memory",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/buzzni/code-memory.git"
12
+ },
13
+ "license": "MIT",
14
+ "engines": {
15
+ "claude-code": ">=1.0.33"
16
+ },
17
+ "keywords": [
18
+ "memory",
19
+ "learning",
20
+ "personalization",
21
+ "context",
22
+ "axiommind"
23
+ ]
24
+ }