codeimpact 0.1.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.
@@ -0,0 +1,504 @@
1
+ # CodeImpact + Claude Code Setup Guide
2
+
3
+ This guide explains how to configure CodeImpact as an MCP server for [Claude Code](https://code.claude.com/) (Anthropic's CLI tool).
4
+
5
+ ---
6
+
7
+ ## Prerequisites
8
+
9
+ 1. **Node.js 18+** installed
10
+ 2. **Claude Code** installed (`npm install -g @anthropic-ai/claude-code`)
11
+ 3. **CodeImpact** built (`npm run build`)
12
+
13
+ ---
14
+
15
+ ## Quick Setup (Recommended)
16
+
17
+ The easiest and most reliable way to configure CodeImpact for Claude Code is using our automated initialization command.
18
+
19
+ ### Step 1: Initialize CodeImpact
20
+
21
+ Run this command in the root of your project:
22
+
23
+ ```bash
24
+ npx codeimpact init .
25
+ ```
26
+
27
+ This will automatically configure `.mcp.json` in your project with the exact absolute paths and platform-specific commands required for Claude Code to connect smoothly to CodeImpact.
28
+
29
+ ### Step 2: Verify Connection
30
+
31
+ Start Claude Code and check your servers:
32
+
33
+ ```bash
34
+ # Inside Claude Code
35
+ /mcp
36
+ ```
37
+
38
+ You should see:
39
+ ```
40
+ MCP Servers
41
+ codeimpact (stdio)
42
+ Status: connected
43
+ ```
44
+
45
+ ---
46
+
47
+ ## Configuration Methods (Advanced)
48
+
49
+ If you prefer not to use the automated `npx codeimpact init` command, Claude Code provides several ways to configure MCP servers manually.
50
+
51
+ ### Method 1: CLI Commands
52
+
53
+ Claude Code provides CLI commands to manage MCP servers:
54
+
55
+ ```bash
56
+ # Add a server
57
+ claude mcp add --transport stdio codeimpact -- node /absolute/path/to/dist/index.js --project .
58
+
59
+ # List all servers
60
+ claude mcp list
61
+
62
+ # Get server details
63
+ claude mcp get codeimpact
64
+
65
+ # Remove a server
66
+ claude mcp remove codeimpact
67
+ ```
68
+
69
+ **Note:** On Windows natively, you MUST wrap the node execution with `cmd /c` to prevent stdin/stdout hanging issues:
70
+ ```bash
71
+ claude mcp add --transport stdio codeimpact -- cmd /c node C:\absolute\path\to\dist\index.js --project .
72
+ ```
73
+
74
+ ### Method 2: Project Configuration (`.mcp.json`)
75
+
76
+ If you want to create `.mcp.json` in your project root manually:
77
+
78
+ ```json
79
+ {
80
+ "mcpServers": {
81
+ "codeimpact": {
82
+ "type": "stdio",
83
+ "command": "node",
84
+ "args": ["/absolute/path/to/codeimpact/dist/index.js", "--project", "."],
85
+ "env": {}
86
+ }
87
+ }
88
+ }
89
+ ```
90
+
91
+ *For Windows, use `["cmd", "/c", "node", "C:\\absolute\\path\\to\\dist\\index.js", "--project", "."]` in the command and args fields as appropriate depending on your node integration.*
92
+
93
+ ---
94
+
95
+ ## Configuration Scopes
96
+
97
+ | Scope | Storage Location | Use Case |
98
+ |-------|------------------|----------|
99
+ | `local` (default) | `~/.claude.json` | Personal, current project only |
100
+ | `project` | `.mcp.json` | Shared with team via version control |
101
+ | `user` | `~/.claude.json` | Personal, available across all projects |
102
+
103
+ ```bash
104
+ # The automated init command uses Project scope by default
105
+ npx codeimpact init .
106
+ ```
107
+
108
+ ---
109
+
110
+ ## Platform-Specific Setup
111
+
112
+ ### Windows (Native)
113
+
114
+ On native Windows (not WSL), use the `cmd /c` wrapper for proper execution:
115
+
116
+ ```bash
117
+ # Using CLI
118
+ claude mcp add --transport stdio codeimpact -- cmd /c node C:\path\to\codeimpact\dist\index.js --project .
119
+ ```
120
+
121
+ **In `.mcp.json`:**
122
+
123
+ ```json
124
+ {
125
+ "mcpServers": {
126
+ "codeimpact": {
127
+ "type": "stdio",
128
+ "command": "cmd",
129
+ "args": ["/c", "node", "C:\\path\\to\\codeimpact\\dist\\index.js", "--project", "."],
130
+ "env": {}
131
+ }
132
+ }
133
+ }
134
+ ```
135
+
136
+ ### Windows (WSL)
137
+
138
+ WSL works like Linux:
139
+
140
+ ```bash
141
+ claude mcp add --transport stdio codeimpact -- node /path/to/codeimpact/dist/index.js --project .
142
+ ```
143
+
144
+ ### macOS / Linux
145
+
146
+ ```bash
147
+ claude mcp add --transport stdio codeimpact -- node /path/to/codeimpact/dist/index.js --project .
148
+ ```
149
+
150
+ **In `.mcp.json`:**
151
+
152
+ ```json
153
+ {
154
+ "mcpServers": {
155
+ "codeimpact": {
156
+ "type": "stdio",
157
+ "command": "node",
158
+ "args": ["/Users/you/codeimpact/dist/index.js", "--project", "."],
159
+ "env": {}
160
+ }
161
+ }
162
+ }
163
+ ```
164
+
165
+ ---
166
+
167
+ ## After npm Publish
168
+
169
+ Once CodeImpact is published to npm, setup becomes simpler:
170
+
171
+ ### CLI Command
172
+
173
+ ```bash
174
+ # Install globally
175
+ npm install -g codeimpact
176
+
177
+ # Add to Claude Code
178
+ claude mcp add --transport stdio codeimpact -- codeimpact --project .
179
+ ```
180
+
181
+ ### Using npx
182
+
183
+ ```bash
184
+ # Without installation
185
+ claude mcp add --transport stdio codeimpact -- npx -y codeimpact --project .
186
+ ```
187
+
188
+ **Windows (with npx):**
189
+
190
+ ```bash
191
+ claude mcp add --transport stdio codeimpact -- cmd /c npx -y codeimpact --project .
192
+ ```
193
+
194
+ ### Project `.mcp.json`
195
+
196
+ ```json
197
+ {
198
+ "mcpServers": {
199
+ "codeimpact": {
200
+ "type": "stdio",
201
+ "command": "npx",
202
+ "args": ["-y", "codeimpact", "--project", "."],
203
+ "env": {}
204
+ }
205
+ }
206
+ }
207
+ ```
208
+
209
+ ---
210
+
211
+ ## Environment Variables
212
+
213
+ ### CodeImpact Configuration
214
+
215
+ | Variable | Default | Description |
216
+ |----------|---------|-------------|
217
+ | `CODEIMPACT_MAX_TOKENS` | 6000 | Maximum tokens for context assembly |
218
+ | `CODEIMPACT_DEBUG` | false | Enable debug logging |
219
+
220
+ ```bash
221
+ claude mcp add --transport stdio \
222
+ --env CODEIMPACT_MAX_TOKENS=8000 \
223
+ --env CODEIMPACT_DEBUG=true \
224
+ codeimpact -- node dist/index.js --project .
225
+ ```
226
+
227
+ ### Claude Code MCP Settings
228
+
229
+ | Variable | Default | Description |
230
+ |----------|---------|-------------|
231
+ | `MCP_TIMEOUT` | 60000 | Server startup timeout (ms) |
232
+ | `MAX_MCP_OUTPUT_TOKENS` | 25000 | Max tokens from MCP tools |
233
+
234
+ ```bash
235
+ # Start Claude Code with custom MCP settings
236
+ MCP_TIMEOUT=120000 MAX_MCP_OUTPUT_TOKENS=50000 claude
237
+ ```
238
+
239
+ ---
240
+
241
+ ## Available MCP Tools
242
+
243
+ Once connected, Claude Code can use these CodeImpact tools:
244
+
245
+ ### Core Tools
246
+
247
+ | Tool | Description |
248
+ |------|-------------|
249
+ | `get_context` | Get relevant codebase context for a query |
250
+ | `search_codebase` | Semantic search across all files |
251
+ | `record_decision` | Save an architectural decision |
252
+ | `get_file_context` | Get content of a specific file |
253
+ | `get_project_summary` | Overview of project structure |
254
+
255
+ ### Symbol & Dependency Tools
256
+
257
+ | Tool | Description |
258
+ |------|-------------|
259
+ | `get_symbol` | Find functions, classes, types by name |
260
+ | `get_dependencies` | See imports/exports for a file |
261
+ | `get_file_summary` | Get compressed file summary (10x smaller) |
262
+
263
+ ### Living Documentation Tools
264
+
265
+ | Tool | Description |
266
+ |------|-------------|
267
+ | `generate_docs` | Generate documentation for a file or architecture |
268
+ | `get_architecture` | Get project architecture overview |
269
+ | `get_component_doc` | Get detailed documentation for a component |
270
+ | `get_changelog` | Get changelog of recent changes |
271
+ | `validate_docs` | Check for outdated docs |
272
+ | `what_happened` | Query recent project activity |
273
+
274
+ ### Context Health Tools
275
+
276
+ | Tool | Description |
277
+ |------|-------------|
278
+ | `get_context_health` | Check context health and drift score |
279
+ | `trigger_compaction` | Manually trigger context compaction |
280
+ | `mark_critical` | Mark content as critical (never compress) |
281
+
282
+ ### Confidence & Intelligence Tools
283
+
284
+ | Tool | Description |
285
+ |------|-------------|
286
+ | `get_confidence` | Get confidence score for code suggestion |
287
+ | `check_conflicts` | Check if code conflicts with past decisions |
288
+ | `what_changed` | Query what changed in the codebase |
289
+ | `why_broke` | Diagnose why something broke |
290
+ | `suggest_fix` | Get fix suggestions for an error |
291
+
292
+ ### Architecture Tools
293
+
294
+ | Tool | Description |
295
+ |------|-------------|
296
+ | `validate_pattern` | Validate code against established patterns |
297
+ | `suggest_existing` | Find existing functions that match intent |
298
+ | `learn_pattern` | Teach a new pattern to the system |
299
+ | `list_patterns` | List all learned patterns |
300
+
301
+ ### Test Awareness Tools
302
+
303
+ | Tool | Description |
304
+ |------|-------------|
305
+ | `get_related_tests` | Get tests related to a file or function |
306
+ | `check_tests` | Check if a code change would break tests |
307
+ | `suggest_test_update` | Get suggested test updates for a change |
308
+ | `get_test_coverage` | Get test coverage for a file |
309
+
310
+ ---
311
+
312
+ ## Example Usage
313
+
314
+ Once configured, try these prompts in Claude Code:
315
+
316
+ ```
317
+ > Search for authentication code in this project
318
+
319
+ > What architectural decisions have been made?
320
+
321
+ > Show me the project summary
322
+
323
+ > Find the function that handles user login
324
+
325
+ > What files import the database module?
326
+
327
+ > What changed in the last 24 hours?
328
+
329
+ > Why might the login test be failing?
330
+
331
+ > Record a decision: We chose SQLite for local storage because it's embedded and requires no separate server
332
+
333
+ > Get the architecture overview of this project
334
+
335
+ > Check if this code follows our patterns: async function fetchUser(id) { ... }
336
+ ```
337
+
338
+ ---
339
+
340
+ ## Troubleshooting
341
+
342
+ ### "Connection closed" on Windows
343
+
344
+ Ensure you're using the `cmd /c` wrapper:
345
+
346
+ ```bash
347
+ # Wrong
348
+ claude mcp add --transport stdio codeimpact -- node dist/index.js --project .
349
+
350
+ # Correct
351
+ claude mcp add --transport stdio codeimpact -- cmd /c node dist/index.js --project .
352
+ ```
353
+
354
+ ### "Server not found" or "ENOENT"
355
+
356
+ 1. Verify the path to `dist/index.js` is correct and absolute
357
+ 2. Ensure CodeImpact is built: `npm run build`
358
+ 3. Check Node.js is in your PATH
359
+
360
+ ### "MCP server not connected"
361
+
362
+ 1. Run `claude mcp list` to check configuration
363
+ 2. Run `/mcp` inside Claude Code to see status
364
+ 3. Check for errors in the server output
365
+
366
+ ### "Configuration is invalid"
367
+
368
+ Ensure your JSON is valid and `command` is a string (not array):
369
+
370
+ ```json
371
+ // Correct
372
+ {
373
+ "type": "stdio",
374
+ "command": "node",
375
+ "args": ["dist/index.js", "--project", "."]
376
+ }
377
+
378
+ // Wrong
379
+ {
380
+ "type": "stdio",
381
+ "command": ["node", "dist/index.js"]
382
+ }
383
+ ```
384
+
385
+ ### Server Takes Too Long to Start
386
+
387
+ Increase the MCP timeout:
388
+
389
+ ```bash
390
+ MCP_TIMEOUT=120000 claude
391
+ ```
392
+
393
+ Or set in `.mcp.json`:
394
+
395
+ ```json
396
+ {
397
+ "mcpServers": {
398
+ "codeimpact": {
399
+ "type": "stdio",
400
+ "command": "node",
401
+ "args": ["dist/index.js", "--project", "."],
402
+ "env": {},
403
+ "timeout": 120000
404
+ }
405
+ }
406
+ }
407
+ ```
408
+
409
+ ### View Debug Logs
410
+
411
+ ```bash
412
+ # Run Claude Code with debug logging
413
+ claude --log-level DEBUG
414
+ ```
415
+
416
+ ---
417
+
418
+ ## Importing from Claude Desktop
419
+
420
+ If you already have CodeImpact configured in Claude Desktop:
421
+
422
+ ```bash
423
+ # Import all servers from Claude Desktop
424
+ claude mcp add-from-claude-desktop
425
+
426
+ # Select codeimpact from the list
427
+
428
+ # Verify import
429
+ claude mcp list
430
+ ```
431
+
432
+ ---
433
+
434
+ ## Data Storage
435
+
436
+ CodeImpact stores data locally:
437
+
438
+ ```
439
+ ~/.codeimpact/
440
+ ├── registry.json # Project registry
441
+ └── projects/
442
+ └── {project-name}-{hash}/
443
+ ├── codeimpact.db # SQLite database
444
+ └── tier1.json # Working context
445
+ ```
446
+
447
+ ---
448
+
449
+ ## Comparison: Claude Desktop vs Claude Code
450
+
451
+ | Feature | Claude Desktop | Claude Code |
452
+ |---------|----------------|-------------|
453
+ | Config Location | `~/.claude/claude_desktop_config.json` | `~/.claude.json` or `.mcp.json` |
454
+ | Add Server | Manual JSON edit | CLI commands or JSON |
455
+ | Project Scope | No | Yes (`.mcp.json`) |
456
+ | User Scope | Yes | Yes |
457
+ | Local Scope | N/A | Yes (default) |
458
+ | Env Var Expansion | No | Yes (`${VAR}` syntax) |
459
+
460
+ ---
461
+
462
+ ## Links
463
+
464
+ - [Claude Code Documentation](https://code.claude.com/docs/)
465
+ - [Claude Code MCP Guide](https://code.claude.com/docs/en/mcp)
466
+ - [Claude Code Settings](https://code.claude.com/docs/en/settings)
467
+ - [MCP Protocol Specification](https://modelcontextprotocol.io/)
468
+ - [CodeImpact Documentation](./INDEX.md)
469
+
470
+ ---
471
+
472
+ ## Quick Reference
473
+
474
+ ### Minimum Setup
475
+
476
+ ```bash
477
+ # One-liner setup
478
+ claude mcp add --transport stdio codeimpact -- node /path/to/codeimpact/dist/index.js --project .
479
+ ```
480
+
481
+ ### Full `.mcp.json` Example
482
+
483
+ ```json
484
+ {
485
+ "mcpServers": {
486
+ "codeimpact": {
487
+ "type": "stdio",
488
+ "command": "node",
489
+ "args": [
490
+ "/path/to/codeimpact/dist/index.js",
491
+ "--project",
492
+ "."
493
+ ],
494
+ "env": {
495
+ "CODEIMPACT_MAX_TOKENS": "8000"
496
+ }
497
+ }
498
+ }
499
+ }
500
+ ```
501
+
502
+ ---
503
+
504
+ *Last updated: February 2026*
@@ -0,0 +1,188 @@
1
+ # CodeImpact vs Code Impact
2
+
3
+ A comparison between the open-source CodeImpact and the enterprise Code Impact solution.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ | | CodeImpact | Code Impact |
10
+ |---|-------------|-------------|
11
+ | **Target** | Individual developers, small teams | Enterprise teams, large codebases |
12
+ | **License** | MIT (Open Source) | Commercial |
13
+ | **Pricing** | Free | Contact for pricing |
14
+ | **Support** | Community | Priority support |
15
+
16
+ ---
17
+
18
+ ## Feature Comparison
19
+
20
+ ### Code Parsing
21
+
22
+ | Feature | CodeImpact | Code Impact |
23
+ |---------|:-----------:|:-----------:|
24
+ | TypeScript/JavaScript | Regex | Tree-sitter AST |
25
+ | Python | Regex | Tree-sitter AST |
26
+ | Go | - | Tree-sitter AST |
27
+ | Rust | - | Tree-sitter AST |
28
+ | Java | - | Tree-sitter AST |
29
+ | Accurate symbol boundaries | Partial | 100% |
30
+ | Method signatures | Basic | Full |
31
+ | Nested structures | Limited | Full |
32
+
33
+ **Why it matters:** Tree-sitter provides true Abstract Syntax Tree parsing, meaning 100% accurate symbol extraction, proper handling of edge cases, and support for complex nested structures that regex cannot reliably parse.
34
+
35
+ ---
36
+
37
+ ### Code Intelligence
38
+
39
+ | Feature | CodeImpact | Code Impact |
40
+ |---------|:-----------:|:-----------:|
41
+ | Semantic search | Yes | Yes |
42
+ | File indexing | Yes | Yes |
43
+ | Decision recording | Yes | Yes |
44
+ | Pattern library | Yes | Yes |
45
+ | **Dependency graph** | - | Yes |
46
+ | **Impact analysis** | - | Yes |
47
+ | **Circular dependency detection** | - | Yes |
48
+ | **Test coverage mapping** | - | Yes |
49
+ | **Cross-file refactoring insights** | - | Yes |
50
+
51
+ ---
52
+
53
+ ### Integration
54
+
55
+ | Feature | CodeImpact | Code Impact |
56
+ |---------|:-----------:|:-----------:|
57
+ | Claude Desktop | Yes | Yes |
58
+ | Claude Code (CLI) | Yes | Yes |
59
+ | OpenCode | Yes | Yes |
60
+ | Cursor | Yes | Yes |
61
+ | Any MCP Client | Yes | Yes |
62
+ | **HTTP REST API** | - | Yes |
63
+ | **Non-MCP tools** | - | Yes |
64
+ | **Custom integrations** | - | Yes |
65
+
66
+ ---
67
+
68
+ ### API Access
69
+
70
+ **CodeImpact** - MCP protocol only
71
+
72
+ **Code Impact** - MCP + HTTP REST API
73
+
74
+ ```bash
75
+ # Start HTTP server
76
+ codeimpact serve --project /path/to/project --port 3333
77
+ ```
78
+
79
+ | Endpoint | Description |
80
+ |----------|-------------|
81
+ | `GET /status` | Project statistics |
82
+ | `GET /search?q=...` | Semantic code search |
83
+ | `GET /dependencies?file=...` | File dependencies |
84
+ | `GET /impact?file=...` | Impact analysis |
85
+ | `GET /circular` | Circular dependency detection |
86
+ | `GET /decisions` | List architectural decisions |
87
+ | `POST /decisions` | Record a decision |
88
+ | `GET /symbols?file=...` | Get file symbols |
89
+
90
+ ---
91
+
92
+ ## Use Cases
93
+
94
+ ### CodeImpact (Free)
95
+
96
+ Best for:
97
+ - Individual developers
98
+ - Small projects
99
+ - Learning and experimentation
100
+ - Open source projects
101
+ - Basic code intelligence needs
102
+
103
+ ### Code Impact (Enterprise)
104
+
105
+ Best for:
106
+ - Large codebases (100K+ lines)
107
+ - Enterprise teams (5+ developers)
108
+ - Multi-language projects
109
+ - CI/CD integration requirements
110
+ - Custom tooling and integrations
111
+ - Mission-critical refactoring
112
+ - Compliance and audit requirements
113
+
114
+ ---
115
+
116
+ ## Example: Impact Analysis
117
+
118
+ **Scenario:** You're about to modify `src/auth/login.ts`
119
+
120
+ **CodeImpact response:**
121
+ > "I can search for references to this file."
122
+
123
+ **Code Impact response:**
124
+ > "Modifying `src/auth/login.ts` will impact:
125
+ > - 12 files that directly import this module
126
+ > - 34 files transitively affected
127
+ > - 8 test files that cover this code
128
+ > - No circular dependencies detected
129
+ >
130
+ > High-risk changes: `validateCredentials()` is used by 23 downstream files."
131
+
132
+ ---
133
+
134
+ ## Example: Dependency Graph
135
+
136
+ **Code Impact** builds a complete dependency graph of your codebase:
137
+
138
+ ```
139
+ src/auth/login.ts
140
+ ├── imports
141
+ │ ├── src/utils/crypto.ts
142
+ │ ├── src/db/users.ts
143
+ │ └── src/config/auth.ts
144
+ └── imported by
145
+ ├── src/routes/auth.ts
146
+ ├── src/middleware/session.ts
147
+ └── src/controllers/user.ts (transitively)
148
+ ```
149
+
150
+ This enables:
151
+ - "What breaks if I change this?"
152
+ - "What's the safest refactoring order?"
153
+ - "Are there any circular dependencies?"
154
+
155
+ ---
156
+
157
+ ## Getting Started
158
+
159
+ ### CodeImpact (Free)
160
+
161
+ ```bash
162
+ npm install -g codeimpact
163
+ cd your-project
164
+ codeimpact init
165
+ ```
166
+
167
+ ### Code Impact (Enterprise)
168
+
169
+ Contact: abhishek@savakar.com
170
+
171
+ ---
172
+
173
+ ## Summary
174
+
175
+ | Need | Recommendation |
176
+ |------|----------------|
177
+ | Basic code intelligence | CodeImpact |
178
+ | Just getting started with AI coding | CodeImpact |
179
+ | Small personal projects | CodeImpact |
180
+ | Large enterprise codebase | Code Impact |
181
+ | Multi-language projects | Code Impact |
182
+ | CI/CD and custom integrations | Code Impact |
183
+ | Impact analysis before changes | Code Impact |
184
+ | Team collaboration features | Code Impact |
185
+
186
+ ---
187
+
188
+ **Questions?** Contact abhishek@savakar.com