|
4 | 4 |
|
5 | 5 | Single Go binary. No Docker, no external databases, no API keys. One command to install, say *"Index this project"* — done. |
6 | 6 |
|
7 | | -Parses source code with [tree-sitter](https://tree-sitter.github.io/tree-sitter/), extracts functions, classes, modules, call relationships, and cross-service HTTP links. Exposes the graph through 12 MCP tools for use with Claude Code, Codex CLI, or any MCP-compatible client. Also includes a **CLI mode** for direct tool invocation from the shell — no MCP client needed. |
| 7 | +Parses source code with [tree-sitter](https://tree-sitter.github.io/tree-sitter/), extracts functions, classes, modules, call relationships, and cross-service HTTP links. Exposes the graph through 14 MCP tools for use with Claude Code, Codex CLI, Cursor, Windsurf, or any MCP-compatible client. Also includes a **CLI mode** for direct tool invocation from the shell — no MCP client needed. |
8 | 8 |
|
9 | 9 | ## Features |
10 | 10 |
|
11 | 11 | - **35 languages**: Python, Go, JavaScript, TypeScript, TSX, Rust, Java, C++, C#, C, PHP, Lua, Scala, Kotlin, Ruby, Bash, Zig, Elixir, Haskell, OCaml, Objective-C, Swift, Dart, Perl, Groovy, Erlang, R, HTML, CSS, SCSS, YAML, TOML, HCL, SQL, Dockerfile |
12 | | -- **One-command install**: `codebase-memory-mcp install` auto-detects Claude Code and Codex CLI, registers the MCP server, and installs task-specific skills |
| 12 | +- **Git diff impact mapping**: `detect_changes` maps uncommitted changes to affected graph symbols + blast radius with risk classification (CRITICAL/HIGH/MEDIUM/LOW) |
| 13 | +- **Risk-classified tracing**: `trace_call_path` with `risk_labels=true` adds impact classification to every node in the call chain |
| 14 | +- **One-command install**: `codebase-memory-mcp install` auto-detects Claude Code, Codex CLI, Cursor, and Windsurf, registers the MCP server, and installs task-specific skills |
13 | 15 | - **Self-update**: `codebase-memory-mcp update` downloads the latest release, verifies checksums, and atomically swaps the binary |
14 | 16 | - **Task-specific skills**: 4 skills (exploring, tracing, quality, reference) that prescribe exact tool sequences — Claude Code automatically uses graph tools instead of defaulting to grep |
15 | 17 | - **Fast**: Sub-millisecond graph queries, incremental reindex 4x faster than full scan, optimized SQLite with LIKE pre-filtering for regex searches |
@@ -84,7 +86,7 @@ Benchmarked on Apple M3 Pro, macOS Darwin 25.3.0: |
84 | 86 | 4. **Restart** Claude Code / Codex CLI |
85 | 87 | 5. Say **"Index this project"** — done. |
86 | 88 |
|
87 | | -The `install` command auto-detects Claude Code and Codex CLI, registers the MCP server, installs 4 task-specific skills, and ensures the binary is on your PATH. Use `--dry-run` to preview without making changes. |
| 89 | +The `install` command auto-detects Claude Code, Codex CLI, Cursor, and Windsurf, registers the MCP server, installs 4 task-specific skills, and ensures the binary is on your PATH. Use `--dry-run` to preview without making changes. |
88 | 90 |
|
89 | 91 | ### Keeping Up to Date |
90 | 92 |
|
@@ -237,7 +239,7 @@ Add the MCP server to your project's `.mcp.json` (per-project, recommended) or ` |
237 | 239 | } |
238 | 240 | ``` |
239 | 241 |
|
240 | | -Restart Claude Code after adding the config. Verify with `/mcp` — you should see `codebase-memory-mcp` listed with 12 tools. |
| 242 | +Restart Claude Code after adding the config. Verify with `/mcp` — you should see `codebase-memory-mcp` listed with 14 tools. |
241 | 243 |
|
242 | 244 | </details> |
243 | 245 |
|
@@ -330,7 +332,8 @@ The CLI uses the same SQLite database as the MCP server (`~/.cache/codebase-memo |
330 | 332 | | Tool | Key Parameters | Description | |
331 | 333 | |------|---------------|-------------| |
332 | 334 | | `search_graph` | `label`, `name_pattern`, `project`, `file_pattern`, `relationship`, `direction`, `min_degree`, `max_degree`, `exclude_entry_points`, `limit` (default 100), `offset` | Structured search with filters. Use `project` to scope to a single repo when multiple are indexed. Supports pagination via `limit`/`offset` — response includes `has_more` and `total`. | |
333 | | -| `trace_call_path` | `function_name` (required), `direction` (inbound/outbound/both), `depth` (1-5, default 3) | BFS traversal from/to a function (exact name match). Returns call chains with signatures, constants, and edge types. Capped at 200 nodes. | |
| 335 | +| `trace_call_path` | `function_name` (required), `direction` (inbound/outbound/both), `depth` (1-5, default 3), `risk_labels` (boolean) | BFS traversal from/to a function (exact name match). Returns call chains with signatures, constants, and edge types. Capped at 200 nodes. With `risk_labels=true`, adds CRITICAL/HIGH/MEDIUM/LOW classification and `impact_summary`. | |
| 336 | +| `detect_changes` | `scope` (unstaged/staged/all/branch), `base_branch`, `depth` (1-5, default 3) | Map git diff to affected graph symbols + blast radius. Returns changed files, changed symbols, and impacted callers with risk classification. Requires git in PATH. | |
334 | 337 | | `query_graph` | `query` (required) | Execute Cypher-like graph queries (read-only). See [Supported Cypher Subset](#supported-cypher-subset) for what's supported. | |
335 | 338 | | `get_graph_schema` | — | Node/edge counts, relationship patterns, sample names. Run this first to understand what's in the graph. | |
336 | 339 | | `get_code_snippet` | `qualified_name` (required) | Read source code for a function by its qualified name (reads from disk). See [Qualified Names](#qualified-names) for the format. | |
@@ -371,6 +374,20 @@ trace_call_path(function_name="ProcessOrder", depth=3, direction="outbound") |
371 | 374 | trace_call_path(function_name="ProcessOrder", depth=2, direction="inbound") |
372 | 375 | ``` |
373 | 376 |
|
| 377 | +### Risk-classified impact analysis |
| 378 | + |
| 379 | +``` |
| 380 | +trace_call_path(function_name="ProcessOrder", direction="inbound", depth=3, risk_labels=true) |
| 381 | +``` |
| 382 | + |
| 383 | +### Detect changes (git diff impact) |
| 384 | + |
| 385 | +``` |
| 386 | +detect_changes() |
| 387 | +detect_changes(scope="staged") |
| 388 | +detect_changes(scope="branch", base_branch="main", depth=3) |
| 389 | +``` |
| 390 | + |
374 | 391 | ### Dead code detection |
375 | 392 |
|
376 | 393 | ``` |
@@ -577,6 +594,7 @@ make install # go install |
577 | 594 | | `trace_call_path` returns 0 results | Exact name match — no fuzzy matching | Use `search_graph(name_pattern=".*PartialName.*")` to discover the exact function name first. | |
578 | 595 | | Queries return results from wrong project | Multiple projects indexed, no filter | Add `project="your-project-name"` to `search_graph`. Use `list_projects` to see indexed project names. | |
579 | 596 | | Graph is missing recently added files | Auto-sync hasn't caught up yet, or project was never indexed | Wait a few seconds for auto-sync, or run `index_repository` manually. Auto-sync polls at 1–60s intervals depending on repo size. | |
| 597 | +| `detect_changes` fails with "git not found" | git not installed or not on PATH | Install git. Required at runtime only for `detect_changes`. | |
580 | 598 | | Binary not found after install | `~/.local/bin` not on PATH | Add to your shell profile: `export PATH="$HOME/.local/bin:$PATH"` | |
581 | 599 | | Cypher query fails with parse error | Unsupported Cypher feature | See [Supported Cypher Subset](#supported-cypher-subset). `WITH`, `COLLECT`, `OPTIONAL MATCH` are not supported. | |
582 | 600 |
|
@@ -606,7 +624,7 @@ internal/ |
606 | 624 | httplink/ Cross-service HTTP route/call-site matching |
607 | 625 | cypher/ Cypher query lexer, parser, planner, executor |
608 | 626 | selfupdate/ GitHub release checking, version comparison, asset download |
609 | | - tools/ MCP tool handlers (12 tools) + CLI dispatch |
| 627 | + tools/ MCP tool handlers (14 tools) + CLI dispatch |
610 | 628 | watcher/ Background auto-sync (mtime+size polling, adaptive intervals) |
611 | 629 | discover/ File discovery with .cgrignore support |
612 | 630 | fqn/ Qualified name computation |
|
0 commit comments