Skip to content

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 19 Mar 20:02
· 316 commits to main since this release

Complete Go to C Rewrite

v0.5.0 is the first release built entirely from C. The entire codebase -- pipeline, store, MCP server, CLI, watcher -- has been rewritten from Go to C, with tree-sitter grammars compiled via CGo replaced by vendored C source for all 64 languages.

What this enables

  • RAM-first pipeline: All indexing runs in memory (LZ4 HC compressed read, in-memory SQLite, single dump at end). Zero disk I/O between bulk load and final write.
  • Fused Aho-Corasick multi-pattern matching: Call resolution uses a single pass over the AST with all patterns loaded simultaneously, replacing sequential per-function grep.
  • C/C++ hybrid LSP resolver: Template substitution, smart pointer chains, overload scoring, lambda/decltype inference, virtual dispatch -- 700+ dedicated tests.
  • mimalloc global allocator: Tracks all allocations (C + C++ via global override), enabling precise memory budgeting per worker.
  • No CGo boundary overhead: All tree-sitter parsing happens in pure C -- no per-file CGo hop.

Performance

Indexing the Linux kernel (28M LOC, 75K files):

  • Full mode: 2.1M nodes, 5m33s (Apple M3 Pro)
  • Fast mode: 1.88M nodes, 1m12s (Apple M3 Pro)

New: Graph Visualization UI

v0.5.0 ships in two variants:

  • standard -- MCP server only (smaller binary)
  • ui -- MCP server + embedded 3D graph visualization

Enable the UI:
```bash
codebase-memory-mcp --ui=true --port=9749
```
Then open http://localhost:9749 to explore your knowledge graph visually. The UI runs as a background thread on localhost, serving embedded frontend assets and proxying queries to a read-only SQLite connection.

Session Auto-Detect + Auto-Index

The MCP server now detects your project root from the working directory on session start. Combined with the config store:

```bash
codebase-memory-mcp config set auto_index true
```

When enabled, new projects are automatically indexed on first MCP connection, and the watcher registers them for ongoing git-based change detection. Previously-indexed projects are always registered with the watcher regardless of this setting.

The config CLI supports: `list`, `get `, `set `, `reset `.

Multi-Agent Install (8 Coding Agents)

`codebase-memory-mcp install` now auto-detects all installed coding agents and configures each one with MCP server entries, instruction files, and pre-tool hooks where supported.

Agent MCP Config Instructions Hooks
Claude Code .claude/.mcp.json 4 Skills (directive pattern) PreToolUse on Grep/Glob/Read
Codex CLI .codex/config.toml .codex/AGENTS.md --
Gemini CLI .gemini/settings.json .gemini/GEMINI.md BeforeTool on grep/read
Zed settings.json (JSONC) -- --
OpenCode opencode.json .config/opencode/AGENTS.md --
Antigravity mcp_config.json .gemini/antigravity/AGENTS.md --
Aider -- CONVENTIONS.md --
KiloCode mcp_settings.json ~/.kilocode/rules/ --

Agentic Behavior Improvements

Agents now actively prefer MCP tools over grep/glob/read for code discovery:

  • Directive skill descriptions achieve ~100% auto-activation (up from ~37% with the old descriptive pattern)
  • PreToolUse / BeforeTool hooks print advisory reminders when agents reach for built-in search tools
  • Keyword-rich MCP tool descriptions improve Claude's Tool Search discovery
  • Instruction files with concrete examples and explicit fallback guidance for all agents
  • Startup update check notifies on first tool call if a newer release is available

These improvements were driven by community reports and contributions:

  • @David34920 -- reported Claude ignoring MCP tools without CLAUDE.md edits (#69)
  • @sonicviz -- detailed analysis of agent tool-selection heuristics (#34)
  • @chitralverma -- reported Gemini CLI defaulting to built-in tools (#19)
  • @noelkurian -- identified Zed config format bug and JSONC parsing issue (#24)
  • @zeval -- OpenCode install PR with config path research (#36)
  • @harshil480 -- KiloCode install PR with config format and test plan (#53)

Fixes

  • Zed: Config now uses args:[""] instead of broken source:"custom" (#24)
  • Zed: Parser handles JSONC (comments + trailing commas) in existing settings.json
  • Install is idempotent: Running install twice produces no duplicates -- marker-based upsert for instructions, key-based upsert for JSON/TOML configs

Cross-Platform Support

Fully tested on all platforms with ASan + LeakSanitizer + UBSan:

Platform Tests Build
macOS arm64 2030 passed OK
macOS amd64 OK OK
Linux arm64 2012 passed OK
Linux amd64 OK OK
Windows amd64 OK OK (CLANG64)

Vendored dependencies (zero system library requirements): sqlite3, mimalloc, tree-sitter runtime, yyjson, zlib, TRE regex (Windows only).

Upgrading

```bash
codebase-memory-mcp update
```

Or fresh install:
```bash
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash
codebase-memory-mcp install -y
```

Existing indexes will be rebuilt automatically -- the C pipeline produces a different (improved) graph format.