Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
bb23ea4
mcp: reduce token consumption via RTK-inspired filtering strategies
ahundt Mar 20, 2026
3ee66a3
mcp: add index_dependencies tool + AI grounding infrastructure
ahundt Mar 20, 2026
6417d72
merge: combine token reduction (reduce-token-usage) + reference API i…
ahundt Mar 20, 2026
a6cfc88
mcp: fix summary mode aggregation limit + add pagination hint
ahundt Mar 20, 2026
3518cef
mcp: fix summary mode aggregation limit + add pagination hint
ahundt Mar 20, 2026
701d8a7
Makefile.cbm, test_main.c: remove depindex refs from token-reduction …
ahundt Mar 20, 2026
83b70ed
mcp: config-backed defaults + magic-number-free tool descriptions
ahundt Mar 20, 2026
8cac6c1
Merge branch 'reduce-token-usage' into token-reduction-and-reference-…
ahundt Mar 20, 2026
9619252
Makefile.cbm, test_main.c: restore depindex test suite on merged branch
ahundt Mar 20, 2026
7e9774e
mcp.c: fix 6 issues found in code review
ahundt Mar 20, 2026
4873697
mcp.c: fix 6 issues found in code review
ahundt Mar 20, 2026
e9d92ed
mcp.c: remove include_dependencies schema from token-reduction branch
ahundt Mar 20, 2026
7b76742
mcp.c: clarify code comments for token metadata, pagination, head_tail
ahundt Mar 20, 2026
5448324
mcp.c: clarify code comments for token metadata, pagination, head_tail
ahundt Mar 20, 2026
577a616
mcp.c: add OOM-safe guards to BFS dedup and head_tail malloc
ahundt Mar 20, 2026
e1c8314
mcp.c: add include_dependencies to search_graph tool schema
ahundt Mar 20, 2026
1302de0
mcp.c: OOM-safe guards + notes/ documentation with mermaid diagrams
ahundt Mar 20, 2026
f4a6077
skills: document token reduction params and dependency indexing in al…
ahundt Mar 20, 2026
0287dd8
skills: document token reduction parameters in all 4 SKILL.md files
ahundt Mar 20, 2026
4e164bd
skills: document index_dependencies tool and include_dependencies param
ahundt Mar 20, 2026
99f803b
notes: add feature matrix with composability analysis and mermaid dia…
ahundt Mar 20, 2026
b9a1ad5
depindex: implement dep indexing pipeline, smart project param, searc…
ahundt Mar 21, 2026
909438a
merge reduce-token-usage: resolve SKILL.md conflict
ahundt Mar 21, 2026
40286c3
merge reference-api-indexing: dep indexing + token reduction combined
ahundt Mar 21, 2026
bd09623
mcp: expand_project_param, result tagging, dep auto-reindex in all 3 …
ahundt Mar 21, 2026
c33ea57
merge reference-api-indexing: expand_project_param, result tagging, d…
ahundt Mar 21, 2026
e6f4112
mcp: fix MCP connection hang from stale/corrupt .db files in cache
ahundt Mar 21, 2026
f7059b1
mcp: fix MCP connection hang from stale/corrupt .db files in cache
ahundt Mar 21, 2026
5b5540b
mcp: close remaining gaps — trace/snippet source tagging, cross-edges
ahundt Mar 22, 2026
04373e5
mcp: close remaining gaps — trace/snippet source tagging, cross-edges
ahundt Mar 22, 2026
e53b3ae
tests: add trace/snippet source tagging and cross-edges null safety t…
ahundt Mar 22, 2026
bdc25e2
pagerank: add PageRank node ranking + LinkRank edge ranking (Phase 8)
ahundt Mar 22, 2026
a1b9686
merge pagerank-ranking: add PageRank node + LinkRank edge ranking
ahundt Mar 22, 2026
7d4c862
mcp: apply Phase 8.5 refinements to merged branch
ahundt Mar 22, 2026
9c38e54
mcp: Phase 9 API consolidation — 15 tools to 3 streamlined + config-b…
ahundt Mar 22, 2026
963f664
mcp: fix gaps — config-backed PageRank callers, Phase 9 test suite (9…
ahundt Mar 22, 2026
93a5e9e
mcp: progressive disclosure + env var override + session_project in a…
ahundt Mar 22, 2026
f0677ee
mcp: auto-index on first use + auto-context injection + use-after-fre…
ahundt Mar 22, 2026
4e1604d
mcp: add MCP resources (resources/list + resources/read) with fallbac…
ahundt Mar 23, 2026
76eff58
mcp: fix 3 MCP resources spec compliance issues
ahundt Mar 23, 2026
a77b557
mcp: fix 18 vague error messages + add 16 behavioral/spec compliance …
ahundt Mar 23, 2026
1f1af3e
mcp: cross-reference tools ↔ resources in descriptions for AI discove…
ahundt Mar 23, 2026
eb57270
mcp: fix resources/read returning empty {} — orphan content_obj never…
ahundt Mar 23, 2026
fcb5b09
mcp: fix resource error double-wrapping + add 6 JSON-RPC structure e2…
ahundt Mar 23, 2026
cf6749d
mcp: fix 3 dep search bugs found by binary dogfooding
ahundt Mar 23, 2026
95f4f5b
mcp: fix 4 dep search bugs + add 5 TDD regression tests
ahundt Mar 23, 2026
a96b341
tests: fix test collision — use unique DB name + cleanup in dep_searc…
ahundt Mar 23, 2026
54eb5c0
mcp: fix _hidden_tools inputSchema string→object — unblocks Claude Co…
ahundt Mar 23, 2026
1b9a658
mcp: fix cross-project search prefix collision in DB selection
ahundt Mar 23, 2026
90b0169
tests: add 8 prefix collision regression tests for cross-project DB s…
ahundt Mar 23, 2026
7fe2ff2
mcp: fix get_code returning ambiguous with 1 match + cold-start proje…
ahundt Mar 23, 2026
a97632a
Makefile.cbm: add integrated codesign + install target for macOS 25+
ahundt Mar 23, 2026
6807e1c
watcher: register all session-accessed projects for auto-reindex
ahundt Mar 23, 2026
80f5ea1
mcp: fix 6 bugs + token optimization + empty DB reindex + 4 TDD tests
ahundt Mar 23, 2026
85872b0
discover: skip vendored/third-party dirs in all modes, not just FAST
ahundt Mar 23, 2026
9adf309
mcp: add exclude param, config-driven key_functions, auto_index defau…
ahundt Mar 23, 2026
85e9c2c
cli: add config registry with 25 keys, env var overrides, grouped help
ahundt Mar 23, 2026
d686d42
fix: SIGBUS crash in auto-index background thread (stack overflow)
ahundt Mar 23, 2026
96c26ea
pagerank: MEMBER_OF reverse edges + tuned edge weights
ahundt Mar 23, 2026
10d444d
mcp,store,tests: wire 5 search_graph params + trace edge_types that w…
ahundt Mar 25, 2026
7e3ca48
mcp: rewrite tool description strings for clarity, completeness, and …
ahundt Mar 25, 2026
ffecf58
mcp.json: use sh -c exec \$HOME/... for cross-machine portability
ahundt Mar 25, 2026
8328201
fix(leaks,depindex,mcp): fix 206 heap leaks, expand ecosystem detecti…
ahundt Mar 26, 2026
16cfce6
docs: add memory leak test instructions to CLAUDE.md and CONTRIBUTING.md
ahundt Mar 26, 2026
32a3820
fix(mcp,store,pagerank,pipeline): 18 bugs fixed, DF-1 degree precompu…
ahundt Mar 26, 2026
b1d3de1
chore: add .clangd config, gitignore runtime artifacts
ahundt Mar 26, 2026
e0bf6c5
fix(mcp): re-apply Phase 3 DRY resolve_project_store + Phase 8 IX-1/2…
ahundt Mar 26, 2026
a2b04d1
docs(mcp): update streamlined tool + resource descriptions for accuracy
ahundt Mar 26, 2026
73bb024
feat(config,ranking): parameterize limits, enrich config docs, add au…
ahundt Mar 26, 2026
0ba7c23
autotune.py: fix PageRank recompute, persistent MCP session, JSON res…
ahundt Mar 26, 2026
21d8069
autotune.py: set DEFAULTS to best experiment results (calls_boost_exc…
ahundt Mar 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# clangd configuration for codebase-memory-mcp
#
# Mirrors the include paths and defines from Makefile.cbm CFLAGS_COMMON so
# clangd can resolve all headers without needing compile_commands.json.
# Paths are relative to the project root (where this file lives).
#
# Works with both clang (macOS/Linux) and gcc — clangd uses these flags
# directly regardless of which compiler is selected for the build.

CompileFlags:
Add:
- -std=c11
- -D_DEFAULT_SOURCE
# Project source headers
- -Isrc
# Vendored libraries: yyjson, xxhash, sqlite3 wrappers
- -Ivendored
- -Ivendored/sqlite3
- -Ivendored/mimalloc/include
# Internal cbm extraction layer and tree-sitter runtime
- -Iinternal/cbm
- -Iinternal/cbm/vendored/ts_runtime/include
# Remove flags clangd cannot handle (sanitizer, link flags)
Remove:
- -fsanitize=*
- -fno-omit-frame-pointer
- -lstdc++
- -lpthread
- -lm
- -lz

Diagnostics:
# Suppress false-positive "implicit declaration" warnings caused by
# clangd analysing files in isolation without the full TU context.
Suppress:
- pp_file_not_found
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ coverage.txt
.DS_Store
Thumbs.db

# Git worktrees (created by Claude Code subagents)
.worktrees/

# Runtime/session artifacts
session_project
project
project|params.project
conductor/
with

# Database files (local cache)
*.db
*.db-wal
Expand All @@ -33,6 +43,7 @@ Thumbs.db
# Local project memory (Claude Code auto-memory)
memory/
reference/
.claude/

# Build artifacts
build/
Expand All @@ -42,3 +53,4 @@ graph-ui/dist/
# Generated reports
BENCHMARK_REPORT.md
TEST_PLAN.md
scripts/autotune_results.json
4 changes: 2 additions & 2 deletions .mcp.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"mcpServers": {
"codebase-memory-mcp": {
"command": "/Users/martinvogel/.local/bin/codebase-memory-mcp",
"args": []
"command": "sh",
"args": ["-c", "exec $HOME/.local/bin/codebase-memory-mcp"]
}
}
}
34 changes: 34 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# codebase-memory-mcp — Developer Notes for Claude

## Build & Test (C server)

All C targets use `Makefile.cbm`:

```bash
make -f Makefile.cbm test # build + run full test suite (ASan/UBSan)
make -f Makefile.cbm test-leak # heap leak check (see below)
make -f Makefile.cbm test-analyze # Clang static analyzer (requires clang, not gcc)
```

## Memory Leak Testing

**macOS** — uses Apple's `leaks --atExit` on a separate ASan-free binary:
```bash
make -f Makefile.cbm test-leak
# Report saved to build/c/leak-report.txt
# Target line: "Process NNNNN: 0 leaks for 0 total leaked bytes."
```

**Linux** — uses LSan via ASan env var on the regular test runner:
```bash
make -f Makefile.cbm test-leak
# Report saved to build/c/leak-report.txt
# Exit 0 = no leaks.
```

Why a separate binary on macOS: `leaks` cannot inspect processes that use a custom malloc (ASan replaces it). The `test-runner-nosan` target rebuilds without `-fsanitize` flags specifically for this purpose.

## Project Structure (C server)

Sources live under `src/`; tests under `tests/`; vendored C libs under `vendored/`.
The Go layer (`cmd/`, `internal/`) wraps the C server via CGO — see `CONTRIBUTING.md` for the Go side.
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,30 @@ Key test files:
- `internal/pipeline/astdump_test.go` — 90+ AST structure cases
- `internal/pipeline/pipeline_test.go` — integration tests

## Run C Server Tests

The MCP server core is written in C and has its own test suite under `tests/`:

```bash
make -f Makefile.cbm test # full suite with ASan + UBSan
make -f Makefile.cbm test-leak # heap leak check (see below)
make -f Makefile.cbm test-analyze # Clang static analyzer (requires clang, not gcc)
```

**Memory leak detection:**

On **macOS**, `test-leak` builds a sanitizer-free binary (`test-runner-nosan`) and runs Apple's
`leaks --atExit` on it. ASan replaces malloc, so the standard `test-runner` cannot be inspected
by `leaks` — the separate nosan build is required.

On **Linux**, `test-leak` runs the regular `test-runner` with `ASAN_OPTIONS=detect_leaks=1` to
activate LSan.

In both cases the full report is written to `build/c/leak-report.txt`. A clean run ends with:
```
Process NNNNN: 0 leaks for 0 total leaked bytes.
```

## Run Linter

```bash
Expand Down
Loading