Releases: DeusData/codebase-memory-mcp
v0.4.9
Dynamic Memory Limit
Replaces the static 2GB GOMEMLIMIT from v0.4.8 with platform-aware auto-detection.
What changed
- Auto-detect system memory on all platforms:
- Linux:
syscall.Sysinfo - macOS:
sysctl hw.memsize - Windows:
GlobalMemoryStatusEx
- Linux:
- GOMEMLIMIT set to 25% of physical RAM, clamped to [2GB, 8GB]
- Falls back to 4GB if detection fails
- User-configured
mem_limitstill takes priority
Why
The static 2GB default in v0.4.8 could cause excessive GC pressure on machines with plenty of RAM (e.g., a 64GB workstation was limited to 2GB). The new approach adapts to the system: a 16GB laptop gets a 4GB limit, a 32GB+ machine gets 8GB.
GOMEMLIMIT is a soft limit — hitting it causes more frequent garbage collection (slightly slower indexing) but never crashes or refuses allocations.
Examples
| System RAM | GOMEMLIMIT |
|---|---|
| 8 GB | 2 GB (min clamp) |
| 16 GB | 4 GB |
| 32 GB | 8 GB (max clamp) |
| 64 GB | 8 GB (max clamp) |
Upgrade
codebase-memory-mcp update
v0.4.8
Stability & Performance
This release addresses the top-reported stability and performance issues.
SQLite Lock Contention Fix (#52)
- Fix ref counting race condition:
ListProjectsand watcher'spollAllnow useAcquireStorewith proper ref counting, preventing the evictor from closing database connections mid-query — the most likely root cause of server hangs requiring SIGKILL - Stale SHM recovery: After an unclean shutdown (SIGKILL), stale
-shmfiles with orphaned lock state are automatically detected and removed on next startup, preventing deadlocks - Increased busy_timeout: From 5s to 10s for better tolerance on large databases
OOM Prevention (#49, #46)
- Default GOMEMLIMIT: 2GB memory limit applied by default when not user-configured, preventing unbounded memory growth that caused 13GB+ OOM kills
- Reduced mmap_size: From 256MB to 64MB per database — with multiple projects open, the old value could consume excessive virtual memory
CPU Usage Reduction (#45)
- Watcher base interval: Increased from 1s to 5s — ~5x fewer polling ticks
- Poll interval base: Increased from 1s to 5s — reduces
git statusfrequency for change detection - Net effect: significantly lower idle CPU usage, especially with multiple projects
Windows Duplicate Database Fix (#50)
- Drive letter normalization:
D:\projectandd:\projectnow resolve to the same database, preventing duplicate indexing on Windows
Upgrade
codebase-memory-mcp update
After updating, restart your editor/Claude Code session. Stale SHM files from previous crashes will be automatically cleaned up on first launch.
v0.4.7
Highlights
Go LSP Hybrid Type Resolution (experimental)
A new tree-sitter + LSP hybrid engine for Go brings cross-file type-aware call resolution — a first for codebase-memory-mcp. The C-based type resolver (internal/cbm/lsp/) combines tree-sitter AST parsing with a lightweight type registry, scope tracker, and 30,000+ Go stdlib definitions to resolve method calls, interface dispatches, and struct field accesses across package boundaries.
This is a foundational step: the same hybrid approach will be extended to TypeScript, Python, Java, and other languages in upcoming releases.
Key components:
lsp_bridge.go—CrossFileDefstruct andRunGoLSPCrossFileCGo bridgego_lsp_cross.go— cross-file definition index with struct field and interface method enrichmentgo_dep_registry.go— third-party Go module parser for dependency-aware resolutionlsp/go_lsp.c— C type resolver with scope-aware variable tracking, method set resolution, and channel direction inferencelsp/generated/go_stdlib_data.c— 30K+ Go stdlib type/function definitions for out-of-the-box resolution
.gitignore and .cbmignore Support
The indexer now respects .gitignore patterns — generated code, build artifacts, and vendored dependencies that are gitignored are no longer indexed. This is the most requested feature since launch.
- Full .gitignore hierarchy support: nested .gitignore files, .git/info/exclude, negation (!), globstar (**), directory-only patterns (logs/)
- .cbmignore — a new file that stacks additional ignore patterns on top of .gitignore, specific to codebase-memory-mcp indexing
- .cgrignore remains supported for backwards compatibility
- Zero file handle leaks — custom repository matcher reads and closes files immediately, avoiding the upstream library's handle leak (critical for Windows)
Memory Safety Fixes
- Swift scanner heap-buffer-overflow — the vendored Swift tree-sitter scanner called calloc(0, sizeof(ScannerState)), allocating a 0-or-1-byte region, then wrote a uint32_t (4 bytes) to it. Fixed to calloc(1, ...). Detected by the new AddressSanitizer CI job.
- File handle leak on Windows — the go-gitignore library's NewRepository opens .gitignore files but never closes them. Replaced with a custom repoMatcher that uses os.ReadFile + strings.NewReader — zero leaked handles. Fixes Windows CI failures.
New Features
- Persistent config store — ConfigStore backed by SQLite for server settings (auto_index, auto_index_limit, mem_limit). CLI config subcommand for get/set/list/delete.
- Comprehensive --help / -h — all 14 MCP tools documented with parameter schemas and JSON payload examples
- Symlink skipping — symlinked files and directories are no longer indexed, preventing duplicate nodes in the graph
- .worktrees directory skipping — git worktree directories are excluded from indexing (thanks @wassertim, #37)
Bug Fixes
- Cypher LIMIT respected — explicit LIMIT clauses in query_graph Cypher queries are now honored instead of being silently capped (thanks @re-thc, #40)
- 54 golangci-lint issues fixed — errcheck, gocognit, funlen, nilerr, gocritic, gosec, noctx across 10 files
- Expanded hardcoded ignore list — 28 new ecosystem-specific directories added (.next, .nuxt, .terraform, zig-cache, .cargo, bazel-out, etc.). Generic directories (bin, build, out) moved to fast-mode-only to avoid false exclusions in Go/CMake/Maven projects.
Infrastructure
- AddressSanitizer CI job — new test-asan workflow job catches heap-buffer-overflow, use-after-free, and other memory bugs in the C code
- CI dry-run improvements — workflow enhancements for cross-platform testing
Contributors
- @wassertim — .worktrees directory skipping (#37)
- @re-thc — Cypher LIMIT fix (#40)
Full changelog: v0.4.6...v0.4.7
v0.4.6
What's New
Wolfram Language support (59 → 64 languages)
- Wolfram Language (
.wl,.wls) — vendors LumaKernel/tree-sitter-wolfram grammar (ABI 13) - Function extraction:
f[x_] := ...andf[x_] = ...at top-level and nested insideModule/Block - Call extraction:
applynodes with LHS-definition filtering (definition heads are not treated as calls) - Import extraction:
<< "file.wl"(get_top) andNeeds["Package"]` - Caller attribution fix:
compute_func_qnin the unified walker now resolves Wolfram function names fromapply(user_symbol("f"), ...)LHS, so CALLS edges are attributed to the enclosing function rather than the file module
MATLAB call extraction
- Added
function_callandcommandnode types to call extraction - Resolves function references like
inv(A),eig(M),disp helloin.mfiles
Lean 4 call extraction
- Added
applycall nodes with type-position filtering to exclude type annotation false positives
Windows linker fix
- Added
-Wl,--allow-multiple-definitionCGo LDFLAGS for Windows to work around a GCC 15.2.0 / MSYS2 UCRT64 regression
v0.4.5
What's New
4 New Languages (59 → 63)
- MATLAB — function definitions, usages,
.mfile disambiguation via Linguist heuristics - Lean 4 — theorem/definition extraction, imports
- FORM —
#procedure/#callextraction for symbolic computation scripts - Magma — function/procedure/intrinsic definitions,
loadimports, call graph extraction
Magma Graph Quality Fix
- Fixed
load_statementimport extraction — addedfield('path', ...)to grammar so allloadstatements are captured (previously only the first per file) - Verified call extraction works end-to-end: cross-function CALLS edges, recursive calls, trace_call_path
Import Linker Improvement
passImports()now resolves file-path imports (e.g.load "utils.mag",#include "helpers.h") by tryingfqn.ModuleQN()when the raw path doesn't match — general fix benefiting any language with file-path-based imports
Other Changes
- Unified version management via build-injected ldflags
- Fixed Windows file URI path parsing in watcher
- Statically linked Windows binary to fix missing DLL error
- Fixed binary move command in setup script (#16)
v0.4.4
Fix Windows file URI path parsing — watcher was prepending / to drive letter paths (e.g. /C:/Users/...), causing root_gone warning loop. Also unifies version management via build-injected ldflags.
v0.4.2
What's Changed
- Fix binary move command in setup script by @chitralverma in #16
New Contributors
- @chitralverma made their first contribution in #16
Full Changelog: v0.4.1...v0.4.2
v0.4.1
Full Changelog: v0.4.0...v0.4.1
v0.4.0
What's New in v0.4.0
59 Language Support (Tree-Sitter Engine)
- Complete rewrite of extraction engine from Go tree-sitter bindings to vendored C grammars
- 39 new languages: Clojure, F#, Julia, Vim Script, Nix, Common Lisp, Elm, Fortran, CUDA, COBOL, Verilog, Emacs Lisp, JSON, XML, Markdown, Makefile, CMake, Protobuf, GraphQL, Vue, Svelte, Meson, GLSL, INI, and more
- All grammars vendored as C source — zero external dependencies
Pipeline Quality Improvements
- 17 language-specific import parsers (ES modules, Java, Kotlin, Scala, C#, C, C++, PHP, Ruby, Rust, Lua, Elixir, Bash, Zig, Erlang, Haskell, OCaml)
- Language-aware class declaration detection for implements resolution
- Haskell/OCaml/Elixir callee extraction (apply/infix expressions)
- JSX component references as CALLS edges for TSX
- Route test filtering to exclude test fixtures from HTTP links
Extraction Fixes
- Fixed C/C++/CUDA/GLSL function name resolution (off-by-one in declarator traversal)
- Fixed Groovy method names (was returning return type instead of method name)
- Fixed CommonLisp, Makefile, VimScript, Julia function extraction
- Fixed Elm value_declaration name resolution
Infrastructure
- Graceful shutdown with context cancellation throughout pipeline
- Self-update checker and install/uninstall CLI commands
- Cross-platform builds (Linux, macOS, Windows)
- Louvain community detection O(N^2) bottleneck fix
v0.3.4
Performance Fix
Louvain community detection: 297x faster — fixes O(N²) bottleneck that caused indexing timeouts on large codebases.
What changed
- Replaced naive
modularityGain(scanned all nodes per call) with per-communitycommSumTotaccumulators maintained incrementally - Each Louvain iteration is now O(m) instead of O(N²)
Benchmarks (Django, ~30K nodes, ~48K CALLS edges)
| Metric | v0.3.3 | v0.3.4 |
|---|---|---|
| Communities pass | 4m 40s | 0.94s |
| Total indexing | 5m 38s | 24s |
Graph output (nodes, edges, community assignments) is equivalent — only speed changed.