claude_memory 0.2.0 → 0.3.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.
- checksums.yaml +4 -4
- data/.claude/.mind.mv2.o2N83S +0 -0
- data/.claude/CLAUDE.md +1 -0
- data/.claude/rules/claude_memory.generated.md +28 -9
- data/.claude/settings.local.json +9 -1
- data/.claude/skills/check-memory/SKILL.md +77 -0
- data/.claude/skills/improve/SKILL.md +532 -0
- data/.claude/skills/improve/feature-patterns.md +1221 -0
- data/.claude/skills/quality-update/SKILL.md +229 -0
- data/.claude/skills/quality-update/implementation-guide.md +346 -0
- data/.claude/skills/review-commit/SKILL.md +199 -0
- data/.claude/skills/review-for-quality/SKILL.md +154 -0
- data/.claude/skills/review-for-quality/expert-checklists.md +79 -0
- data/.claude/skills/setup-memory/SKILL.md +168 -0
- data/.claude/skills/study-repo/SKILL.md +307 -0
- data/.claude/skills/study-repo/analysis-template.md +323 -0
- data/.claude/skills/study-repo/focus-examples.md +327 -0
- data/CHANGELOG.md +133 -0
- data/CLAUDE.md +130 -11
- data/README.md +117 -10
- data/db/migrations/001_create_initial_schema.rb +117 -0
- data/db/migrations/002_add_project_scoping.rb +33 -0
- data/db/migrations/003_add_session_metadata.rb +42 -0
- data/db/migrations/004_add_fact_embeddings.rb +20 -0
- data/db/migrations/005_add_incremental_sync.rb +21 -0
- data/db/migrations/006_add_operation_tracking.rb +40 -0
- data/db/migrations/007_add_ingestion_metrics.rb +26 -0
- data/docs/.claude/mind.mv2.lock +0 -0
- data/docs/GETTING_STARTED.md +587 -0
- data/docs/RELEASE_NOTES_v0.2.0.md +0 -1
- data/docs/RUBY_COMMUNITY_POST_v0.2.0.md +0 -2
- data/docs/architecture.md +9 -8
- data/docs/auto_init_design.md +230 -0
- data/docs/improvements.md +557 -731
- data/docs/influence/.gitkeep +13 -0
- data/docs/influence/grepai.md +933 -0
- data/docs/influence/qmd.md +2195 -0
- data/docs/plugin.md +257 -11
- data/docs/quality_review.md +472 -1273
- data/docs/remaining_improvements.md +330 -0
- data/lefthook.yml +13 -0
- data/lib/claude_memory/commands/checks/claude_md_check.rb +41 -0
- data/lib/claude_memory/commands/checks/database_check.rb +120 -0
- data/lib/claude_memory/commands/checks/hooks_check.rb +112 -0
- data/lib/claude_memory/commands/checks/reporter.rb +110 -0
- data/lib/claude_memory/commands/checks/snapshot_check.rb +30 -0
- data/lib/claude_memory/commands/doctor_command.rb +12 -129
- data/lib/claude_memory/commands/help_command.rb +1 -0
- data/lib/claude_memory/commands/hook_command.rb +9 -2
- data/lib/claude_memory/commands/index_command.rb +169 -0
- data/lib/claude_memory/commands/ingest_command.rb +1 -1
- data/lib/claude_memory/commands/init_command.rb +5 -197
- data/lib/claude_memory/commands/initializers/database_ensurer.rb +30 -0
- data/lib/claude_memory/commands/initializers/global_initializer.rb +85 -0
- data/lib/claude_memory/commands/initializers/hooks_configurator.rb +156 -0
- data/lib/claude_memory/commands/initializers/mcp_configurator.rb +56 -0
- data/lib/claude_memory/commands/initializers/memory_instructions_writer.rb +135 -0
- data/lib/claude_memory/commands/initializers/project_initializer.rb +111 -0
- data/lib/claude_memory/commands/recover_command.rb +75 -0
- data/lib/claude_memory/commands/registry.rb +5 -1
- data/lib/claude_memory/commands/stats_command.rb +239 -0
- data/lib/claude_memory/commands/uninstall_command.rb +226 -0
- data/lib/claude_memory/core/batch_loader.rb +32 -0
- data/lib/claude_memory/core/concept_ranker.rb +73 -0
- data/lib/claude_memory/core/embedding_candidate_builder.rb +37 -0
- data/lib/claude_memory/core/fact_collector.rb +51 -0
- data/lib/claude_memory/core/fact_query_builder.rb +154 -0
- data/lib/claude_memory/core/fact_ranker.rb +113 -0
- data/lib/claude_memory/core/result_builder.rb +54 -0
- data/lib/claude_memory/core/result_sorter.rb +25 -0
- data/lib/claude_memory/core/scope_filter.rb +61 -0
- data/lib/claude_memory/core/text_builder.rb +29 -0
- data/lib/claude_memory/embeddings/generator.rb +161 -0
- data/lib/claude_memory/embeddings/similarity.rb +69 -0
- data/lib/claude_memory/hook/handler.rb +4 -3
- data/lib/claude_memory/index/lexical_fts.rb +7 -2
- data/lib/claude_memory/infrastructure/operation_tracker.rb +158 -0
- data/lib/claude_memory/infrastructure/schema_validator.rb +206 -0
- data/lib/claude_memory/ingest/content_sanitizer.rb +6 -7
- data/lib/claude_memory/ingest/ingester.rb +99 -15
- data/lib/claude_memory/ingest/metadata_extractor.rb +57 -0
- data/lib/claude_memory/ingest/tool_extractor.rb +71 -0
- data/lib/claude_memory/mcp/response_formatter.rb +331 -0
- data/lib/claude_memory/mcp/server.rb +19 -0
- data/lib/claude_memory/mcp/setup_status_analyzer.rb +73 -0
- data/lib/claude_memory/mcp/tool_definitions.rb +279 -0
- data/lib/claude_memory/mcp/tool_helpers.rb +80 -0
- data/lib/claude_memory/mcp/tools.rb +330 -320
- data/lib/claude_memory/recall/dual_query_template.rb +63 -0
- data/lib/claude_memory/recall.rb +304 -237
- data/lib/claude_memory/resolve/resolver.rb +52 -49
- data/lib/claude_memory/store/sqlite_store.rb +210 -144
- data/lib/claude_memory/store/store_manager.rb +6 -6
- data/lib/claude_memory/sweep/sweeper.rb +6 -0
- data/lib/claude_memory/version.rb +1 -1
- data/lib/claude_memory.rb +35 -3
- metadata +71 -11
- data/.claude/.mind.mv2.aLCUZd +0 -0
- data/.claude/memory.sqlite3 +0 -0
- data/.mcp.json +0 -11
- /data/docs/{feature_adoption_plan.md → plans/feature_adoption_plan.md} +0 -0
- /data/docs/{feature_adoption_plan_revised.md → plans/feature_adoption_plan_revised.md} +0 -0
- /data/docs/{plan.md → plans/plan.md} +0 -0
- /data/docs/{updated_plan.md → plans/updated_plan.md} +0 -0
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
# Getting Started with ClaudeMemory
|
|
2
|
+
|
|
3
|
+
ClaudeMemory gives Claude Code a persistent, intelligent memory across all your conversations. This guide will walk you through installation, setup, and your first project.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- **Ruby 3.2.0+** installed
|
|
8
|
+
- **Claude Code CLI** installed and working
|
|
9
|
+
- Basic familiarity with command line
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
### Step 1: Install the Gem
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
gem install claude_memory
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Verify installation:
|
|
20
|
+
```bash
|
|
21
|
+
claude-memory --version
|
|
22
|
+
# => claude_memory 0.2.0
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Step 2: Install the Plugin
|
|
26
|
+
|
|
27
|
+
From within Claude Code, add the marketplace and install the plugin:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Add the marketplace (one-time setup)
|
|
31
|
+
/plugin marketplace add codenamev/claude_memory
|
|
32
|
+
|
|
33
|
+
# Install the plugin
|
|
34
|
+
/plugin install claude-memory
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Verify the plugin is loaded:
|
|
38
|
+
```bash
|
|
39
|
+
/plugin
|
|
40
|
+
# Navigate to "Installed" tab - you should see "claude-memory"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Step 3: Initialize Memory
|
|
44
|
+
|
|
45
|
+
Initialize both global and project-specific memory:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# From your project directory
|
|
49
|
+
claude-memory init
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
This creates:
|
|
53
|
+
- **Global database**: `~/.claude/memory.sqlite3` (user-wide knowledge)
|
|
54
|
+
- **Project database**: `.claude/memory.sqlite3` (project-specific facts)
|
|
55
|
+
- Hook configuration for automatic memory updates
|
|
56
|
+
- MCP server setup for Claude to access memory
|
|
57
|
+
|
|
58
|
+
Expected output:
|
|
59
|
+
```
|
|
60
|
+
✓ Created global database at ~/.claude/memory.sqlite3
|
|
61
|
+
✓ Created project database at .claude/memory.sqlite3
|
|
62
|
+
✓ Configured hooks for automatic ingestion
|
|
63
|
+
✓ MCP server ready
|
|
64
|
+
✓ Setup complete!
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Understanding the Dual-Database System
|
|
68
|
+
|
|
69
|
+
ClaudeMemory uses two separate databases to intelligently separate knowledge:
|
|
70
|
+
|
|
71
|
+
### Global Database (`~/.claude/memory.sqlite3`)
|
|
72
|
+
|
|
73
|
+
**Purpose**: User-wide knowledge that applies everywhere
|
|
74
|
+
|
|
75
|
+
**What gets stored:**
|
|
76
|
+
- Your coding preferences and conventions
|
|
77
|
+
- Personal style choices
|
|
78
|
+
- Tool preferences across projects
|
|
79
|
+
- General development patterns you prefer
|
|
80
|
+
|
|
81
|
+
**Examples:**
|
|
82
|
+
- "I prefer 4-space indentation in all my projects"
|
|
83
|
+
- "I always use single quotes for strings in Ruby"
|
|
84
|
+
- "I like descriptive variable names"
|
|
85
|
+
|
|
86
|
+
### Project Database (`.claude/memory.sqlite3`)
|
|
87
|
+
|
|
88
|
+
**Purpose**: Project-specific knowledge
|
|
89
|
+
|
|
90
|
+
**What gets stored:**
|
|
91
|
+
- This project's tech stack
|
|
92
|
+
- Architecture decisions for this codebase
|
|
93
|
+
- Project-specific conventions
|
|
94
|
+
- Team agreements and constraints
|
|
95
|
+
|
|
96
|
+
**Examples:**
|
|
97
|
+
- "This app uses PostgreSQL"
|
|
98
|
+
- "We deploy to Vercel"
|
|
99
|
+
- "This project follows Rails conventions"
|
|
100
|
+
|
|
101
|
+
### How Facts Get Scoped
|
|
102
|
+
|
|
103
|
+
Claude automatically detects scope signals in your conversation:
|
|
104
|
+
|
|
105
|
+
| Signal | Scope | Example |
|
|
106
|
+
|--------|-------|---------|
|
|
107
|
+
| "always", "in all projects" | Global | "I always prefer tabs over spaces" |
|
|
108
|
+
| "my preference", "I prefer" | Global | "My preference is verbose error messages" |
|
|
109
|
+
| Project tech choices | Project | "We're using React for the frontend" |
|
|
110
|
+
| "this app", "this project" | Project | "This app uses JWT authentication" |
|
|
111
|
+
|
|
112
|
+
You can also **manually promote** facts from project to global:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# From command line
|
|
116
|
+
claude-memory promote <fact_id>
|
|
117
|
+
|
|
118
|
+
# Or ask Claude
|
|
119
|
+
"Remember that I prefer descriptive commit messages - make that a global preference"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Setting Up Your First Project
|
|
123
|
+
|
|
124
|
+
### Scenario 1: Fresh Install (New Project)
|
|
125
|
+
|
|
126
|
+
If you just installed ClaudeMemory and are starting a new project:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
cd ~/projects/my-new-app
|
|
130
|
+
claude-memory init
|
|
131
|
+
|
|
132
|
+
# Analyze your project to bootstrap memory
|
|
133
|
+
# (From within Claude Code)
|
|
134
|
+
/claude-memory:analyze
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The analyze skill will read your project files (Gemfile, package.json, etc.) and automatically extract:
|
|
138
|
+
- Languages and frameworks
|
|
139
|
+
- Database systems
|
|
140
|
+
- Build tools
|
|
141
|
+
- Testing frameworks
|
|
142
|
+
|
|
143
|
+
### Scenario 2: Adding Memory to Existing Project
|
|
144
|
+
|
|
145
|
+
If you already have the plugin installed globally and want to add memory to an existing project:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
cd ~/projects/existing-app
|
|
149
|
+
claude-memory init
|
|
150
|
+
|
|
151
|
+
# Just the project database gets created
|
|
152
|
+
# Global database already exists from initial setup
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Then tell Claude about your project naturally:
|
|
156
|
+
```
|
|
157
|
+
You: "This is a Rails 7 app with PostgreSQL, using Sidekiq for background jobs"
|
|
158
|
+
Claude: [works on your task]
|
|
159
|
+
# Facts automatically extracted and stored on session stop
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Scenario 3: Multiple Projects
|
|
163
|
+
|
|
164
|
+
Your global preferences travel with you:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Project A
|
|
168
|
+
cd ~/projects/project-a
|
|
169
|
+
claude-memory init
|
|
170
|
+
# Uses: ~/.claude/memory.sqlite3 + .claude/memory.sqlite3
|
|
171
|
+
|
|
172
|
+
# Project B
|
|
173
|
+
cd ~/projects/project-b
|
|
174
|
+
claude-memory init
|
|
175
|
+
# Uses: ~/.claude/memory.sqlite3 + .claude/memory.sqlite3 (different file!)
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Both projects share your global preferences but have separate project-specific knowledge.
|
|
179
|
+
|
|
180
|
+
## Using ClaudeMemory
|
|
181
|
+
|
|
182
|
+
### Natural Conversation
|
|
183
|
+
|
|
184
|
+
Memory happens automatically. Just talk to Claude normally:
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
You: "I'm building a Rails API with PostgreSQL, deploying to Heroku"
|
|
188
|
+
Claude: "I'll help you set that up..."
|
|
189
|
+
|
|
190
|
+
# Behind the scenes (on session stop):
|
|
191
|
+
# ✓ Transcript ingested
|
|
192
|
+
# ✓ Facts extracted:
|
|
193
|
+
# - uses_framework: rails (project scope)
|
|
194
|
+
# - uses_database: postgresql (project scope)
|
|
195
|
+
# - deployment_platform: heroku (project scope)
|
|
196
|
+
# ✓ Stored in .claude/memory.sqlite3
|
|
197
|
+
# ✓ No user action needed
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**Later, in a new conversation:**
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
You: "Help me add a background job"
|
|
204
|
+
Claude: [calls memory.recall]
|
|
205
|
+
Claude: "Based on my memory, you're using Rails with PostgreSQL on Heroku.
|
|
206
|
+
I recommend using Sidekiq since it integrates well with your stack..."
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Analyzing Your Project
|
|
210
|
+
|
|
211
|
+
Bootstrap memory with project facts:
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
/claude-memory:analyze
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
This reads configuration files and extracts structured knowledge:
|
|
218
|
+
- `Gemfile` → Ruby gems and versions
|
|
219
|
+
- `package.json` → Node dependencies
|
|
220
|
+
- `docker-compose.yml` → Services and databases
|
|
221
|
+
- `.tool-versions` → Language versions
|
|
222
|
+
- And more!
|
|
223
|
+
|
|
224
|
+
### Checking What's Remembered
|
|
225
|
+
|
|
226
|
+
Ask Claude to recall knowledge:
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
You: "What do you remember about this project?"
|
|
230
|
+
Claude: [calls memory.recall]
|
|
231
|
+
Claude: "I remember this project uses:
|
|
232
|
+
- Framework: Ruby on Rails 7.1
|
|
233
|
+
- Database: PostgreSQL 15
|
|
234
|
+
- Deployment: Heroku
|
|
235
|
+
- Background Jobs: Sidekiq"
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Or use CLI commands:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
# Search for facts
|
|
242
|
+
claude-memory recall "database"
|
|
243
|
+
|
|
244
|
+
# Show recent changes
|
|
245
|
+
claude-memory changes
|
|
246
|
+
|
|
247
|
+
# Check for conflicts
|
|
248
|
+
claude-memory conflicts
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Promoting Facts to Global
|
|
252
|
+
|
|
253
|
+
When you want a project preference to apply everywhere:
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
You: "I like using descriptive variable names - remember that for all my projects"
|
|
257
|
+
Claude: [stores with scope_hint: global]
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Or promote manually:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
# List project facts
|
|
264
|
+
claude-memory recall --scope project
|
|
265
|
+
|
|
266
|
+
# Promote by ID
|
|
267
|
+
claude-memory promote 42
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Verification
|
|
271
|
+
|
|
272
|
+
### Run Doctor Command
|
|
273
|
+
|
|
274
|
+
Check system health:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
claude-memory doctor
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Expected output (healthy system):
|
|
281
|
+
```
|
|
282
|
+
ClaudeMemory Doctor Report
|
|
283
|
+
==========================
|
|
284
|
+
|
|
285
|
+
✓ Global database: ~/.claude/memory.sqlite3
|
|
286
|
+
- Schema version: 6
|
|
287
|
+
- Facts: 12
|
|
288
|
+
- Entities: 8
|
|
289
|
+
- Status: Healthy
|
|
290
|
+
|
|
291
|
+
✓ Project database: .claude/memory.sqlite3
|
|
292
|
+
- Schema version: 6
|
|
293
|
+
- Facts: 23
|
|
294
|
+
- Entities: 15
|
|
295
|
+
- Status: Healthy
|
|
296
|
+
|
|
297
|
+
✓ MCP server: Configured
|
|
298
|
+
✓ Hooks: Active (5 hooks registered)
|
|
299
|
+
|
|
300
|
+
All systems operational.
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Check Database Creation
|
|
304
|
+
|
|
305
|
+
Verify files exist:
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# Global database
|
|
309
|
+
ls -lh ~/.claude/memory.sqlite3
|
|
310
|
+
# => -rw-r--r-- 1 user staff 128K Jan 26 10:30 /Users/user/.claude/memory.sqlite3
|
|
311
|
+
|
|
312
|
+
# Project database
|
|
313
|
+
ls -lh .claude/memory.sqlite3
|
|
314
|
+
# => -rw-r--r-- 1 user staff 64K Jan 26 10:35 .claude/memory.sqlite3
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Test Memory Recall
|
|
318
|
+
|
|
319
|
+
Have a conversation with Claude to test:
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
You: "What database am I using?"
|
|
323
|
+
Claude: [calls memory.recall]
|
|
324
|
+
Claude: "According to my memory, this project uses PostgreSQL."
|
|
325
|
+
|
|
326
|
+
# Success! Memory is working.
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## Common Workflows
|
|
330
|
+
|
|
331
|
+
### Workflow 1: Setting Up a New Project (Plugin Already Installed)
|
|
332
|
+
|
|
333
|
+
You've installed the plugin globally, now you're starting a new project:
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
# 1. Create or enter your project directory
|
|
337
|
+
cd ~/projects/new-app
|
|
338
|
+
|
|
339
|
+
# 2. Initialize project memory
|
|
340
|
+
claude-memory init
|
|
341
|
+
|
|
342
|
+
# 3. Start Claude Code and talk about your project
|
|
343
|
+
claude
|
|
344
|
+
|
|
345
|
+
# 4. Let Claude know about your stack
|
|
346
|
+
"This is a Next.js 14 app with TypeScript, using Supabase for the database"
|
|
347
|
+
|
|
348
|
+
# 5. Verify memory
|
|
349
|
+
"What do you remember about this project?"
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### Workflow 2: Moving Between Projects
|
|
353
|
+
|
|
354
|
+
Your global preferences travel with you:
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
# Project A
|
|
358
|
+
cd ~/projects/api-server
|
|
359
|
+
claude
|
|
360
|
+
"Help me add authentication"
|
|
361
|
+
# Claude recalls: api-server uses Express + PostgreSQL
|
|
362
|
+
|
|
363
|
+
# Project B
|
|
364
|
+
cd ~/projects/frontend
|
|
365
|
+
claude
|
|
366
|
+
"Help me add authentication"
|
|
367
|
+
# Claude recalls: frontend uses Next.js + Supabase
|
|
368
|
+
# Claude ALSO recalls: Your global preference for descriptive names
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
### Workflow 3: Sharing Project Memory with Team
|
|
372
|
+
|
|
373
|
+
The project database can be committed to git:
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
# Option 1: Commit project memory (recommended)
|
|
377
|
+
git add .claude/memory.sqlite3
|
|
378
|
+
git commit -m "Add project memory snapshot"
|
|
379
|
+
# Team members get bootstrapped knowledge
|
|
380
|
+
|
|
381
|
+
# Option 2: Ignore project memory (each person builds their own)
|
|
382
|
+
echo ".claude/memory.sqlite3" >> .gitignore
|
|
383
|
+
# Each developer has personal project memory
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
**Recommendation**: Commit project memory for teams to share architectural decisions and tech stack knowledge.
|
|
387
|
+
|
|
388
|
+
### Workflow 4: Privacy Control
|
|
389
|
+
|
|
390
|
+
Exclude sensitive data using privacy tags:
|
|
391
|
+
|
|
392
|
+
```
|
|
393
|
+
You: "My API key is <private>sk-abc123def456</private>"
|
|
394
|
+
Claude: [uses it during session, but won't store it]
|
|
395
|
+
|
|
396
|
+
# What gets stored: "API key configured for external service"
|
|
397
|
+
# What DOESN'T get stored: "sk-abc123def456"
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
Supported tags:
|
|
401
|
+
- `<private>content</private>` - Excludes content from memory
|
|
402
|
+
- `<no-memory>content</no-memory>` - Same as private
|
|
403
|
+
- `<secret>content</secret>` - Same as private
|
|
404
|
+
|
|
405
|
+
## Troubleshooting
|
|
406
|
+
|
|
407
|
+
### MCP Tools Not Appearing
|
|
408
|
+
|
|
409
|
+
**Problem**: Claude doesn't seem to have access to memory tools
|
|
410
|
+
|
|
411
|
+
**Solutions**:
|
|
412
|
+
1. Check `claude-memory` is in PATH:
|
|
413
|
+
```bash
|
|
414
|
+
which claude-memory
|
|
415
|
+
# Should show: /path/to/bin/claude-memory
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
2. Verify plugin installation:
|
|
419
|
+
```bash
|
|
420
|
+
/plugin
|
|
421
|
+
# Navigate to "Installed" tab, look for "claude-memory"
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
3. Check for errors:
|
|
425
|
+
```bash
|
|
426
|
+
/plugin
|
|
427
|
+
# Navigate to "Errors" tab for any issues
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
4. Restart Claude Code:
|
|
431
|
+
```bash
|
|
432
|
+
# Exit and relaunch claude command
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Facts Not Being Stored
|
|
436
|
+
|
|
437
|
+
**Problem**: Claude doesn't remember things from previous conversations
|
|
438
|
+
|
|
439
|
+
**Possible causes**:
|
|
440
|
+
1. **Session didn't stop**: Prompt hooks require the session to actually stop (not just pause)
|
|
441
|
+
- Solution: Exit Claude Code properly with `/exit` or Ctrl+D
|
|
442
|
+
|
|
443
|
+
2. **Hooks not registered**: Check hook configuration
|
|
444
|
+
- Solution: Run `claude-memory init` again to reconfigure hooks
|
|
445
|
+
|
|
446
|
+
3. **Database not created**: Missing database files
|
|
447
|
+
- Solution: Run `claude-memory doctor` to diagnose
|
|
448
|
+
|
|
449
|
+
4. **Extraction failed**: Claude couldn't parse facts
|
|
450
|
+
- Solution: Be explicit: "Remember that we use PostgreSQL"
|
|
451
|
+
|
|
452
|
+
### Database Not Created
|
|
453
|
+
|
|
454
|
+
**Problem**: `.claude/memory.sqlite3` doesn't exist after init
|
|
455
|
+
|
|
456
|
+
**Solutions**:
|
|
457
|
+
1. Check permissions:
|
|
458
|
+
```bash
|
|
459
|
+
ls -la .claude/
|
|
460
|
+
# Should be writable by your user
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
2. Create directory manually:
|
|
464
|
+
```bash
|
|
465
|
+
mkdir -p .claude
|
|
466
|
+
chmod 755 .claude
|
|
467
|
+
claude-memory init
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
3. Check disk space:
|
|
471
|
+
```bash
|
|
472
|
+
df -h .
|
|
473
|
+
# Ensure you have available space
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
### Migration Failures
|
|
477
|
+
|
|
478
|
+
**Problem**: Error messages about schema migration during upgrade
|
|
479
|
+
|
|
480
|
+
**What happens automatically**:
|
|
481
|
+
- Schema migrations run on first database access
|
|
482
|
+
- Migrations are atomic (all-or-nothing)
|
|
483
|
+
- Your data is safe (migrations don't delete data)
|
|
484
|
+
|
|
485
|
+
**Recovery**:
|
|
486
|
+
```bash
|
|
487
|
+
# Check current state
|
|
488
|
+
claude-memory doctor
|
|
489
|
+
|
|
490
|
+
# If database is corrupted, check schema
|
|
491
|
+
claude-memory doctor --verbose
|
|
492
|
+
|
|
493
|
+
# Last resort: reinitialize (THIS WILL ERASE DATA)
|
|
494
|
+
mv .claude/memory.sqlite3 .claude/memory.sqlite3.backup
|
|
495
|
+
claude-memory init
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
### Conflicts Between Facts
|
|
499
|
+
|
|
500
|
+
**Problem**: Claude shows conflicting information
|
|
501
|
+
|
|
502
|
+
**Solution**: Check and resolve conflicts:
|
|
503
|
+
```bash
|
|
504
|
+
# List conflicts
|
|
505
|
+
claude-memory conflicts
|
|
506
|
+
|
|
507
|
+
# Or ask Claude
|
|
508
|
+
"Are there any conflicting facts in memory?"
|
|
509
|
+
|
|
510
|
+
# Resolve by updating facts (Claude will supersede old facts)
|
|
511
|
+
"Actually, we switched from MySQL to PostgreSQL last week"
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
## Advanced Usage
|
|
515
|
+
|
|
516
|
+
### Manual Fact Management
|
|
517
|
+
|
|
518
|
+
```bash
|
|
519
|
+
# Search facts
|
|
520
|
+
claude-memory recall "authentication"
|
|
521
|
+
|
|
522
|
+
# Show detailed provenance
|
|
523
|
+
claude-memory explain <fact_id>
|
|
524
|
+
|
|
525
|
+
# List recent changes
|
|
526
|
+
claude-memory changes --since "2026-01-20"
|
|
527
|
+
|
|
528
|
+
# Run maintenance
|
|
529
|
+
claude-memory sweep
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
### Custom Hook Configuration
|
|
533
|
+
|
|
534
|
+
Modify `.claude/settings.json` to customize when memory updates:
|
|
535
|
+
|
|
536
|
+
```json
|
|
537
|
+
{
|
|
538
|
+
"hooks": {
|
|
539
|
+
"Stop": {
|
|
540
|
+
"command": "claude-memory hook ingest"
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
### Debugging
|
|
547
|
+
|
|
548
|
+
Enable verbose output:
|
|
549
|
+
|
|
550
|
+
```bash
|
|
551
|
+
# See what's happening during ingestion
|
|
552
|
+
claude-memory hook ingest --verbose < ~/.claude/sessions/latest.jsonl
|
|
553
|
+
|
|
554
|
+
# Check database contents
|
|
555
|
+
sqlite3 .claude/memory.sqlite3 "SELECT * FROM facts LIMIT 5;"
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
## Next Steps
|
|
559
|
+
|
|
560
|
+
Now that you're up and running:
|
|
561
|
+
|
|
562
|
+
- 📖 Read [Examples](EXAMPLES.md) for common use cases
|
|
563
|
+
- 🔧 Explore [Plugin Documentation](PLUGIN.md) for advanced configuration
|
|
564
|
+
- 🏗️ Review [Architecture](architecture.md) for technical details
|
|
565
|
+
- 💬 Join [Discussions](https://github.com/codenamev/claude_memory/discussions) to share feedback
|
|
566
|
+
|
|
567
|
+
## Quick Reference
|
|
568
|
+
|
|
569
|
+
| Command | Purpose |
|
|
570
|
+
|---------|---------|
|
|
571
|
+
| `claude-memory init` | Initialize databases and hooks |
|
|
572
|
+
| `claude-memory doctor` | Check system health |
|
|
573
|
+
| `claude-memory recall <query>` | Search for facts |
|
|
574
|
+
| `claude-memory promote <fact_id>` | Make fact global |
|
|
575
|
+
| `claude-memory changes` | Recent updates |
|
|
576
|
+
| `claude-memory conflicts` | Show contradictions |
|
|
577
|
+
| `/claude-memory:analyze` | Bootstrap project knowledge |
|
|
578
|
+
|
|
579
|
+
## Support
|
|
580
|
+
|
|
581
|
+
- 🐛 [Report a bug](https://github.com/codenamev/claude_memory/issues)
|
|
582
|
+
- 💬 [Discussions](https://github.com/codenamev/claude_memory/discussions)
|
|
583
|
+
- 📧 Questions? Open an issue!
|
|
584
|
+
|
|
585
|
+
---
|
|
586
|
+
|
|
587
|
+
**Ready to start?** Jump back to your project and have a conversation with Claude. Memory happens automatically! 🚀
|
|
@@ -172,7 +172,6 @@ None at this time! Please [report bugs](https://github.com/codenamev/claude_memo
|
|
|
172
172
|
- 🐛 [Report a bug](https://github.com/codenamev/claude_memory/issues)
|
|
173
173
|
- 💡 [Request a feature](https://github.com/codenamev/claude_memory/issues)
|
|
174
174
|
- 💬 [Join discussions](https://github.com/codenamev/claude_memory/discussions)
|
|
175
|
-
- 📧 Email: valentino@hanamirb.org
|
|
176
175
|
|
|
177
176
|
---
|
|
178
177
|
|
|
@@ -32,7 +32,6 @@ Thanks for your consideration!
|
|
|
32
32
|
|
|
33
33
|
Valentino Stoll
|
|
34
34
|
https://github.com/codenamev
|
|
35
|
-
valentino@hanamirb.org
|
|
36
35
|
```
|
|
37
36
|
|
|
38
37
|
---
|
|
@@ -451,7 +450,6 @@ Would this be a good fit for an upcoming episode? Happy to discuss the technical
|
|
|
451
450
|
Thanks for your consideration!
|
|
452
451
|
|
|
453
452
|
Valentino Stoll
|
|
454
|
-
valentino@hanamirb.org
|
|
455
453
|
https://github.com/codenamev
|
|
456
454
|
```
|
|
457
455
|
|
data/docs/architecture.md
CHANGED
|
@@ -9,7 +9,7 @@ ClaudeMemory is architected using Domain-Driven Design (DDD) principles with cle
|
|
|
9
9
|
```
|
|
10
10
|
┌─────────────────────────────────────────────────────────────┐
|
|
11
11
|
│ Application Layer │
|
|
12
|
-
│ CLI (Router) → Commands (
|
|
12
|
+
│ CLI (Router) → Commands (20 classes) → Configuration │
|
|
13
13
|
└──────────────────────┬──────────────────────────────────────┘
|
|
14
14
|
│
|
|
15
15
|
┌──────────────────────▼──────────────────────────────────────┐
|
|
@@ -38,8 +38,8 @@ ClaudeMemory is architected using Domain-Driven Design (DDD) principles with cle
|
|
|
38
38
|
**Purpose:** Handle user interaction and command routing
|
|
39
39
|
|
|
40
40
|
**Components:**
|
|
41
|
-
- **CLI** (`cli.rb`): Thin router
|
|
42
|
-
- **Commands** (`commands/`):
|
|
41
|
+
- **CLI** (`cli.rb`): Thin router that dispatches to command classes
|
|
42
|
+
- **Commands** (`commands/`): 20 command classes, each handling one CLI command
|
|
43
43
|
- **Configuration** (`configuration.rb`): Centralized ENV access and path calculation
|
|
44
44
|
|
|
45
45
|
**Key Principles:**
|
|
@@ -151,7 +151,7 @@ end
|
|
|
151
151
|
|
|
152
152
|
#### MCP (`mcp/`)
|
|
153
153
|
- Model Context Protocol server
|
|
154
|
-
- Exposes tools: recall, explain, promote, status,
|
|
154
|
+
- Exposes 18 tools including: recall, explain, promote, status, decisions, conventions, architecture, semantic search, and more
|
|
155
155
|
|
|
156
156
|
#### Hook (`hook/`)
|
|
157
157
|
- Reads JSON from stdin
|
|
@@ -307,14 +307,15 @@ FileSystem (write)
|
|
|
307
307
|
- Scattered ENV access
|
|
308
308
|
|
|
309
309
|
### After Refactoring
|
|
310
|
-
- CLI:
|
|
311
|
-
- Tests:
|
|
310
|
+
- CLI: Thin router (95% reduction from original)
|
|
311
|
+
- Tests: 985 examples (255% increase)
|
|
312
312
|
- Batch queries (3 total)
|
|
313
313
|
- FileSystem abstraction
|
|
314
314
|
- Value objects
|
|
315
315
|
- Centralized Configuration
|
|
316
316
|
- 4 domain models with business logic
|
|
317
|
-
-
|
|
317
|
+
- 20 command classes
|
|
318
|
+
- 18 MCP tools
|
|
318
319
|
|
|
319
320
|
## Future Improvements
|
|
320
321
|
|
|
@@ -350,7 +351,7 @@ FileSystem (write)
|
|
|
350
351
|
|
|
351
352
|
The refactored architecture provides:
|
|
352
353
|
- ✅ Clear separation of concerns
|
|
353
|
-
- ✅ High testability (
|
|
354
|
+
- ✅ High testability (985 tests)
|
|
354
355
|
- ✅ Type safety (value objects)
|
|
355
356
|
- ✅ Null safety (null objects)
|
|
356
357
|
- ✅ Performance (batch queries, in-memory FS)
|