claude-memory-layer 1.0.26 → 1.0.27

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/dist/cli/index.js CHANGED
@@ -8962,7 +8962,7 @@ function getHooksConfig(pluginPath) {
8962
8962
  };
8963
8963
  }
8964
8964
  var program = new Command();
8965
- program.name("claude-memory-layer").description("Claude Code Memory Plugin CLI").version("1.0.26");
8965
+ program.name("claude-memory-layer").description("Claude Code Memory Plugin CLI").version("1.0.27");
8966
8966
  program.command("install").description("Install hooks into Claude Code settings").option("--path <path>", "Custom plugin path (defaults to auto-detect)").action(async (options) => {
8967
8967
  try {
8968
8968
  const pluginPath = options.path || getPluginPath();
package/memory/_index.md CHANGED
@@ -416,3 +416,4 @@ Generated automatically by MarkdownMirror.
416
416
  - memory/tool_observation/uncategorized/2026-03-05.md
417
417
  - memory/user_prompt/uncategorized/2026-02-26.md
418
418
  - memory/user_prompt/uncategorized/2026-03-04.md
419
+ - memory/user_prompt/uncategorized/2026-03-05.md
@@ -45,4 +45,113 @@ return output.trim().length > 800;
45
45
  // 수정: 2000자
46
46
  return output.trim().length > 2000;
47
47
  ```
48
- → 중간 길이 bash 출력 저장 차단. tool_observation 비율 71% → 50% 이하 예상
48
+ → 중간 길이 bash 출력 저장 차단. tool_observation 비율 71% → 50% 이하 예상
49
+ ## 2026-03-04T15:21:48.373Z | cc1d6366-0fa0-4b61-a7d9-472ffb4dd8b7
50
+ - type: agent_response
51
+ - session: 2fe5b2e5-83ea-4778-b09b-5264c550ea86
52
+ 분석 완료했습니다.
53
+
54
+ ---
55
+
56
+ ## 프로젝트 21a039c4 현황 분석
57
+
58
+ ### 프로젝트 특성
59
+ - **종류**: 미팅 앱 (React, AI 요약, cloud sync, MeetingDetailPage)
60
+ - **기간**: 2026-03-04 11:00 ~ 15:19 (어제 하루)
61
+ - **총 이벤트**: 343건 (user_prompt 153 + agent_response 190)
62
+
63
+ ---
64
+
65
+ ### 개선 사항 적용 여부
66
+
67
+ | 지표 | 현재값 | 상태 |
68
+ |------|--------|------|
69
+ | Retrieval Traces | **0건** | ⚠️ |
70
+ | 세션 요약 | **0건** | ⚠️ |
71
+ | Helpfulness 평가 | **0건** | ⚠️ |
72
+ | Tool Observations | **0건** | - |
73
+
74
+ ---
75
+
76
+ ### 원인 진단
77
+
78
+ **개선 사항이 아직 효과가 없는 이유는 코드 문제가 아닙니다.**
79
+
80
+ 1. **데이터가 히스토리 임포트로 생성됨**: 세션 타임스탬프를 보면 `2026-03-04T15:19:15.xxx` 동일한 시각에 수십 개 세션이 동시 생성 → `session-history-importer`로 과거 대화를 일괄 주입한 것. 이 경로는 훅을 거치지 않으므로 trace/summary/helpfulness가 없음.
81
+
82
+ 2. **오늘(2026-03-05) 신규 세션 없음**: 개선된 훅이 아직 이 프로젝트에서 한 번도 실행되지 않음.
83
+
84
+ 3. **실제 실시간 세션**: `0d6e45a4` 하나 (40 events, 어제 11:00~15:19) — 이것도 개선 전 버전으로 기록됨.
85
+
86
+ ---
87
+
88
+ ### 결론
89
+
90
+ 이 프로젝트는 **개선된 훅이 아직 실행되지 않은 상태**입니다. 다음 번 이 프로젝트에서 Claude Code 세션을 시작하면:
91
+ - `session-start` → `backfillMissingSummaries()` 실행 → 히스토리 세션 요약 생성
92
+ - 첫 prompt → trace 기록 (`project_hash = 21a039c4`)
93
+ - session 종료 → helpfulness 평가
94
+
95
+ **shopping_assistant(f4d5c120)처럼 이 프로젝트에서 세션을 한 번 실행해보면 즉시 확인 가능합니다.**
96
+ ## 2026-03-04T15:23:43.625Z | a6cd1c09-8479-4961-8b90-666207c9b2cf
97
+ - type: agent_response
98
+ - session: 2fe5b2e5-83ea-4778-b09b-5264c550ea86
99
+ 모든 수치가 좋아졌습니다. 전체 비교표로 정리합니다.
100
+
101
+ ---
102
+
103
+ ## f4d5c120 개선 효과 최종 현황
104
+
105
+ ### 핵심 지표 추이
106
+
107
+ | 지표 | 최초 | 1차 수정 후 | 2차 수정 후 | 변화 |
108
+ |------|------|------------|------------|------|
109
+ | Retrieval Traces | 1 | 20 | **28** | +2,700% ✅ |
110
+ | project_hash 있는 traces | 0 | 6 | **14** | 신규 ✅ |
111
+ | 세션 요약 | 2 | 12 | **15** | +650% ✅ |
112
+ | Helpfulness 평가 | 0 | 43 | **58** | 신규 ✅ |
113
+ | Helpfulness 점수 범위 | 측정불가 | 0.62~0.68 | **0.51~0.84** | 변별력 ✅ |
114
+ | tool_observation 비율 | **93%** | 71% | **12.7%** | 대폭 개선 ✅ |
115
+
116
+ ---
117
+
118
+ ### Helpfulness 변별력 분석
119
+
120
+ ```
121
+ 0.8+ (매우 도움) │████ │ 5건 avg 3.8 prompts/after
122
+ 0.7~0.8 (도움) │█████ │ 6건 avg 2.5 prompts/after
123
+ 0.6~0.7 (보통) │██████████████████████████ │ 42건 avg 4.3 prompts/after
124
+ 0.5~0.6 (낮음) │████ │ 5건 avg 1.0 prompts/after
125
+ ```
126
+
127
+ **핵심 패턴**: `avg_prompts_after`가 낮은 메모리(0.5~0.6)는 이후 대화가 1.0턴, 높은 메모리(0.8+)는 3.8턴 → **prompts_after가 실제 유용성을 잘 반영**하고 있음
128
+
129
+ ---
130
+
131
+ ### tool_observation 93% → 12.7%
132
+
133
+ 총 1,783 이벤트 중 226개만 저장 → Bash 필터(2000자 임계값, 키워드 필터)가 실제로 노이즈 차단 중
134
+
135
+ ---
136
+
137
+ ### 남은 과제
138
+
139
+ - **0.6~0.7 보통이 72% (42/58)**: retrieval_score 자체가 낮은 것이 근본 원인. Graduation이 진행되면 L1+ 메모리의 점수가 올라가면서 자연 개선 예상
140
+ - **오늘 신규 데이터 없음**: 어제(2026-03-04) 15:15가 마지막. 다음 세션 실행 후 재확인 권장
141
+ ## 2026-03-05T08:00:06.011Z | 6b1b038d-b88b-4908-8232-abd883f79bcf
142
+ - type: agent_response
143
+ - session: 2fe5b2e5-83ea-4778-b09b-5264c550ea86
144
+ 커밋 완료했습니다.
145
+
146
+ ```
147
+ bec871d feat(memory): improve memory utilization based on real usage data (f4d5c120)
148
+ ```
149
+
150
+ **변경 파일 9개, +1005/-5 lines**:
151
+ - `src/core/sqlite-event-store.ts` — helpfulness 알고리즘, getSessionsWithoutSummary
152
+ - `src/hooks/post-tool-use.ts` — Bash 필터 강화 (800→2000자)
153
+ - `src/hooks/session-start.ts` — 세션 요약 백필
154
+ - `src/hooks/stop.ts` — helpfulness 평가 + 요약 생성
155
+ - `src/server/api/utils.ts` — `?projectId=` 파라미터 수용
156
+ - `src/services/memory-service.ts` — generateSessionSummary, backfillMissingSummaries, recordQueryTrace projectHash 수정
157
+ - `specs/memory-utilization-improvements/` — context.md, spec.md, plan.md (신규)
@@ -26,4 +26,8 @@
26
26
  ## 2026-03-04T15:01:18.982Z | c1c31b32-0c38-425e-95a4-1cdbcedbb274
27
27
  - type: tool_observation
28
28
  - session: 2fe5b2e5-83ea-4778-b09b-5264c550ea86
29
- {"toolName":"TaskUpdate","toolInput":{"taskId":"3","status":"completed"},"toolOutput":"{\"success\":true,\"taskId\":\"3\",\"updatedFields\":[\"status\"],\"statusChange\":{\"from\":\"in_progress\",\"to\":\"completed\"}}","durationMs":0,"success":true,"metadata":{"turnId":"e42caf45-de79-4d73-a7bc-59954990b764"}}
29
+ {"toolName":"TaskUpdate","toolInput":{"taskId":"3","status":"completed"},"toolOutput":"{\"success\":true,\"taskId\":\"3\",\"updatedFields\":[\"status\"],\"statusChange\":{\"from\":\"in_progress\",\"to\":\"completed\"}}","durationMs":0,"success":true,"metadata":{"turnId":"e42caf45-de79-4d73-a7bc-59954990b764"}}
30
+ ## 2026-03-04T15:21:18.215Z | 298f71d5-6237-4b5b-abd3-febefafd87d4
31
+ - type: tool_observation
32
+ - session: 2fe5b2e5-83ea-4778-b09b-5264c550ea86
33
+ {"toolName":"Bash","toolInput":{"command":"DB=~/.claude-code/memory/projects/21a039c4/events.sqlite\n\n# 전체 이벤트 수 및 날짜 범위\nsqlite3 $DB \"\nSELECT COUNT(*) as total_events,\n MIN(timestamp) as first_event,\n MAX(timestamp) as last_event\nFROM events;\" && echo \"===\" &&\n\n# 최근 user_prompt 샘플\nsqlite3 $DB \"\nSELECT substr(timestamp,1,16) as ts, substr(content,1,120) as preview\nFROM events WHERE event_type='user_prompt'\nORDER BY timestamp DESC LIMIT 8;\" && echo \"===\" &&\n\n# 세션 현황\nsqlite3 $DB \"\nSELECT session_id, COUNT(*) as cnt, MIN(timestamp) as first, MAX(timestamp) as last\nFROM events GROUP BY session_id ORDER BY last DESC LIMIT 10;\" && echo \"===\" &&\n\n# retrieval_traces 테이블 존재 여부 확인\nsqlite3 $DB \".tables\"","description":"Check project 21a039c4 event range, prompts, and table structure"},"toolOutput":"343|2026-03-04T11:00:33.821Z|2026-03-04T15:19:15.801Z\n===\n2026-03-04T15:19|미팅 상세에서 \"AI 요약\" 이 기본으로 나오게 해주고, cloud sync 된 미팅 같은 경우에는 AI 요약 안에 있는 \"content\" 의 markdown 을 바로 보여주고, 그 안에 있는 created_at 을\n2026-03-04T15:19|[Request interrupted by user]\n2026-03-04T15:19|Download the React DevTools for a better development experience: https://react.dev/link/react-devtools\nMeetingDetailPage\n2026-03-04T15:19|<local-command-stdout>Catch you later!</local-command-stdout>\n2026-03-04T15:19|<command-name>/exit</command-name>\n <command-message>exit</command-message>\n <command-args></comma\n2026-03-04T15:19|<local-command-caveat>Caveat: The messages below were generated by the user while running local commands. DO NOT respond\n2026-03-04T15:19|Access to fetch at 'https://public-api.aplusai.ai/user/v1/refresh/accesstoken' from origin 'http://localhost:5173' has b\n2026-03-04T15:19|This session is being continued from a previous conversation that ran out of context. The summary below covers the earli\n===\n83b358e5-869f-4805-9e48-c529b1bb89a3|2|2026-03-04T15:19:15.800Z|2026-03-04T15:19:15.801Z\n81b58fb0-346f-4353-bcdc-bff531eba7f1|4|2026-03-04T15:19:15.793Z|2026-03-04T15:19:15.798Z\n3cedffeb-6a47-4644-a2ce-a222f4368483|24|2026-03-04T15:19:15.643Z|2026-03-04T15:19:15.668Z\n0d6e45a4-537d-4962-8eca-2941e428be2f|40|2026-03-04T11:00:36.619Z|2026-03-04T15:19:15.461Z\nfaf2be9c-deb3-4968-92f8-09ee57139c4f|2|2026-03-04T11:00:37.155Z|2026-03-04T11:00:37.156Z\nf29ac995-fc38-4b3e-a060-3089f74a90b3|4|2026-03-04T11:00:37.150Z|2026-03-04T11:00:37.152Z\need651d7-1449-4fc3-a584-ac3d1b25b3f0|7|2026-03-04T11:00:37.138Z|2026-03-04T11:00:37.145Z\ne75f6c1f-51fc-4d5c-9820-2cbbcad32a0d|2|2026-03-04T11:00:37.135Z|2026-03-04T11:00:37.136Z\nd8c55a34-a05e-4210-aded-8d8b55fb4340|6|2026-03-04T11:00:37.113Z|2026-03-04T11:00:37.129Z\nafbede76-9fd3-4991-8abd-ace0f059e0f3|11|2026-03-04T11:00:37.076Z|2026-03-04T11:00:37.083Z\n===\nbuild_runs entries memory_helpfulness \nconsolidated_memories event_dedup memory_levels \nconsolidated_rules events pipeline_metrics \ncontinuity_log events_fts projection_offsets \nedges events_fts_config retrieval_traces \nembedding_outbox events_fts_data sessions \nendless_config events_fts_docsize sync_positions \nentities events_fts_idx vector_outbox \nentity_aliases insights working_set","durationMs":0,"success":true,"metadata":{"command":"DB=~/.claude-code/memory/projects/21a039c4/events.sqlite","turnId":"b30da4e6-704d-499f-b6e6-733a5b8d8e7a"}}
@@ -0,0 +1,6 @@
1
+
2
+ ## 2026-03-04T15:20:51.238Z | 7b3f8806-17ab-4a94-9369-a4bf669c2b12
3
+ - type: user_prompt
4
+ - session: 2fe5b2e5-83ea-4778-b09b-5264c550ea86
5
+ project key : 21a039c4 에 대해서 위 개선 사항 적용해서 테스트 해보고 있는 최신
6
+ 데이터 기준으로 잘 활용 되고 있는지 봐줘
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-memory-layer",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "Claude Code plugin that learns from conversations to provide personalized assistance",
5
5
  "main": "dist/index.js",
6
6
  "bin": {