@contextmirror/claude-memory 0.4.1 → 0.4.2

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/README.md CHANGED
@@ -4,45 +4,56 @@ Cross-project memory for Claude Code. Give Claude awareness of ALL your projects
4
4
 
5
5
  ## The Problem
6
6
 
7
- Every Claude Code session starts fresh. Switch to a different project folder and Claude has no idea about your other work. You end up re-explaining your codebase, your patterns, your other projects.
7
+ Every Claude Code session starts fresh. Switch to a different project folder and Claude has no idea about your other work. You end up re-explaining your codebase, your patterns, your architecture.
8
+
9
+ **Without claude-memory:**
10
+ - "I have an API server in another folder that uses the same auth pattern..."
11
+ - "My component library has a Button I want to reuse..."
12
+ - "How did I handle this in my other project again?"
13
+
14
+ Claude doesn't know. It can't see outside the current directory.
8
15
 
9
16
  ## The Solution
10
17
 
11
18
  ```bash
12
19
  npm install -g @contextmirror/claude-memory
13
- claude-memory scan ~/Projects
20
+ claude-memory setup
14
21
  ```
15
22
 
16
- Now Claude knows about all your projects. Ask "What other projects do I have?" or "Generate a CLAUDE.md for this project" and Claude just knows.
17
-
18
- ## Features
19
-
20
- - **Cross-project awareness** - Claude knows about all your projects
21
- - **Staleness detection** - Automatically detects when projects need rescanning
22
- - **Quick scans** - Only rescan projects that have changed
23
- - **Update notifications** - Get notified when new versions are available
24
- - **CLAUDE.md generation** - Auto-generate project documentation
25
- - **MCP integration** - Works seamlessly with Claude Code
23
+ Now Claude knows about all your projects. Ask "What other projects do I have?" or "How do I handle auth in my API?" and Claude just knows.
26
24
 
27
25
  ## Quick Start
28
26
 
29
- ### 1. Install
27
+ ### 1. Install globally
30
28
 
31
29
  ```bash
32
30
  npm install -g @contextmirror/claude-memory
33
31
  ```
34
32
 
35
- ### 2. Scan your projects
33
+ ### 2. Run the setup wizard
36
34
 
37
35
  ```bash
38
- claude-memory scan ~/Projects # or wherever your code lives
36
+ claude-memory setup
39
37
  ```
40
38
 
41
- ### 3. Add MCP to Claude Code
39
+ This will:
40
+ - Scan your projects directory
41
+ - Configure MCP for Claude Code
42
+ - Optionally generate CLAUDE.md files
42
43
 
43
- Create `.mcp.json` in your home directory or project:
44
+ ### 3. Restart Claude Code
44
45
 
45
- ```json
46
+ That's it. Claude now has access to your project memory.
47
+
48
+ ---
49
+
50
+ **Alternative: Manual setup**
51
+
52
+ ```bash
53
+ # Scan your projects
54
+ claude-memory scan ~/Projects
55
+
56
+ # Add MCP to Claude Code (create ~/.mcp.json)
46
57
  {
47
58
  "mcpServers": {
48
59
  "claude-memory": {
@@ -53,16 +64,37 @@ Create `.mcp.json` in your home directory or project:
53
64
  }
54
65
  ```
55
66
 
56
- ### 4. Restart Claude Code
67
+ ## What Can You Ask?
57
68
 
58
- Now Claude has access to your project memory!
69
+ Once set up, try asking Claude:
70
+
71
+ | Question | What Claude Does |
72
+ |----------|------------------|
73
+ | "What projects do I have?" | Lists all your projects with tech stacks |
74
+ | "Tell me about my API server" | Shows project details, branch, recent activity |
75
+ | "Which projects use React?" | Searches across all projects |
76
+ | "Generate a CLAUDE.md for this project" | Creates context documentation |
77
+ | "Is my project data up to date?" | Checks for stale data |
78
+ | "How do I handle auth in my other projects?" | Cross-project pattern lookup |
79
+
80
+ ## Features
81
+
82
+ | Feature | Description |
83
+ |---------|-------------|
84
+ | **Cross-project awareness** | Claude knows about all your projects |
85
+ | **Staleness detection** | Automatically detects when projects need rescanning |
86
+ | **Quick scans** | Only rescan projects that have changed |
87
+ | **Update notifications** | Get notified when new versions are available |
88
+ | **CLAUDE.md generation** | Auto-generate project documentation |
89
+ | **MCP integration** | Works seamlessly with Claude Code |
59
90
 
60
91
  ## Commands
61
92
 
62
93
  | Command | Description |
63
94
  |---------|-------------|
95
+ | `claude-memory setup` | Interactive setup wizard (recommended) |
64
96
  | `claude-memory scan [dir]` | Scan directory for projects |
65
- | `claude-memory scan --quick` | Only rescan stale projects (faster) |
97
+ | `claude-memory scan --quick` | Only rescan stale projects |
66
98
  | `claude-memory scan --check` | Check what's stale without scanning |
67
99
  | `claude-memory list` | List known projects |
68
100
  | `claude-memory show <project>` | Show project details |
@@ -71,14 +103,12 @@ Now Claude has access to your project memory!
71
103
  | `claude-memory exclude <project>` | Exclude project from future scans |
72
104
  | `claude-memory include <project>` | Re-include an excluded project |
73
105
  | `claude-memory mcp` | Start MCP server |
74
- | `claude-memory setup` | Interactive setup wizard |
75
106
 
76
107
  ## Staleness Detection
77
108
 
78
- claude-memory automatically detects when your projects need rescanning:
109
+ claude-memory tracks when your projects change:
79
110
 
80
111
  ```bash
81
- # Check what's stale
82
112
  claude-memory scan --check
83
113
 
84
114
  # Output:
@@ -86,7 +116,7 @@ claude-memory scan --check
86
116
  #
87
117
  # ⚠️ 2 project(s) need updating:
88
118
  # 📝 my-project (New commits since last scan)
89
- # 📄 another-project (Key files modified since last scan)
119
+ # 📄 another-project (Key files modified)
90
120
  #
91
121
  # Run `claude-memory scan --quick` to refresh only stale projects.
92
122
  ```
@@ -98,64 +128,139 @@ claude-memory scan --check
98
128
 
99
129
  ## MCP Tools
100
130
 
101
- When connected, Claude Code gets these tools:
131
+ When connected, Claude Code gets access to these tools:
102
132
 
103
133
  | Tool | Purpose |
104
134
  |------|---------|
105
- | `get_global_context` | Overview of all your projects + staleness info |
135
+ | `get_global_context` | Overview of all projects + staleness info |
106
136
  | `get_project_summary` | Details about a specific project |
107
137
  | `get_project_analysis` | Deep analysis for CLAUDE.md generation |
108
138
  | `search_projects` | Search across all projects |
109
139
  | `record_insight` | Save cross-project patterns |
110
140
  | `search_code` | **[Pro]** Search code across all projects |
111
141
 
112
- ## Update Notifications
142
+ ### Example Interactions
113
143
 
114
- claude-memory checks for updates automatically (once per day, cached). When a new version is available, Claude will see:
144
+ **Ask about all projects:**
145
+ > "What projects do I have?"
115
146
 
116
- ```
117
- ⬆️ Update available: v0.3.0 v0.4.0
147
+ Claude uses `get_global_context` and responds:
148
+ > "You have 5 projects: dashboard-app (React/Next.js), api-server (Node/Express), component-library (React/Storybook), cli-tool (TypeScript), and landing-site (Vite)."
118
149
 
119
- Run to update:
120
- npm update -g @contextmirror/claude-memory
150
+ **Get details about a specific project:**
151
+ > "Tell me about the api-server"
121
152
 
122
- After updating, restart Claude Code to use the new version.
123
- ```
153
+ Claude uses `get_project_summary` and responds:
154
+ > "api-server is a Node.js/Express API with JWT authentication. It's on the `feature/auth` branch with uncommitted changes. Last activity was 2 days ago."
155
+
156
+ **Search across projects:**
157
+ > "Which of my projects use Tailwind?"
158
+
159
+ Claude uses `search_projects` and responds:
160
+ > "2 projects use Tailwind CSS: dashboard-app and landing-site."
161
+
162
+ **Generate documentation:**
163
+ > "Create a CLAUDE.md for this project"
164
+
165
+ Claude uses `get_project_analysis` to gather deep context, then writes a comprehensive CLAUDE.md file.
124
166
 
125
167
  ## How It Works
126
168
 
127
- 1. **Scan** - Finds projects by looking for package.json, Cargo.toml, pyproject.toml, .git
169
+ ```
170
+ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
171
+ │ Project A │ │ Claude Memory │ │ Claude Code │
172
+ │ (React App) │────>│ MCP Server │<────│ │
173
+ ├─────────────────┤ │ │ │ "What projects │
174
+ │ Project B │────>│ ~/.claude- │ │ use React?" │
175
+ │ (API Server) │ │ memory/ │ │ │
176
+ ├─────────────────┤ │ context.json │ └─────────────────┘
177
+ │ Project C │────>│ │
178
+ │ (CLI Tool) │ └─────────────────┘
179
+ └─────────────────┘
180
+ ```
181
+
182
+ 1. **Scan** - Finds projects by looking for package.json, Cargo.toml, pyproject.toml, go.mod, .git
128
183
  2. **Extract** - Pulls name, description, tech stack, git info, CLAUDE.md content
129
184
  3. **Store** - Saves to `~/.claude-memory/context.json`
130
185
  4. **Serve** - MCP server exposes context to Claude Code
131
186
  5. **Detect** - Monitors for staleness on each session start
132
187
 
133
- ## Example Usage
134
-
135
- Once set up, you can ask Claude:
136
-
137
- - "What other projects do I have?"
138
- - "Tell me about my project X"
139
- - "Generate a CLAUDE.md for this project"
140
- - "Which of my projects use React?"
141
- - "Is my project data up to date?"
142
-
143
- Claude will query your project memory and respond with real context.
144
-
145
188
  ## Data Storage
146
189
 
147
- All data stays local:
190
+ All data stays local on your machine:
148
191
 
149
192
  ```
150
193
  ~/.claude-memory/
151
- ├── context.json # Project metadata
152
- ├── context.json.bak # Backup
194
+ ├── context.json # Project metadata (machine-readable)
195
+ ├── context.json.bak # Automatic backup
153
196
  ├── global-context.md # Human-readable overview
154
197
  ├── config.json # User configuration
155
- ├── update-check.json # Update check cache
198
+ ├── update-check.json # Update check cache (1/day)
156
199
  └── license.json # Pro license (if activated)
157
200
  ```
158
201
 
202
+ ## Troubleshooting
203
+
204
+ ### "No projects found"
205
+
206
+ Make sure you're pointing to the right directory:
207
+ ```bash
208
+ # Check what directory you're scanning
209
+ claude-memory scan ~/Projects --check
210
+
211
+ # Common locations to try:
212
+ claude-memory scan ~/Code
213
+ claude-memory scan ~/dev
214
+ claude-memory scan ~/projects
215
+ ```
216
+
217
+ Projects are detected by these files: `package.json`, `Cargo.toml`, `pyproject.toml`, `go.mod`, or `.git`
218
+
219
+ ### "MCP tools not showing up in Claude Code"
220
+
221
+ 1. Make sure `.mcp.json` exists in your home directory or project
222
+ 2. Restart Claude Code completely (not just the conversation)
223
+ 3. Check the MCP config is valid JSON:
224
+ ```json
225
+ {
226
+ "mcpServers": {
227
+ "claude-memory": {
228
+ "command": "claude-memory",
229
+ "args": ["mcp"]
230
+ }
231
+ }
232
+ }
233
+ ```
234
+
235
+ ### "Data seems outdated"
236
+
237
+ Run a quick scan to refresh stale projects:
238
+ ```bash
239
+ claude-memory scan --quick
240
+ ```
241
+
242
+ Or do a full rescan:
243
+ ```bash
244
+ claude-memory scan ~/Projects
245
+ ```
246
+
247
+ ### "Git operations are slow"
248
+
249
+ If you have large repos, git operations may timeout (10s limit). This is normal - the project will still be scanned, just without git info.
250
+
251
+ ### "Want to exclude a project"
252
+
253
+ ```bash
254
+ # Exclude a project from future scans
255
+ claude-memory exclude my-secret-project
256
+
257
+ # See what's excluded
258
+ claude-memory excluded
259
+
260
+ # Re-include it later
261
+ claude-memory include my-secret-project
262
+ ```
263
+
159
264
  ## Pro Features
160
265
 
161
266
  Activate with `claude-memory activate <key>`. Get a license at https://claude-memory.dev
@@ -165,6 +270,34 @@ Activate with `claude-memory activate <key>`. Get a license at https://claude-me
165
270
  | Cross-project code search | Search code patterns across all your projects |
166
271
  | Semantic search | Search by meaning, not just keywords (coming soon) |
167
272
 
273
+ ## Update Notifications
274
+
275
+ claude-memory checks for updates automatically (once per day). When a new version is available:
276
+
277
+ ```
278
+ ⬆️ Update available: v0.4.0 → v0.5.0
279
+
280
+ Run to update:
281
+ npm update -g @contextmirror/claude-memory
282
+ ```
283
+
284
+ ## FAQ
285
+
286
+ **Does this use Claude API tokens?**
287
+ No. claude-memory only stores metadata locally. It uses MCP to expose that data to Claude Code - no additional API calls.
288
+
289
+ **Does it work with Claude Pro/Team?**
290
+ Yes. It works with any Claude Code subscription.
291
+
292
+ **What languages are supported?**
293
+ Any language. Tech stack detection works best for: JavaScript/TypeScript, Python, Rust, Go. Others show as "other" but still work.
294
+
295
+ **How often should I rescan?**
296
+ Run `claude-memory scan --quick` when you've made changes to multiple projects. The `--quick` flag only rescans stale projects.
297
+
298
+ **Is my code uploaded anywhere?**
299
+ No. All data stays in `~/.claude-memory/` on your machine. Nothing is sent to any server.
300
+
168
301
  ## License
169
302
 
170
303
  MIT
package/dist/cli.js CHANGED
@@ -22,7 +22,7 @@ const program = new Command();
22
22
  program
23
23
  .name('claude-memory')
24
24
  .description('Cross-project memory for Claude Code')
25
- .version('0.1.0');
25
+ .version('0.4.2');
26
26
  // Scan command
27
27
  program
28
28
  .command('scan')
@@ -37,7 +37,10 @@ program
37
37
  if (options.check) {
38
38
  const context = loadContext();
39
39
  if (!context) {
40
- console.log('No projects scanned yet. Run: claude-memory scan');
40
+ console.log('No projects scanned yet.\n');
41
+ console.log('Get started:');
42
+ console.log(' claude-memory setup # Interactive wizard (recommended)');
43
+ console.log(' claude-memory scan ~/Projects # Scan a specific directory');
41
44
  return;
42
45
  }
43
46
  const report = detectStaleProjects(context);
@@ -119,7 +122,10 @@ program
119
122
  .action(() => {
120
123
  const context = loadContext();
121
124
  if (!context) {
122
- console.log('No projects scanned yet. Run: claude-memory scan');
125
+ console.log('No projects scanned yet.\n');
126
+ console.log('Get started:');
127
+ console.log(' claude-memory setup # Interactive wizard (recommended)');
128
+ console.log(' claude-memory scan ~/Projects # Scan a specific directory');
123
129
  return;
124
130
  }
125
131
  console.log('🧠 Known Projects\n');
@@ -139,14 +145,27 @@ program
139
145
  .action((projectName) => {
140
146
  const context = loadContext();
141
147
  if (!context) {
142
- console.log('No projects scanned yet. Run: claude-memory scan');
148
+ console.log('No projects scanned yet.\n');
149
+ console.log('Get started:');
150
+ console.log(' claude-memory setup # Interactive wizard (recommended)');
151
+ console.log(' claude-memory scan ~/Projects # Scan a specific directory');
143
152
  return;
144
153
  }
145
154
  const project = context.projects.find((p) => p.name.toLowerCase() === projectName.toLowerCase() || p.path.includes(projectName));
146
155
  if (!project) {
147
- console.log(`Project not found: ${projectName}`);
148
- console.log('\nKnown projects:');
149
- context.projects.forEach((p) => console.log(` - ${p.name}`));
156
+ console.log(`❌ Project not found: "${projectName}"\n`);
157
+ console.log('Did you mean one of these?\n');
158
+ // Show projects sorted by similarity to the query
159
+ const lowerQuery = projectName.toLowerCase();
160
+ const sorted = [...context.projects].sort((a, b) => {
161
+ const aScore = a.name.toLowerCase().includes(lowerQuery) ? 1 : 0;
162
+ const bScore = b.name.toLowerCase().includes(lowerQuery) ? 1 : 0;
163
+ return bScore - aScore;
164
+ });
165
+ sorted.slice(0, 5).forEach((p) => console.log(` ${p.name} (${p.path})`));
166
+ if (context.projects.length > 5) {
167
+ console.log(`\n ... and ${context.projects.length - 5} more. Run 'claude-memory list' to see all.`);
168
+ }
150
169
  return;
151
170
  }
152
171
  console.log(`\n📁 ${project.name}\n`);
@@ -168,7 +187,10 @@ program
168
187
  .action((projectQuery) => {
169
188
  const context = loadContext();
170
189
  if (!context) {
171
- console.log('No projects scanned yet. Run: claude-memory scan');
190
+ console.log('No projects scanned yet.\n');
191
+ console.log('Get started:');
192
+ console.log(' claude-memory setup # Interactive wizard (recommended)');
193
+ console.log(' claude-memory scan ~/Projects # Scan a specific directory');
172
194
  return;
173
195
  }
174
196
  // Find the project
@@ -181,7 +203,8 @@ program
181
203
  console.log(' This project will be skipped in future scans.');
182
204
  return;
183
205
  }
184
- console.log(`Project not found: ${projectQuery}`);
206
+ console.log(`❌ Project not found: "${projectQuery}"\n`);
207
+ console.log('Tip: Use the project name or path. Run "claude-memory list" to see all projects.');
185
208
  return;
186
209
  }
187
210
  addExclusion(project.path);
@@ -198,16 +221,23 @@ program
198
221
  .action((projectQuery) => {
199
222
  const context = loadContext();
200
223
  if (!context) {
201
- console.log('No projects scanned yet. Run: claude-memory scan');
224
+ console.log('No projects scanned yet.\n');
225
+ console.log('Get started:');
226
+ console.log(' claude-memory setup # Interactive wizard (recommended)');
227
+ console.log(' claude-memory scan ~/Projects # Scan a specific directory');
202
228
  return;
203
229
  }
204
230
  const excluded = context.excludedProjects || [];
205
231
  const match = excluded.find(p => p.toLowerCase().includes(projectQuery.toLowerCase()));
206
232
  if (!match) {
207
- console.log(`Project not in exclusion list: ${projectQuery}`);
233
+ console.log(`❌ Project not in exclusion list: "${projectQuery}"\n`);
208
234
  if (excluded.length > 0) {
209
- console.log('\nCurrently excluded:');
210
- excluded.forEach(p => console.log(` - ${p}`));
235
+ console.log('Currently excluded:');
236
+ excluded.forEach(p => console.log(` ${p}`));
237
+ console.log('\nRun "claude-memory excluded" to see all excluded projects.');
238
+ }
239
+ else {
240
+ console.log('No projects are currently excluded.');
211
241
  }
212
242
  return;
213
243
  }
@@ -739,7 +739,7 @@
739
739
  <div class="price">$8 <span>/month</span></div>
740
740
  <ul>
741
741
  <li>Everything in Free</li>
742
- <li class="coming">Team memory sync</li>
742
+ <li>Cross-project code search</li>
743
743
  <li class="coming">Semantic search</li>
744
744
  <li class="coming">Custom CLAUDE.md templates</li>
745
745
  <li class="coming">Priority support</li>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contextmirror/claude-memory",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Cross-project memory for Claude Code - know about all your projects",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",
@@ -19,10 +19,18 @@
19
19
  },
20
20
  "keywords": [
21
21
  "claude",
22
+ "claude-code",
22
23
  "mcp",
24
+ "model-context-protocol",
23
25
  "memory",
24
26
  "context",
25
- "ai"
27
+ "ai",
28
+ "llm",
29
+ "anthropic",
30
+ "cross-project",
31
+ "developer-tools",
32
+ "productivity",
33
+ "code-assistant"
26
34
  ],
27
35
  "author": "Nathan",
28
36
  "license": "MIT",