@hir4ta/mneme 0.18.3 → 0.19.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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.ja.md +50 -29
- package/README.md +45 -34
- package/dist/lib/incremental-save.js +562 -0
- package/dist/servers/db-server.js +56 -2
- package/hooks/hooks.json +13 -2
- package/hooks/pre-compact.sh +43 -145
- package/hooks/session-end.sh +59 -460
- package/hooks/stop.sh +80 -0
- package/package.json +4 -1
- package/servers/db-server.ts +71 -2
- package/skills/save/skill.md +16 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mneme",
|
|
3
3
|
"description": "A plugin that provides long-term memory for Claude Code. It automatically saves context lost during auto-compact, offering features for session restoration, recording technical decisions, and learning developer patterns.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.19.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "hir4ta"
|
|
7
7
|
},
|
package/README.ja.md
CHANGED
|
@@ -10,9 +10,9 @@ Claude Codeの長期記憶を実現するプラグイン
|
|
|
10
10
|
## 機能
|
|
11
11
|
|
|
12
12
|
### コア機能
|
|
13
|
-
-
|
|
13
|
+
- **インクリメンタル保存**: 各ターン完了時に差分のみをSQLiteに保存(Node.js、高速)
|
|
14
14
|
- **自動記憶検索**: プロンプトごとに関連する過去のセッション・判断を自動で注入
|
|
15
|
-
- **PreCompact
|
|
15
|
+
- **PreCompact対応**: Auto-Compact前に未保存分をキャッチアップ(コンテキスト95%で発動)
|
|
16
16
|
- **フルデータ抽出**: `/mneme:save` で要約・判断・パターン・ルールを一括保存
|
|
17
17
|
- **記憶参照プランニング**: `/mneme:plan` で過去の知見を活用した設計・計画
|
|
18
18
|
- **セッション再開**: `/mneme:resume` で過去のセッションを再開(チェーン追跡付き)
|
|
@@ -49,6 +49,15 @@ Claude Codeの長期記憶を実現するプラグイン
|
|
|
49
49
|
|
|
50
50
|
### 前提条件
|
|
51
51
|
|
|
52
|
+
> **⚠️ 重要: Node.js 22.5.0 以上が必要です**
|
|
53
|
+
>
|
|
54
|
+
> mnemeは **Node.js 22.5.0** で導入された組み込みの `node:sqlite` モジュールを使用しています。
|
|
55
|
+
> Node.js 20以前のバージョンではダッシュボードが動作しません。
|
|
56
|
+
>
|
|
57
|
+
> バージョン確認: `node --version`
|
|
58
|
+
>
|
|
59
|
+
> Node.js 20 LTSは2026年4月でサポート終了です。Node.js 22以上にアップグレードしてください。
|
|
60
|
+
|
|
52
61
|
- **jq**: フックでJSON処理に使用します
|
|
53
62
|
|
|
54
63
|
```bash
|
|
@@ -110,11 +119,15 @@ Claude Codeを再起動
|
|
|
110
119
|
|
|
111
120
|
## 使い方
|
|
112
121
|
|
|
113
|
-
###
|
|
122
|
+
### インクリメンタル保存
|
|
123
|
+
|
|
124
|
+
**会話ログは各ターン完了時に自動保存**されます(Node.jsでストリーミング処理)。設定不要。
|
|
114
125
|
|
|
115
|
-
|
|
126
|
+
- **Stop hook**: 各アシスタント応答完了時に差分のみを保存
|
|
127
|
+
- **PreCompact hook**: Auto-Compact前に未保存分をキャッチアップ
|
|
128
|
+
- **SessionEnd hook**: 軽量な終了処理のみ(重い処理なし)
|
|
116
129
|
|
|
117
|
-
|
|
130
|
+
**`/mneme:save`を実行しないと、セッション終了時に会話履歴は削除されます**(ゴミデータ防止)。
|
|
118
131
|
|
|
119
132
|
### 自動記憶検索
|
|
120
133
|
|
|
@@ -214,47 +227,55 @@ mnemeはMCPサーバーを提供し、Claude Codeから直接呼び出せる検
|
|
|
214
227
|
|
|
215
228
|
```mermaid
|
|
216
229
|
flowchart TB
|
|
217
|
-
subgraph
|
|
218
|
-
A[
|
|
219
|
-
B --> C[
|
|
220
|
-
C --> D[
|
|
230
|
+
subgraph incremental [インクリメンタル保存]
|
|
231
|
+
A[各ターン] --> B[Stop Hook]
|
|
232
|
+
B --> C[Node.js ストリーミング]
|
|
233
|
+
C --> D[差分のみ保存]
|
|
221
234
|
end
|
|
222
235
|
|
|
223
236
|
subgraph autosearch [自動記憶検索]
|
|
224
|
-
E[ユーザープロンプト] --> F[UserPromptSubmit
|
|
225
|
-
F --> G[sessions/decisions/patterns
|
|
226
|
-
G --> H[
|
|
237
|
+
E[ユーザープロンプト] --> F[UserPromptSubmit Hook]
|
|
238
|
+
F --> G[sessions/decisions/patterns検索]
|
|
239
|
+
G --> H[関連コンテキスト注入]
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
subgraph precompact [PreCompact キャッチアップ]
|
|
243
|
+
I[コンテキスト95%] --> J[PreCompact Hook]
|
|
244
|
+
J --> K[未保存分をキャッチアップ]
|
|
227
245
|
end
|
|
228
246
|
|
|
229
|
-
subgraph
|
|
230
|
-
|
|
231
|
-
|
|
247
|
+
subgraph sessionend [セッション終了]
|
|
248
|
+
L[終了] --> M[SessionEnd Hook]
|
|
249
|
+
M --> N{コミット済み?}
|
|
250
|
+
N -->|Yes| O[interactions保持]
|
|
251
|
+
N -->|No| P[interactions削除]
|
|
232
252
|
end
|
|
233
253
|
|
|
234
|
-
subgraph manual [
|
|
235
|
-
|
|
236
|
-
|
|
254
|
+
subgraph manual [手動アクション]
|
|
255
|
+
Q["mneme:save"] --> R[decisions + patterns + rules抽出]
|
|
256
|
+
R --> S[セッションをコミット済みに]
|
|
257
|
+
T["mneme:plan"] --> U[記憶参照 + タスク分割]
|
|
237
258
|
end
|
|
238
259
|
|
|
239
260
|
subgraph resume [セッション再開]
|
|
240
|
-
|
|
241
|
-
|
|
261
|
+
V["mneme:resume"] --> W[一覧から選択]
|
|
262
|
+
W --> X[コンテキスト復元 + resumedFrom設定]
|
|
242
263
|
end
|
|
243
264
|
|
|
244
265
|
subgraph review [レビュー]
|
|
245
|
-
|
|
246
|
-
|
|
266
|
+
Y["mneme:review"] --> Z[ルールベース指摘]
|
|
267
|
+
Z --> AA[レビュー結果保存]
|
|
247
268
|
end
|
|
248
269
|
|
|
249
270
|
subgraph dashboard [ダッシュボード]
|
|
250
|
-
|
|
251
|
-
|
|
271
|
+
AB["npx @hir4ta/mneme -d"] --> AC[ブラウザで開く]
|
|
272
|
+
AC --> AD[全データ閲覧]
|
|
252
273
|
end
|
|
253
274
|
|
|
254
|
-
D -->
|
|
255
|
-
H -->
|
|
256
|
-
|
|
257
|
-
|
|
275
|
+
D --> Q
|
|
276
|
+
H --> Q
|
|
277
|
+
S --> AB
|
|
278
|
+
AA --> AB
|
|
258
279
|
```
|
|
259
280
|
|
|
260
281
|
## データ保存
|
|
@@ -397,7 +418,7 @@ mnemeは**完全にローカルで動作**し、外部サーバーへのデー
|
|
|
397
418
|
| **外部通信** | なし - curl/fetch/HTTP リクエスト等は一切使用していません |
|
|
398
419
|
| **データ保存** | すべてプロジェクト内の `.mneme/` ディレクトリに保存 |
|
|
399
420
|
| **会話履歴** | `local.db` に保存され、自動的にgitignore(Git共有されません) |
|
|
400
|
-
| **使用ツール** | bash, jq, sqlite3
|
|
421
|
+
| **使用ツール** | bash, Node.js, jq, sqlite3(外部依存なし) |
|
|
401
422
|
| **コード** | オープンソース - すべてのコードは監査可能です |
|
|
402
423
|
|
|
403
424
|
### プライバシー設計
|
package/README.md
CHANGED
|
@@ -10,9 +10,9 @@ Provides automatic session saving, intelligent memory search, and web dashboard
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
12
12
|
### Core Features
|
|
13
|
-
- **
|
|
13
|
+
- **Incremental save**: Save only new interactions on each turn completion (Node.js, fast)
|
|
14
14
|
- **Auto memory search**: Related past sessions/decisions automatically injected on each prompt
|
|
15
|
-
- **
|
|
15
|
+
- **PreCompact support**: Catch up unsaved interactions before Auto-Compact (context 95% full)
|
|
16
16
|
- **Full data extraction**: Save summary, decisions, patterns, and rules with `/mneme:save`
|
|
17
17
|
- **Memory-informed planning**: Design and plan with past knowledge via `/mneme:plan`
|
|
18
18
|
- **Session Resume**: Resume past sessions with `/mneme:resume` (with chain tracking)
|
|
@@ -49,6 +49,15 @@ Provides automatic session saving, intelligent memory search, and web dashboard
|
|
|
49
49
|
|
|
50
50
|
### Prerequisites
|
|
51
51
|
|
|
52
|
+
> **⚠️ IMPORTANT: Node.js >= 22.5.0 Required**
|
|
53
|
+
>
|
|
54
|
+
> mneme uses the built-in `node:sqlite` module, which was introduced in **Node.js 22.5.0**.
|
|
55
|
+
> The dashboard will NOT work on Node.js 20 or earlier versions.
|
|
56
|
+
>
|
|
57
|
+
> Check your version: `node --version`
|
|
58
|
+
>
|
|
59
|
+
> Node.js 20 LTS ends April 2026. Please upgrade to Node.js 22 or later.
|
|
60
|
+
|
|
52
61
|
- **jq**: Used for JSON processing in hooks
|
|
53
62
|
|
|
54
63
|
```bash
|
|
@@ -110,11 +119,15 @@ This will auto-update on Claude Code startup.
|
|
|
110
119
|
|
|
111
120
|
## Usage
|
|
112
121
|
|
|
113
|
-
###
|
|
122
|
+
### Incremental Save
|
|
123
|
+
|
|
124
|
+
**Conversation logs are auto-saved on each turn completion** (Node.js streaming). No configuration needed.
|
|
114
125
|
|
|
115
|
-
|
|
126
|
+
- **Stop hook**: Saves only new interactions on each assistant response completion
|
|
127
|
+
- **PreCompact hook**: Catches up unsaved interactions before Auto-Compact
|
|
128
|
+
- **SessionEnd hook**: Lightweight cleanup only (no heavy processing)
|
|
116
129
|
|
|
117
|
-
**
|
|
130
|
+
**If you don't run `/mneme:save`, conversation history is deleted at session end** (prevents garbage data).
|
|
118
131
|
|
|
119
132
|
### Auto Memory Search
|
|
120
133
|
|
|
@@ -214,10 +227,10 @@ mneme provides MCP servers with search and database tools callable directly from
|
|
|
214
227
|
|
|
215
228
|
```mermaid
|
|
216
229
|
flowchart TB
|
|
217
|
-
subgraph
|
|
218
|
-
A[
|
|
219
|
-
B --> C[
|
|
220
|
-
C --> D[
|
|
230
|
+
subgraph incremental [Incremental Save]
|
|
231
|
+
A[Each Turn] --> B[Stop Hook]
|
|
232
|
+
B --> C[Node.js streaming]
|
|
233
|
+
C --> D[Save only new interactions]
|
|
221
234
|
end
|
|
222
235
|
|
|
223
236
|
subgraph autosearch [Auto Memory Search]
|
|
@@ -226,35 +239,43 @@ flowchart TB
|
|
|
226
239
|
G --> H[Inject relevant context]
|
|
227
240
|
end
|
|
228
241
|
|
|
229
|
-
subgraph
|
|
242
|
+
subgraph precompact [PreCompact Catch-up]
|
|
230
243
|
I[Context 95% Full] --> J[PreCompact Hook]
|
|
231
|
-
J --> K[
|
|
244
|
+
J --> K[Catch up missed interactions]
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
subgraph sessionend [Session End]
|
|
248
|
+
L[Exit] --> M[SessionEnd Hook]
|
|
249
|
+
M --> N{Committed?}
|
|
250
|
+
N -->|Yes| O[Keep interactions]
|
|
251
|
+
N -->|No| P[Delete interactions]
|
|
232
252
|
end
|
|
233
253
|
|
|
234
254
|
subgraph manual [Manual Actions]
|
|
235
|
-
|
|
236
|
-
|
|
255
|
+
Q["mneme:save"] --> R[Extract decisions + patterns + rules]
|
|
256
|
+
R --> S[Mark session committed]
|
|
257
|
+
T["mneme:plan"] --> U[Memory-informed design + tasks]
|
|
237
258
|
end
|
|
238
259
|
|
|
239
260
|
subgraph resume [Session Resume]
|
|
240
|
-
|
|
241
|
-
|
|
261
|
+
V["mneme:resume"] --> W[Select from list]
|
|
262
|
+
W --> X[Restore past context + set resumedFrom]
|
|
242
263
|
end
|
|
243
264
|
|
|
244
265
|
subgraph review [Review]
|
|
245
|
-
|
|
246
|
-
|
|
266
|
+
Y["mneme:review"] --> Z[Rule-based findings]
|
|
267
|
+
Z --> AA[Save review results]
|
|
247
268
|
end
|
|
248
269
|
|
|
249
270
|
subgraph dashboard [Dashboard]
|
|
250
|
-
|
|
251
|
-
|
|
271
|
+
AB["npx @hir4ta/mneme -d"] --> AC[Open in browser]
|
|
272
|
+
AC --> AD[View all data]
|
|
252
273
|
end
|
|
253
274
|
|
|
254
|
-
D -->
|
|
255
|
-
H -->
|
|
256
|
-
|
|
257
|
-
|
|
275
|
+
D --> Q
|
|
276
|
+
H --> Q
|
|
277
|
+
S --> AB
|
|
278
|
+
AA --> AB
|
|
258
279
|
```
|
|
259
280
|
|
|
260
281
|
## Data Storage
|
|
@@ -388,16 +409,6 @@ Tags are selected from `.mneme/tags.json` to prevent notation variations (e.g.,
|
|
|
388
409
|
- **cloud**: serverless, microservices, edge, wasm
|
|
389
410
|
- And more...
|
|
390
411
|
|
|
391
|
-
## Versioning
|
|
392
|
-
|
|
393
|
-
This project follows [Semantic Versioning](https://semver.org/).
|
|
394
|
-
|
|
395
|
-
**⚠️ While in 0.x (pre-1.0), breaking changes may occur between minor versions.**
|
|
396
|
-
|
|
397
|
-
If you encounter issues after an update:
|
|
398
|
-
1. Check the [releases](https://github.com/hir4ta/mneme/releases) for migration notes
|
|
399
|
-
2. Re-initialize with `npx @hir4ta/mneme --init` if needed
|
|
400
|
-
|
|
401
412
|
## Security and Privacy
|
|
402
413
|
|
|
403
414
|
mneme operates **entirely locally** with no data sent to external servers.
|
|
@@ -407,7 +418,7 @@ mneme operates **entirely locally** with no data sent to external servers.
|
|
|
407
418
|
| **External Communication** | None - no curl/fetch/HTTP requests are made |
|
|
408
419
|
| **Data Storage** | All data stored in project's `.mneme/` directory |
|
|
409
420
|
| **Conversation History** | Stored in `local.db`, automatically gitignored (not shared via Git) |
|
|
410
|
-
| **Tools Used** | bash, jq, sqlite3
|
|
421
|
+
| **Tools Used** | bash, Node.js, jq, sqlite3 (no external dependencies) |
|
|
411
422
|
| **Code** | Open source - all code is auditable |
|
|
412
423
|
|
|
413
424
|
### Privacy by Design
|