NestWeaver
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
NestWeaver uses Tree-sitter to parse 32 languages and resolves cross-file references with confidence scores. Its graph helps you explore an unfamiliar repository, assess a change's impact, and give an agent relevant symbols and relationships. Indexing and structural queries run locally; semantic embeddings and shared-server connections are optional.
Quick Start · Install options · CLI reference · MCP server · Agent setup verification · Upgrade guidance
32 Languages
Tree-sitter parsing for JS, TS, Go, Python, Rust, Java, C/C++, Lua, Scala, Elixir, Zig, Vue, Svelte, and 18 more. Tracks CALLS, IMPORTS, USES, and ACCESSES edges. Resolves monorepo workspaces and tsconfig path aliases. As of 9.0.0 .h files are parsed with the C++ grammar (they used to get C, which has no class keyword) and C++ #include resolves to real IMPORTS edges.
Markdown Brain Index Obsidian vaults alongside code. Unified knowledge graph across notes and symbols.
Intent-Aware Context
Personalized PageRank with per-edge-type weights (CALLS, IMPORTS, USES, ACCESSES) and --intent tuning surfaces exactly the symbols relevant to your task.
43-Tool MCP Server Model Context Protocol tools for AI agents. Drop-in for any MCP client, lite mode for Cursor. Daemon architecture enables concurrent access from multiple AI tools without lock contention.
PR Impact & Dead Code
Confidence-weighted blast radius with impact_score decay through edges; co-change mining from git history (Jaccard-scored file pairs); type-aware call resolution via AST-extracted type bindings; dead code detection with type exclusion and manifest-driven entry points; hub/bridge analysis and graph export.
16 AI Tool Integrations
One-command setup for Claude Code, Cursor, Codex, Gemini CLI, GitHub Copilot in VS Code, Aider, Kiro, and more. Also offered automatically on the first interactive in-repo index.
Agent Interaction Memory
Opt-in usage tracking that learns from what agents actually use. It re-ranks only the nodes a query's walk already reached, by at most +5%, and never adds a node the seed cannot reach. Privacy-first: local-only, records UIDs and timestamps only, no content capture. Enable with --track-interactions.
Quick Start
1. Install the CLI
Upgrading an existing database? Stop the old daemon and back up with the previous binary first.
With Node.js 18+ on macOS 13.3+ or Linux with glibc 2.35+ (x86_64 or arm64):
npm install --global nestweaver
nestweaver --versionnpm installs the matching prebuilt binary as an optional dependency; no Rust compiler or install-time script is needed. Keep optional dependencies enabled. Windows and musl/Alpine do not have published binaries. For a verified GitHub Release archive or a source build, see Install and INSTALL.md.
2. Index and query your repository
Run these commands from your repository root:
nestweaver index --repo . --db "$(pwd)/nestweaver.lbug"
nestweaver search "main" --db ./nestweaver.lbug
# Replace processPayment with a symbol name found in your search results
nestweaver context processPayment --db ./nestweaver.lbugsearch finds symbols by name; context returns related symbols and their
relationships around a name, UID, or repo-relative file path. The database and
its sidecars stay on disk so subsequent queries can reuse the index. A local
background daemon owns the database and starts automatically on first use.
Index reports its selected database target on stderr unless --quiet is set;
the target is not a field in the --json payload. When querying from another
directory, pass the same absolute database path with --db. The first
command uses an absolute path for daemon startup. Explicit
--db keeps these examples bound to the same graph even if you have other
instances configured.
3. Connect your AI coding tool (optional)
From the same repository root:
nestweaver setup --db "$(pwd)/nestweaver.lbug"
# Or choose a specific installed integration:
nestweaver setup claude-code --db "$(pwd)/nestweaver.lbug"setup detects supported tools and writes their MCP registration and
instructions. Use an absolute database path so clients launched from another
directory still query the same graph. It supports 16 integrations, including Claude Code, Cursor,
Codex, Gemini CLI, and GitHub Copilot in VS Code. Most config files are written in the repo;
Windsurf uses its user-level config, and Cline gets a printed snippet to paste.
setup attempts every tool, lists what it wrote for each, and exits non-zero
if any tool failed. Restart or reload your client and check
its tool list to confirm activation. Cursor gets the six-tool lite set; other
MCP integrations use the full set. For a client you configure manually, launch
nestweaver mcp --db /absolute/path/to/nestweaver.lbug as its stdio server; see
MCP Server for tool filtering and lifecycle details.
The first interactive
indexrun from inside your repo also offers setup. The prompt is skipped in CI, scripts, and non-TTY runs;index --setupexplicitly requests setup at the indexed repo root. Usesetup --forceonly when you want to overwrite customized skill/guide files or rebind an existing registration to a different--db(a changed--dbis reported otherwise). It never overwrites.github/copilot-instructions.md, or anAGENTS.mdwithout NestWeaver's begin/end markers.
# Keep the graph current as you edit (runs until interrupted)
nestweaver watch . --db ./nestweaver.lbugRun nestweaver --help for the full command list. Most commands support
--json for machine-readable output. Existing users should read the upgrade
notes below before using an older database with a new binary.
Related MCP server: codememory
Upgrading — re-index before you trust a ranking
Upgrading an existing database? Check compatibility before querying it:
Builds with LadybugDB 0.22.3 read the 0.21.2 database format, but a writable open/checkpoint can upgrade its storage format from 47 to 49. Stop the old daemon and back up with the previous binary before upgrading. To downgrade, reinstall that binary and restore the pre-upgrade backup; do not point it at the upgraded file. See the storage upgrade guidance.
Previous release 12.2.6 uses resolver generation 22 and parsed cache 16. LadybugDB 0.22.1 is unchanged from 12.2.5. Anonymous JavaScript/TypeScript default functions now own calls in their bodies; Svelte, Vue and Astro function spans skip destructured/default parameters. Generation 21/cache 15's PHP static-method ownership and inheritance facts and the preceding Dart/PowerShell grammar updates remain included. Force re-index each repository once after upgrading to publish the new parser facts; invalidating the parse cache alone does not replace symbols and edges already stored in the graph.
12.2.7 uses LadybugDB 0.22.3 (the same storage format 49), resolver
generation 23 and parsed cache 17. Scala grammar 0.26.9 repairs Scala 2
given/enum identifiers and other grammar boundaries. Force-index each
repository once after upgrading from generation 22 as well.
Canonical publication PageRank now consistently covers the unified code and notes graph after indexing, watching and rebuilding. Older canonical sidecars with a code-only scope are disclosed and recomputed lazily on the first ranked query; no graph rebuild is required for this ranking migration alone. Explicit scoped ranking APIs retain their requested scope.
daemon status --json reports both client and daemon resolver generations.
An older daemon without this provenance reports null; differing builds with
the same product version disclose skew without automatically replacing a writer.
A database from before LadybugDB 0.21 needs a publication rebuild, not just a forced index. Back it up and follow the error's recovery command and storage-engine upgrade guide.
For a compatible database, run
nestweaver stale-check --db <db>. 12.2.7 requires resolver generation 23 (12.2.6 used 22). If your binary reports a generation-stale graph, runnestweaver index --repo <path> --db <db> --forcefor each repository. A plain incremental index does not repair generation-stale graphs.Generation 16 preserves declaring-package origin through Go factory-call receiver chains and revisits unchanged importers when Go package methods are added or recreated. Existing graphs may retain missing CALLS edges until the forced index above.
Generation 17 confines Go initializer and case-clause bindings to their statement or clause, restoring valid calls after those scopes end. Cached parses are invalidated to discard the old lexical lifetimes; existing graphs need the forced repository index above. Resolution-dependency format is unchanged.
Generation 18 and parsed cache 12 invalidate Scala parses from before the grammar 0.26.3 update, which recovers declarations such as local case classes and Scala 2
exportidentifiers. After upgrading to a release containing this change, force re-index each repository using the command above. An unchanged incremental run does not repair an older graph;stale-checkcontinues to report it as outdated until the forced index succeeds.12.2.4 generation 19 and parsed cache 13 additionally repair PHP function resolution by namespace across directories, including
use functionaliases and duplicate refusal. Existing graphs need the forced repository index above. PHP changes conservatively re-resolve repository PHP callers because a new declaration can satisfy a previously unresolved call or create ambiguity. Ordinary index/watcher scans reuse valid cached parses; Git/server incremental repair reparses PHP peers. No-change runs remain no-ops.Markdown derivation version 3 repairs percent-encoded Markdown URL paths and proven absolute in-vault note paths. Eligible vaults disclose stale derivation until re-derived; run
nestweaver brain refresh <vault> --db <db>after upgrading. This is separate from repository resolver generation; literal wikilinks keep their existing spelling semantics.The current source also infers method receivers from typed Go slice range elements, including qualified types and exact factory returns. Generation 14 requires the same forced repository re-index to add the missing call edges; generation15 additionally handles inferred
varslices, parenthesized range sources and single named factory results. Parsed cache10 reparses unchanged declarations for normalized return types and complete var/const/parameter shadow guards.Upgrading to 12.2.7 needs a forced re-index of every repository. Run
nestweaver index --repo <path> --forceonce per repository, using your usual--dband--configbindings. Plain incremental indexing can leave an unchanged graph on its old generation.stale-checkexits 2 until repaired.Refresh registered vaults if crossing the earlier Markdown derivation upgrade. Run
nestweaver brain refresh <vault>with the same bindings to re-derive note-to-code relationships against the rebuilt graph. If upgrading from before 12.2.2, this also repairs frontmatter wikilinks and block references.New databases do not need migration. Vaults do not carry a code resolver generation; see the detailed notes for separate Markdown derivation changes.
12.2.6 uses RESOLVER_GENERATION 22; 12.2.5 used 21. Every
graph indexed by a generation different from the running binary must be re-indexed. Compatibility is an EXACT MATCH, not a floor, so a graph written
by any other generation — older or newer — is treated as untrustworthy.
9.0.0 took it from 3 to 4, and generations 5 and 6 followed. The 9.0.0 bump
changed edge SHAPE; 5 and 6 changed which symbols are persisted as ENTRY
POINTS, which is what dead-code walks from. Generation 7 (nw-687) adds
missing CALLS/definition edges for CommonJS module.exports.X/exports.X
function definitions, which a stale graph is missing entirely. Generation 8
(nw-688) renames JS/TS test-runner blocks so describe('getTier') no longer
shadows the real getTier. Generation 9 replaces file-level import proxies with
actual binding users, corrects receiver and export resolution, and persists
exported executable roots. Upgrading from generation 8 requires a forced
re-index of every repository; stale-check exits 2 and dead-code refuses
until the graph matches. Generation 10 (nw-113) restricts a block-scoped
JS/TS callable to its block, and gives the calls a JS/TS/Python/PHP file makes
at its top level a per-file <module> owner (parsed cache 6). The same bump
carries these JS/TS parser and resolver fixes:
Change | Effect on the graph |
Generators ( | Their callers gain edges; their body calls are no longer top-level code |
Generators scope their parameters and | A generator's parameter no longer shadows a same-named module function |
A | It was a |
A |
|
An unparenthesised arrow parameter ( |
|
ESM import bindings are hoisted to the top of their scope (nw-803) | A function written above an |
TS | Calls through |
|
|
A broken file with no real symbols gets no owner; a lowercase JSX tag ( | Such files stay disclosed as parse errors and add no empty owners |
A top-level call through an import written below a one-line function resolves (JS/TS/Python/PHP), and a sibling's nested homonym no longer hides the caller's own nested function | Those calls keep their edges |
A member access or call through an imported receiver ( | The false self- |
| Those files, and the calls into them, appear in the graph |
Generation 11 (nw-787, nw-789) scopes a nested JS/TS function declaration to
where it is visible, stops a bare JS/TS call binding a method or accessor,
scopes a Python def nested in a function to that function, and gives a nested
class's members MEMBER_OF their own class (parsed cache 7). Graphs indexed at
generation 9 or 10 need the same forced re-index.
Generation 12 resolves imports by package instead of by file name, and resolves more method calls (parsed cache 8):
Change | Effect on the graph |
Go imports read | Cross-package calls in a real Go module resolve; they did not before |
Go methods carry their receiver type ( | Typed Go method calls resolve, and |
Python | Those calls gain edges |
Kotlin and Java imports resolve through the declared package (any file of it, wildcard imports, nested classes), not a file named after the symbol, with the language's precedence: a single-type import, then a type in the same package, then an on-demand ( | Imports of classes in differently named files resolve, and a same-package type is no longer shadowed by a wildcard import |
A method called on a call or | More method calls gain edges, conservatively; library-typed chains stay unlinked |
| Constructors, trait defaults and decorators are no longer unreachable |
Duplicate JS/TS | Fewer duplicate symbols and no false |
Generations 13–17 add nested Go module and receiver ownership, typed slice range elements, inferred slice and named-return forms, factory-call receiver origins, recovery when package members are recreated, and correct if/switch/case binding lifetimes. 12.2.3 includes all of these changes (parsed cache 11). Existing missing edges require the forced re-index described above.
All these kinds of staleness have the same remedy and the same symptom list. Until you re-index:
Rankings are stale.
hubs,bridges,repo-map,clusters, and every PageRank-ordered result are computed over edges the old resolver wrote.MEMBER_OFedges are missing for C and C++ members, so reachability under-counts.dead-coderefuses to answer on such a graph and exits2rather than printing a deletion list built from missing edges.C++
IMPORTSedges are missing. The resolver used to extract#includeand then discard it..hheaders were parsed with the C grammar, which has noclasskeyword. Re-indexing routes them to C++: on a real 874-header corpus, header symbols went 7,166 → 17,872 andclassdefinitions 0 → 1,373.
nestweaver index --repo <path> --force # per repo — a full index, not incremental--force is required. A generation-stale repo is sitting exactly at git
HEAD with every file unchanged, so plain nestweaver index --repo <path> takes
the incremental path, reports 0 added, 0 modified, 0 deleted, writes nothing,
and leaves the repo on the old generation. Only a full re-index rewrites the
edges.
Vaults are not Repo nodes and carry no resolver generation, so the forced
re-index does not touch them. When crossing the 12.2.4 Markdown derivation change, run one
brain refresh <vault> per vault to re-derive links against the rebuilt code graph.
stale-check detects this as of 9.0.0. A repo whose edges predate the
running resolver reports status: "outdated_resolver", needs_reindex: true,
and the command exits 2 — the same code it already used for
stale/incomplete/missing, so an existing CI gate catches the upgrade with
no edit:
nestweaver stale-check # [OLD-RESOLVER] rows + the remedy, exit 2
nestweaver stale-check --json # "resolver_stale_repos": [...], per-repo "resolver_stale"
cat <db>.resolver_generation.json # per-repo generation; anything that is not the current one is staleIn 8.x it did not: the status ladder was missing/incomplete/SHA-behind-HEAD
only, so a generation-3 graph reported ok and exited 0.
Generations 5 and 6 turned on PERSISTED PER-SYMBOL COLUMNS rather than edge
shape: is_entry_point and entry_point_kind are read straight off disk, so a
symbol indexed as false stays false no matter which binary asks. Generation
6 roots bash and Python top-level calls, Swift main.swift/shebang files, bash
trap handlers, and package.json entry points at any depth in a monorepo.
Those additions can only ADD reachability roots, so they can only REMOVE
symbols from a dead-code list — an un-re-indexed graph over-reports dead
code.
hubs, bridges, repo-map, ranking rank and summary --level hub also
disclose it (rankings_stale / stale_repos on --json, a warning on stderr
otherwise). Other ranking-derived surfaces still do not — clusters,
blast-radius, generate-guide, PPR-backed context, and the whole web UI —
so on those, absence of a warning is not evidence of freshness.
_meta moved to the payload and lost its nestweaver.io/ prefix
Only affects raw HTTP MCP clients that read result metadata. The CLI, the MCP stdio server and the daemon are unchanged for callers.
Through 8.x the HTTP /mcp boundary stamped provenance onto the outer
tools/call envelope under namespaced keys — nestweaver.io/sources,
nestweaver.io/scope, nestweaver.io/stale_repos. It is now written once, at
the tool layer, as an unprefixed _meta object on the result payload:
// 8.x — outer envelope
{ "result": { "_meta": { "nestweaver.io/sources": ["local"] }, "content": [...] } }
// 9.0.0 — on the payload itself
{ "map": "...", "_meta": { "scope": "local", "sources": ["local"], "stale_repos": [] } }A client reading result._meta["nestweaver.io/sources"] gets nothing. Read
_meta.sources on the payload instead. The payload location is what the
server's own initialize instructions have always promised and what both CLI
routes already emitted; the envelope was the odd one out, and MCP over stdio
sent no provenance at all.
Note that _meta.stale_repos is federation staleness (which upstreams were
behind). It is a different population from the top-level stale_repos on
hub_nodes / repo_map, which is resolver-generation staleness, and from
stale_repos on stale_check, which is behind-HEAD.
Daemon bypass is CI-only
Standard development and distributed binaries cannot honor --no-daemon,
NESTWEAVER_NO_DAEMON, or an explicit permit. Refused requests print a warning
and keep the normal daemon route.
Only a separate internal CI test artifact may enable direct-store tests. It
requires the ci-direct-tests build feature, NESTWEAVER_ALLOW_NO_DAEMON=1,
and a GitHub Actions runner context (GITHUB_ACTIONS=true plus nonempty
RUNNER_TEMP, RUNNER_OS, and GITHUB_RUN_ID). Ambient CI=true never grants
access, including when set locally. This artifact must never be published.
Local development, fixtures, debugging, and recovery use the daemon; setting CI
locally is not an exception. See release fixture instructions.
Note that hubs --json carries two different stale_repos: the top-level
one is resolver-generation staleness, and _meta.stale_repos is federation
staleness (repos where the local index is behind an upstream server). They
answer different questions and can disagree.
Also changing behaviour in this release, in ways a script may notice:
Change | What to do |
Re-index and refresh required (12.2.2). | Run |
| Pass |
| Treat 69 as "restart the daemon" ( |
An explicit | Omit |
Git runs isolated for every repository NestWeaver reads, including | Nothing to change for normal repositories; expect LFS-tracked files to appear modified where a filter used to hide the difference |
Git metadata a repository borrows from another (a forged | Index the real checkout, not a path through a pseudo-filesystem |
An unreadable source in a language that cannot carry API contracts is skipped and disclosed ( | Gate on |
Edits to | Nothing to change |
An incremental index that was killed part-way leaves a per-repo "publication incomplete" record: | Re-run |
Client-supplied lists and values are capped and stated in each MCP tool's | Split oversized requests; read the limits from |
| Retry with a UID from |
Metadata writes ( | Retry a |
| Nothing to change; budget for slightly larger concise responses |
New response fields: | Read the new fields where useful; they are additive |
| Review the newly reported changes before gating |
The CLI sends the daemon absolute | Nothing to change |
| Pick a backup path outside the database's files |
| Re-run |
| Pass |
The code watcher now resolves each batch with the full index's resolver over the whole-repository view, so a watcher-maintained graph matches a fresh | Nothing to change; expect somewhat higher daemon memory on large repositories |
Claude Code integration: the shipped search hook searches the grep/rg pattern, not the path. The Bash hook | Re-run |
| Register NestWeaver by hand in those tools' own config until |
Interaction memory ( | Optionally run |
MCP | Read |
A repo filter that names no repo ( | Branch on |
New exit codes: | Treat 2 as a miss and 64 as a usage error |
| Run |
Web: a | Read |
| Nothing to change; a contention refusal clears itself once the repo captures in time |
A watched vault batch that collides with another writer's transaction retries with backoff (2575 ms in all, the write lease released while it waits). If the collision outlasts the retries the batch's notes are owed and replayed on the retry backoff and at the next start, instead of the watcher exiting; | Nothing to change; |
A note-to-code relink no longer forces a PageRank recompute on every ranked read: the code-only ranks stay warm and | Nothing to change |
A database error is called corruption more carefully. A write-transaction collision, an index publication in flight and a busy daemon are never corruption. A file shorter than its catalog read while another process writes says so and names the next step (if it repeats, | Follow the step the message names before restoring a backup |
| Re-run |
A call a JS/TS/Python/PHP file makes at its top level, outside every function, class and method (a bare call, an IIFE, an Express-style route handler, a decorator, a | Run |
Module owners are labelled | Name an owner |
A qualified name now narrows every name lookup, not only owners. The segments before the name are read two ways and both readings are kept: the first as a file (an exact repo-relative path, a suffix on a | Qualify a name as |
Module owners are callers only. They are left out of | Nothing to change |
| Read |
| Nothing to change |
| Read |
| Nothing to change |
| Read |
| Nothing to change |
| Count files per tier, not tests |
| Check |
After an edit, the watcher and incremental index always re-resolve a changed file's direct importers; the 200-file cap now bounds only the transitive expansion. Past 5,000 direct dependents the pass is skipped with a warning naming | Nothing to change |
A nested JS/TS | Calls that bound a sibling's nested function, a block function after its block, or a same-file method now bind the import, the caller's own function or nothing. Re-index with |
The index CPU budget ( | Nothing to change. To keep a budget, set |
| Run |
A watcher pass over a file with a class keeps its | Nothing to change; graphs kept by an older watcher regain the edges on the file's next edit or a |
A code watcher keeps running when a committed batch's evidence cannot be saved. It notifies the committed graph and discloses the outstanding repair, retaining replay paths in memory across retries. Successfully persisted replay debt also survives restart; startup repairs imports across bounded source batches. | Restore access to the reported evidence files and let the watcher retry. If replay debt itself could not be persisted, keep the watcher running until repair completes; after interruption, run |
Rebuild required. LadybugDB 0.21 (0.21.2 in published 12.2.4) changes how text keys are hashed and its on-disk format marker did not change, so NestWeaver now refuses a database built by an earlier version before opening it: exit 1, | Stop the daemon, run |
A daemon killed by a fatal signal (SIGSEGV, SIGBUS, SIGABRT, SIGILL) while answering is now named. A database with damaged index pages can open under LadybugDB 0.21 and fault on a later lookup; the command used to print a bare | Restore the most recent backup with |
Renaming a registered vault with | Pick a free |
| Fix the flag value; the message lists the accepted ones |
Every repo filter now resolves through the one repo resolver and keeps its failure class: | Branch on the exit code, or on |
A wikilink that exactly and uniquely names a note (case-insensitive, any folder: its filename stem is unique in the vault and no other note has that title) now resolves at confidence 1.0 and is no longer reported. | Read |
A resolver-generation-stale repository now degrades | Gate on |
The 409 for an empty seed container on | Branch on |
| Branch on exit 2, then run |
Every web API error body is JSON | Parse error bodies as JSON |
A declared project repo removed with | Nothing to change |
| Nothing to change |
| Read |
| Run |
| Pass |
| Drop blank seeds before sending |
| Send back the |
A context seed that names a vault with no notes (or a | Branch on |
Symlinks in a vault are still not followed (a link can point outside the vault or duplicate a note under a second path), but they are no longer silent: a symlinked directory, or a symlinked file with a Markdown name, is listed in | Move or copy the target into the vault to index it |
An indexed note that grows past | Shrink the note or raise |
| Read |
MCP: a lookup tool whose target does not exist now returns | Branch on |
MCP: | Handle the JSON-RPC |
| Read the new keys; the member lists are unchanged |
MCP | Pass one spelling, or the same value in both |
An empty string for an identifier or query argument ( | Omit an argument rather than sending |
| Use |
| Update scrapers of the old two text lines, or use |
| Show |
| Gate on 1 for unreadable source and 2 for unresolved targets; pass the right |
| Use |
| Check |
| Show the JSON-RPC error; fix the config |
| Start the daemon with the same |
| Nothing to change unless a script matched the wrapper text |
| Run a full |
A config-less | Run |
The daemon now rebuilds the manifest sidecar (and clears | Nothing to change; re-index a repo named in the rebuild error if the sidecar stays blocked |
The local UI rejects a non-loopback Host or mismatched Origin with 403 (nw-682) | For a deliberate local reverse proxy, set |
UI responses now include CSP, | Allow the UI's same-origin assets when configuring a local reverse proxy |
| Handle the machine-readable |
An ambiguous | Pass |
Web UI: a deep link with scene params ( | Add |
Web UI: | service |
Web UI: | Nothing to change; drop |
An unreadable, invalid UTF-8 or invalid-glob | Repair the file and retry; a missing |
Note-to-code links now scope candidate definitions before preferring them (nw-685) | Expect links into the note's own project when another project defines the same name |
A new note under a project's | Expect newly created notes in |
A UID seed with no text label no longer opens a semantic seed search (nw-686) | Expect structural results for the UID without unrelated semantic matches |
| Handle the additive stale-span/relocation fields in |
CommonJS | Run |
A JS/TS test block is now named | Run |
| Nothing to change; expect fewer |
Server mode: a code re-index no longer drops note-to-code links until the next vault fetch. After each code fetch the index worker records the debt ( | Gate on |
The daemon's manifest rebuild is now per repo: a repo it must refuse (source eligibility recorded under other settings, a missing root, a malformed manifest, the shared 32 MiB budget) no longer keeps every repo's manifests stale. The others are published and | Run the named remedy for each refused repo |
In unscoped | Treat |
Invalid | Gate on 64 for usage errors; 1 still means the export itself failed |
A value a tool's schema rejects (e.g. an over-long | Gate on 64 for usage errors; 1 still means the command itself failed |
| Fix the directory's permissions (or exclude it) and re-run; drop |
| Gate on |
| Nothing to change unless a script relied on the failure; gate on |
Registering a vault under a name another vault at a different root already holds is now refused — compared ignoring case, so | Pass a distinct |
| Match on |
Notes whose YAML frontmatter cannot be parsed are still indexed, but are now disclosed under one label, | Fix the YAML to restore those notes' tags and properties; nothing to change in scripts |
A | Expect results (and a non-empty |
Web API | Page with |
The brain watcher now discloses notes whose text landed but whose code links failed to write, as | Nothing to change; the rows clear once the links are written |
A full | Gate on |
Name-inferred cross-repo call links ( | Gate cross-repo |
Note-to-code links ( | To keep a link for a plain name, write it as code ( |
Project code membership is now a durable Project→Repo edge ( | Nothing to change; to downgrade, re-run the old binary's |
| Pass |
| Pass |
| Raw HTTP MCP clients must read |
| Read |
| Standard artifacts always use the daemon; even the unpublished CI artifact requires a GitHub Actions runner context, not a local |
Server Mode
NestWeaver can run as a centralized server, indexing repos for your entire team and serving queries to AI agents via gRPC and MCP-over-HTTP.
Quick Start
# Start the server (TLS required for grpcs:// clients)
nestweaver daemon --db ./brain.lbug run \
--server \
--bind 0.0.0.0:9378 \
--tls-cert ./tls/server.pem \
--tls-key ./tls/server-key.pem \
--auth-token "$NESTWEAVER_AUTH_TOKEN"
# Connect from another machine
nestweaver connect grpcs://nestweaver.internal:9378 --token "$NESTWEAVER_AUTH_TOKEN"Ports
Port | Protocol | Purpose |
3000 | HTTP | Web UI (optional, |
9378 | gRPC | Query API (TCP + TLS) |
9379 | HTTP | MCP-over-HTTP (AI agents) + |
In server mode the daemon serves Prometheus /metrics on the MCP HTTP port (9379) — gRPC port + 1, inheriting the --bind IP. nestweaver ui serves the same route on its own listen port (default 3000). The macOS app serves the UI, including /metrics, on 9377.
Docker
docker compose up -dSee Server Mode Guide for full documentation.
Install
macOS app (source build)
The native NestWeaver.app is source-build-only until a release job publishes
a .app bundle or DMG. Build it from source (it bundles Metal-accelerated
embeddings and the web UI):
bash app/build.sh
open target/release/NestWeaver.appFor a frozen candidate, retain the CLI and workspace test executables from one Cargo compilation, then run those exact executables without rebuilding:
bash app/build.sh --validation-artifacts /tmp/nestweaver-validation
python3 scripts/test-validation-artifacts.py --manifest /tmp/nestweaver-validation/artifacts.jsonThe validation mode uses the normal release/Metal profile and app packaging.
It checks that the packaged CLI matches the artifact manifest. The affected Mac
must validate the source build and app launch; Linux cannot establish those results.
For Linux, build the frontend first, then use
python3 scripts/build-validation-artifacts.py --output /tmp/nestweaver-validation.
Both artifact commands require a clean, committed source tree. Test exclusions
must be explicit and are recorded in the results; legacy direct-mode integration
fixtures require the separate CI-only artifact/runner and cannot run locally.
The .app bundle gives you a menubar status icon, Metal GPU acceleration (~5x faster embeddings via a launchd-managed daemon), a persistent daemon shared with the CLI/MCP, web UI on port 9377, and launchd-managed restart. See macOS App below.
Supported platforms (CLI)
Install the release-matched CLI wrapper from npm:
npm install --global nestweaver
nestweaver --versionAlternatively, select the GitHub Release archive for your platform, verify its
matching SHA-256 file, then install it as described in
INSTALL.md. Both macOS CLI
archives are built with Metal support. The default accelerator = "auto" therefore requires Metal in
those builds and reports a Metal initialization or inference-probe failure
instead of retrying on CPU. To opt out explicitly, set accelerator = "cpu" in
the [embedding] section of your instance configuration. Builds without Metal
support select CPU for auto.
Platform | Release target |
Linux x86_64 |
|
Linux aarch64 |
|
macOS Intel |
|
macOS Apple Silicon |
|
# After cloning the source repository (current stable Rust)
eval "$(scripts/fetch-lbug-source.sh)"
cargo install --locked --path .Source builds also require CMake, a C++20 compiler, Python 3.9+, OpenSSL and zstd
development files, pkg-config, and Protocol Buffers. The checkout builds
LadybugDB from source rather than downloading a prebuilt archive; keep
.cargo/config.toml intact. See
the source-build prerequisites before
building.
Download a pre-built CLI archive and its matching .sha256 file from GitHub Releases. Binaries are available for Linux and macOS on both x86_64 and aarch64; use the target table above and follow the checksum verification in INSTALL.md.
git clone https://github.com/Kehl-io/nestweaver.git
cd nestweaver
eval "$(scripts/fetch-lbug-source.sh)"
cargo install --locked --path .
# On macOS with Metal embeddings:
# cargo install --locked --path . --features metalThe first build compiles LadybugDB from source and may take several minutes.
CLI Reference
Command | Description |
| Parse and index a repository (auto-detects repo root from |
| Live re-indexing via filesystem watcher with debouncing. Runs daemon-side (no instance config required; unsafe roots are denylisted); |
| Stop the daemon's active watcher. The watcher slot is global and the daemon keeps no liveness check on the CLI that registered it, so a watch killed without a clean shutdown (SIGKILL, or a closed terminal) leaves the slot occupied and every later watch refused; this releases it without restarting the daemon |
| Get task-focused context via PPR (supports |
| Symbol-name substring lookup. Notes and BM25 full-text search are |
| Look up a symbol by name and display its metadata |
| Trace the blast radius of a symbol through the dependency graph (fails closed on unknown/foreign UIDs, exit 2; |
| Assess blast radius for a set of changed files; reports |
| Run the MCP-compatible changed-file impact contract directly from the CLI, including risk, gate state, status, and blind spots |
| Trace forward execution flow from a symbol — what it calls, and what those call |
| Read a symbol's source span. Omitting |
| Regex search over indexed text (scope-aware trigram pre-filter; safely scans only missing or stale scopes with |
| Count regex matches per pattern ( |
| Orient on a topic in one call |
| Drill into investigate bundle entries — full body plus immediate neighbours |
| Fill in bodies/summaries for all un-hydrated entries of a bundle |
| Select tests for changed files in one repository (tiered; carries a |
| Generate a token-budgeted map of the repository structure |
| Hierarchical code summaries at symbol, file, or cluster level |
Command | Description |
| Add an Obsidian vault or markdown directory to the knowledge graph |
| Search across code symbols, notes, headings, sections, and tags ( |
| Get unified context spanning both code symbols and notes (skips the semantic leg entirely when the DB has no embeddings; identical concurrent calls coalesce single-flight) |
| List all registered vaults |
| Show vault counts, per-vault staleness, and index health |
| Watch vaults for changes and re-index automatically. |
| Force a full re-index of one vault directory ( |
| Remove a vault from the brain (cascade-deletes nodes; does not touch files on disk) |
| Check whether the indexed graph reflects reality (also available top-level as |
| Show what changed in the graph since a commit ( |
| Rebuild the Tantivy BM25 search index from current graph state |
| List unresolved and ambiguous wikilinks, with suggested fixes. |
| List notes with zero inbound and zero outbound wikilinks |
| Detect topic clusters via Louvain-style local-moving community detection over note wikilinks |
| Show a tag's note count and co-occurring tags (or dump the full tag graph) |
| One-shot health summary: note/wikilink counts, broken links, orphans, top tags |
| Resolve a note by UID or title and list the notes that link to it |
| Read one note by |
| Health checks over the vault (stale notes, broken links, orphans). |
| Propose/apply tier promotions (logs → ideas → project files). |
| Typed-edge traversal from a note (supersedes, depends-on, etc.). |
Command | Description |
| Build a fresh graph and every derived artifact beside the incumbent, validate it, then atomically activate it |
| Inspect resumable operations and report corrupt/incompatible journals independently |
| Request cooperative cancellation at an exact observed journal revision |
| Remove failed staging at an exact revision, or safely discard only an invalid journal |
| Switch back one step to the retained predecessor while the daemon is stopped |
| Reconcile an index publication abandoned by a crashed indexer. While |
| Reclaim slots nothing can still reach. Keeps the slot |
The regex-v3/embedding-v2 upgrade requires this one-time full rebuild. See the publication rebuild and recovery guide.
Ranked reads during a publication. Not every publication fails a ranked read
closed any more. A brain watcher batch publication now lets ranked reads
succeed, returning results plus a disclosure of what was in flight. A full
index publication still fails closed, and so does a wedged watcher marker —
those two are unchanged. MCP responses computed during a live publication carry
four disclosure keys:
Key | Meaning |
| a publication was in flight while this answer was computed |
| age of the publication marker, in seconds |
| the note paths being published, capped at 20 |
|
|
Known gap: CLI --json verbs that reshape the response into a typed struct —
nestweaver hubs --json among them — drop these keys. Their absence from a CLI
JSON payload is therefore not evidence that no publication was running.
Command | Description |
| Find most connected hub nodes (degree centrality + PageRank) |
| Find architectural chokepoints (betweenness centrality) |
| PR blast radius analysis with risk scoring (Low/Medium/High, or Unknown when a changed file could not be assessed); |
| Report a full-suite outcome from CI so selection quality can be measured |
| Measured file-recall / change-recall / selection-breadth of past selections (refuses percentages below 10 joined runs) |
| A review aid, not a deletion list, and it refuses to produce one at all on a resolver-generation-stale graph — exit |
| Lightweight result reranker (off-by-default heuristic) |
| Show hardware and configuration information |
| List API contracts derived from spec files + framework handlers |
| Routes declared in a spec but not implemented, and vice versa (presence-level) |
| Field/type-level OpenAPI breaking-change diff between two spec versions ( |
| Inspect ranking priors |
| Offline retrieval-quality evaluation |
| Export the graph in Cypher, GraphML, Mermaid, or MessagePack format (cypher/graphml/mermaid carry real PageRank scores; mermaid |
What counts as an entry point. Reachability is a forward walk from entry
points, so what the parser accepts as one decides what dead-code reads as
dead:
bash —
traphandlers are entry points, including quoted flags and traps nested inside functions. Any command with no enclosing function also roots its same-file callee, so a script with a bare top level now has entry points at all; it used to have none, and every function in such a script read as 100% dead. Trap handler resolution is SAME-FILE ONLY — a handler defined in asourced file (source lib.sh; trap cleanup EXIT) is not resolved and shows as unreachable.Swift — a top-level call in
main.swift, or in a shebang-led file, roots its callee. Known gap:swiftc foo.swifton a file that is neithermain.swiftnor shebang-led is missed.Python — a module-scope call roots a same-file function, which covers
if __name__ == "__main__":with no special case for it. Restricted to bare identifiers (obj.run()roots nothing) and to functions, never methods.module_init(JS/TS/Python/PHP) — calls a file makes at its top level, outside any function, class or method, are owned by a per-file<module>symbol, so the functions they call are live and show a caller inimpact. That covers bare calls, IIFEs, Express-style handlers registered at load, decorators and__main__guards, and works across files (the owner calls an imported function).require(...)alone does not create an owner. An owner that calls something is also its own<repo-relative path>::<module>process, so the process list grows for files with decorators, route registration or top-level test setup. The owner is excluded fromdead-codeoutput and counted inmodule_owner_roots, notentry_points.C++ — an error-recovered, macro-prefixed declaration is re-anchored to its name's line, which CHANGES that symbol's UID. A local whose type is an inline anonymous struct or class is reclassified
Function→Variable(the most-vexing-parse fix).Manifests —
package.jsonentry points are discovered at ANY depth, so a monorepo'spackages/*/package.jsoncounts. Paths are rebased against the manifest's own directory, and thebrowserfield is now an entry file.
Command | Description |
| List all projects defined in the instance config |
| Get context scoped to a specific project. |
| Materialize declared projects, wiki sources, and cross-repo links from instance config |
| Detect implicit projects from vault structure and code patterns |
| Discover potential cross-repo links between symbols |
| List all cross-repo links in the instance |
| List features spanning multiple repositories |
| Detect community clusters in the dependency graph (Louvain-style local moving, single-level; results cached in a sidecar, |
| Run the MCP-compatible cross-repository contract query for a symbol name or UID |
| Same JSON envelope as |
Command | Description |
| Start the MCP server (43 tools; 36 in direct read-only mode; 6 with |
| Manage the background daemon ( |
| Connect to an upstream NestWeaver server (federated read/impact) |
| Server management utilities ( |
| Launch the interactive web UI |
| Auto-detect and configure AI tools (16 supported). Use |
| Generate tool-specific instruction files (skill, cursor-rule, agents-md, claude-md) |
| Generate shell completions (bash, zsh, fish, powershell) |
| Generate vector embeddings for symbols, notes, and headings using a local model (Metal-accelerated) or external API. Reports an eligibility plan before embedding and exits successfully without loading the model when nothing is eligible; |
| Pull repository source into a local workspace (sparse checkout by default; |
| Validate an instance config without creating files or contacting services ( |
| Report embedding and Metal compile/runtime capabilities, including whether Metal was selected or fell back ( |
| Manage instance configuration. |
| Manage graph snapshots (build, verify, push) |
| Backup and restore the NestWeaver database |
| List all indexed repositories |
| Remove an indexed repository and all its data (symbols, files, services, contracts) from the graph |
| Remove a materialized project and its edges from the graph |
| Remove repos and vaults whose source directories no longer exist on disk |
| Reclaim embedding vectors left behind by deleted nodes ( |
| List all detected services |
| Display a summary of a specific service |
| Subagent guidance instructions |
| Manage interaction memory ( |
| Read back the annotations agents write via the |
| Install/remove the local pre-push blast-radius check ( |
| Analyse local changes against the org-wide graph (alias |
| Format impact analysis results as a PR/MR comment, for CI to post |
Local pre-push check
Get "confidence before you push" from the same hardened blast-radius analysis CI runs — locally, on your machine:
nestweaver hooks --install --db "$(pwd)/nestweaver.lbug"This writes a .git/hooks/pre-push that runs nestweaver pr-impact against the merge-base before every push. It is advisory by default: it never blocks your push (fail-open), stays silent on a trivial change, and prints a concise banner — the gate verdict, the top affected symbols, and a coverage caveat when the analysis was incomplete — only when there's something to review. A degraded/incomplete run never blocks, because an incomplete traversal can't be trusted to have found the risk.
To make it block a push (exit 2) on a contract-verified breaking change — a decidable API-signature break, not a heuristic:
nestweaver hooks --install --strictWhat --strict blocks on is configurable via the [pr_impact] section of nestweaver-instance.toml (strict_block_on_breaking, default true; strict_block_on_high_risk, default false — opt in to also block on a complete High-risk run). A degraded/incomplete run is never blocked on risk.
Remove it (restoring any hook it backed up) with:
nestweaver hooks --uninstallYou can also run the check manually — this is exactly what the hook does:
nestweaver pr-impact --base origin/main # advisory banner
nestweaver pr-impact --base origin/main --strict # exit 2 on a contract-verified breaking change (default policy)Features
Index Obsidian vaults and markdown directories alongside your code. NestWeaver builds a unified knowledge graph that connects notes, sections, and tags to code symbols — letting you query across both worlds. Wiki/HTML content is auto-converted to markdown during ingestion. Use .brainignore for glob exclusion patterns or --ignore for ad-hoc filtering.
# Add a vault to the knowledge graph
nestweaver brain add ~/Documents/Obsidian/MyVault
# Search across code symbols and vault notes
nestweaver brain search "architecture"
# Get unified context spanning code and notes
nestweaver brain context "MyProject"NestWeaver embeds symbols, notes, and headings using the configured local or external backend, then uses semantic similarity as one of the signals ranking the graph walk. Backend and device selection are explicit: failures are reported and never switch to another backend or device.
# Embed all indexed content (one-time, incremental after)
nestweaver embed --stats
# Ask a question in plain language
nestweaver investigate "how does the daemon decide when to reindex a repository"
nestweaver investigate "where does the upload pipeline start"Use investigate for a question; use context/brain context for a name
you already know. This is the one distinction worth learning up front.
context and brain context RESOLVE their argument to seed nodes — as a UID,
note title, tag, symbol name, or a qualified name such as path::name, path::<module> or Class::method — and a multi-word question resolves to none of
those, so they exit 2 with No seeds resolved even on a fully embedded graph
with a daemon running (under --json, the not-found envelope's message
carries that text, including the investigate command to run instead). investigate is the natural-language entry point: when
seed resolution finds nothing it falls back to BM25 over the corpus, so a
question still returns an answer.
Three retrieval signals are fused via Convex Combination: PPR (graph structure), BM25 (text match), and semantic (embedding similarity). Semantic similarity re-ranks and blends candidates; it is not, on its own, a natural-language front door for the seed-resolving commands.
Device policy.
| Local-backend behavior |
| Metal in a Metal-enabled build; CPU only when Metal is not compiled. A Metal failure is reported; |
| Requires Metal to be compiled and the device plus full model inference probe to succeed; otherwise embedding state is |
| Selects CPU directly and never probes Metal. |
Model selection and cache. The default is the light, fast
sentence-transformers/all-MiniLM-L6-v2 (384-dim, ~90MB) — a good fit for most
repos and CPU-only servers. NestWeaver records the model used for each database,
and the daemon loads that recorded model to avoid dimension mismatches. Daemon
startup is cache-only: it never downloads model files or contacts Hugging Face.
The configured cache_dir expands a leading ~/ against the daemon user's home
directory.
A missing model cache repairs itself. If the recorded model is absent from
the cache, nestweaver embed recovers it in one call — no daemon stop, no
restart. It downloads the missing artifacts, loads them, prints one line ahead
of the normal summary, and exits 0:
nestweaver embed --db /absolute/path/to/brain.lbug
# Downloaded missing embedding model '<id>' into <cache-dir> and loaded it (device: <device>).The daemon repairs itself too, in a bounded background seed. When a boot load
fails because the artifacts are missing, the backend is local, and the database
already carries a verified embedding identity naming that model, the daemon
downloads it in the background after the socket is bound — so boot stays
cache-only and the download never delays it. It is never a first-time download:
with no recorded identity there is nothing to repair and nothing is fetched. At
most 5 attempts, backing off 30s / 2m / 8m / 30m (each jittered ±20%), stopping
early on a permanent error (404, 401, 403, permission denied, ENOSPC). Opt out
with [embedding] auto_repair_cache = false — it defaults to true.
brain status grows a Download: line while a seed is running, naming who
asked for it and which attempt is in flight:
Download: <done> of <total> (automatic repair, attempt N of M)
Download: <done> of <total> (requested by nestweaver embed)
Download: retry N of M in <duration>While a seed is active the embedding state is "seeding". It takes precedence
over every other state, ready included, and reports
degraded_components: ["semantic"].
External embedding endpoints. Instead of a local model you can embed via an
OpenAI-compatible endpoint:
nestweaver embed --endpoint http://localhost:11434 --model nomic-embed-text
(Ollama), or a hosted gateway. For keyed gateways (OpenAI, Azure), set
NESTWEAVER_EMBED_API_KEY — it is sent as a bearer token and is never written
to config, the graph, or a snapshot. An external endpoint is authoritative: a
load or request failure is reported and does not load a local model. Switching
backends requires both an explicit configuration change and re-embedding:
remove external_endpoint, stop the daemon, and replace the recorded external
model metadata/vectors with the chosen local model.
The stop/start recipe below is for an intentional model SWITCH only — it is
the one case that still needs one. It is not the repair for a missing cache:
that is a single nestweaver embed call with the daemon left running, described
above. --force appears here because you are deliberately discarding the
recorded model and its vectors, never because a download is missing:
CONFIG=/absolute/path/to/nestweaver-instance.toml
DB=/absolute/path/to/brain.lbug
MODEL=sentence-transformers/all-MiniLM-L6-v2
CACHE="$HOME/.cache/nestweaver/models"
nestweaver daemon --db "$DB" stop
nestweaver embed --db "$DB" --local --model-id "$MODEL" --cache-dir "$CACHE" --force
nestweaver daemon --db "$DB" start --config "$CONFIG"NestWeaver records the index dimension and rejects mismatched vectors, so any
model/backend switch requires --force. The direct path
(--endpoint/--local) cannot run while a daemon holds the DB write lock; stop
that daemon first or, when the configured daemon backend is already ready, drop
both direct-path flags.
Stopping. nestweaver daemon stop drains in-flight writes with every
listener still up, so reads keep working while it drains (individual reads can
still stall for seconds while a write commits), and an idle daemon exits
immediately. New writes over the gRPC surface are refused with UNAVAILABLE
once shutdown starts, so the drain always finishes (the web admin routes are
outside that gate — see CLAUDE.md). It never SIGKILLs on its own — if a write is still
running it reports what it observed and leaves the daemon up; daemon stop --force or kill -9 end it anyway, abandoning that write. Under a process supervisor (systemd
TimeoutStopSec, launchd ExitTimeOut, Docker stop_grace_period) the
supervisor's own timer still applies. See the
Daemon Shutdown Guide.
Readiness and diagnostics. On macOS, background start/autostart uses launchd
to own a foreground daemon process; daemon run stays in the invoking
foreground. Neither path forks or self-daemonizes. Readiness is published only
after a real embedding inference succeeds. Inspect compile/runtime capability
and the selected backend with:
nestweaver diagnostics capabilities --json
nestweaver daemon --db <path> status
nestweaver brain status --db <path> --jsonThe status reports requested_device, selected_device, and fallback_used.
A local backend is ready only when selected_device is metal or cpu and
fallback_used is false; an external backend has no local selected device.
When semantic retrieval was requested but unavailable, context responses keep
the graph/PPR/BM25 result and report "semantic" in degraded_components
(the only value in that vocabulary today). Every path reports both fields: the
direct, daemon and brain_search paths, and the hybrid/federated merges for
brain_search and for brain_context / project_context. In a merge,
semantic_applied is the AND across contributing tiers and
degraded_components their deduplicated union; when no tier reports either
field the merge omits both, so an absent field still means "not reported by any
tier", never a synthesised false. Caveat: semantic_applied is one boolean,
so a merge in which one tier ranked semantically and the other did not reports
false — correct for the merged row set, which contains lexically ranked rows,
but it does not say which tier was which.
Performance: 7ms query embedding (Metal), 37ms (CPU) for all-MiniLM; heavier models trade speed for quality. Forward Push PPR replaces power iteration for sub-10ms graph walks. LRU cache makes repeated queries instant (~8ms).
Configure the model and fusion weights in instance.toml:
[embedding]
# Shipped default; the model a DB was actually embedded with is recorded and
# auto-loaded by the daemon. Set this to override the default for fresh instances.
model_id = "sentence-transformers/all-MiniLM-L6-v2"
# cache_dir defaults to the platform-native cache directory:
# ~/Library/Caches/nestweaver/models on macOS, $XDG_CACHE_HOME/nestweaver/models
# (or ~/.cache/nestweaver/models) on Linux. Explicit values may use ~/.
# If unavailable or non-UTF-8, a UTF-8 HOME uses ~/.cache first. The final
# fallback is /var/cache/nestweaver/models on Unix or C:\ProgramData\nestweaver\models
# on Windows; set cache_dir explicitly if that system location is not writable.
# cache_dir = "~/Library/Caches/nestweaver/models"
accelerator = "auto" # auto | metal | cpu; see the policy table above
weight_ppr = 0.40
weight_bm25 = 0.25
weight_semantic = 0.35NestWeaver can build a native macOS .app bundle from source. No release
.app bundle or DMG is currently published. A source build provides:
Menubar status icon with quick access to the web UI and daemon status
Metal GPU acceleration — the app launches the daemon as a non-forking launchd Aqua agent, then the daemon proves full model inference before reporting the Metal backend ready (~5x faster: 7ms vs 37ms).
Managed daemon lifecycle — launches the daemon via launchd (which owns crash-restart); the daemon is a shared service (MCP/CLI/UI all use it) and persists across app quits, so the app re-attaches to it on next launch
Daemon coexistence — detects if a daemon is already running (via CLI or launchd) and connects to it instead of starting a second instance
Web UI at
http://127.0.0.1:9377— opens automatically on launch
# Build from source (requires Xcode Command Line Tools)
bash app/build.sh
open target/release/NestWeaver.appThe app is menubar-only (no Dock icon). Click the NestWeaver icon in the menubar to open the web UI or quit. Database is auto-detected from NESTWEAVER_DB, ~/.nestweaver/instance.toml, or ~/.local/share/nestweaver/*/brain.lbug.
When to use the app vs CLI:
Use the app for always-on daemon with Metal GPU, menubar access, and the web UI
Use the CLI (
nestweaver daemon start) for headless/server environments, CI, or if you prefer terminal-only workflows
Group repositories, features, and configuration into named projects using TOML config files. Projects scope queries and context to just the code that matters.
# nestweaver-instance.toml
[[projects]]
name = "payments"
repos = ["payments-api", "payments-worker"]
components = ["checkout", "refunds"]nestweaver project-context "payments" --token-budget 5000Manage multiple repositories as a single graph. NestWeaver discovers cross-repo dependencies, suggests links between related symbols, and lets you query across repository boundaries.
See the Instance Config Guide for full configuration options. If an older database mixes instance_id conventions, the Instance ID Migration Runbook consolidates it.
# Discover cross-repo links
nestweaver suggest-links --db ./all.lbug
# Get context for a feature spanning multiple repos
nestweaver context --feature device-pairing --config ./nestweaver-instance.toml --db ./all.lbugRuntime-configurable defaults — set [limits] in your instance config to replace the builtin a command passes into resolve_limit. That builtin is not one number. Unset, search uses 10, brain search uses 20, and brain context uses 30. Commands whose builtin is DEFAULT_RESULT_LIMIT use 50. code_context is not in that set: it returns up to 500 connected symbols. brain_context is sized by token_budget (default 2000), not by a page size.
[limits]
default_result_limit = 100CLI commands (search, brain search, brain context) also respect this setting when --limit is not explicitly passed. The [response] section controls inline body thresholds.
MCP Server
For manual installation and the proposed official registry listing, see the MCP Registry guide. Registry publication requires a separate npm release and maintainer approval.
NestWeaver exposes 43 tools via the Model Context Protocol, giving any MCP-compatible AI agent structured access to your codebase graph without reading source files directly.
Where that number comes from. The registry is
all_tool_schemas_undecorated()incrates/nestweaver-mcp/src/tools.rs, andtool_doc_tests::all_tools_have_doc_categoriesasserts the documented tool table covers exactlytool_list(false)["tools"].len(). Do not restate the count from memory — read it back off the wire with atools/listcall, or count the registry.
nestweaver mcp --db ./nestweaver.lbug
nestweaver mcp --tools brain_context,brain_search,read_symbols --db ./nestweaver.lbug # allowlist specific tools
# Local MCP sessions connect to the daemon; direct mode is CI-only.
Direct read-only mode advertises 36 tools — the registry minus the seven
names in MUTATING_TOOLS (crates/nestweaver-mcp/src/http.rs):
brain_add_source, brain_remove_source, brain_memory_consolidate,
set_extension, unset_extension, prune_stale, compact_embeddings — and
rejects mutations before dispatch. Daemon-backed stdio exposes all 43.
--lite exposes 6. --tools names are
exact, case-sensitive registry names; unknown, duplicate, empty, or transport-
unavailable names fail at startup instead of silently producing an empty tool
surface.
Every tool schema now carries MCP annotations (readOnlyHint,
destructiveHint, idempotentHint, openWorldHint), derived from the same
MUTATING_TOOLS table, so a client can tell prune_stale from brain_status
on the wire.
Wire change in 9.0.0: result provenance (_meta) moved from the outer
tools/call envelope into the payload, and lost its nestweaver.io/
prefix. The shape is now _meta: { scope, sources, stale_repos } — see
crates/nestweaver-schema/src/provenance.rs. Raw HTTP MCP clients that read
nestweaver.io/sources off the envelope must be updated.
The MCP server automatically starts a background daemon that owns the database. Multiple MCP servers, CLI commands, and IDE integrations can share the same database concurrently without lock contention. The daemon exits after 1 hour of inactivity.
nestweaver daemon status --db ./nestweaver.lbug # check daemon state
nestweaver daemon stop --db ./nestweaver.lbug # stop the daemon manually
pgrep -af "nestweaver daemon" # find running daemons (Linux)43 tools including type-aware context retrieval, confidence-weighted impact analysis (impact_score shows how strongly changes propagate), investigation bundles, co-change detection, dead code analysis, community detection, and vault/notes integration. Use --tools to expose only the tools you need. The --tools/--lite allowlists are enforced on every transport (local stdio, daemon proxy, hybrid, and MCP-over-HTTP), and tool schemas validate their arguments — numeric bounds (e.g. token_budget 1–16000, depth/max_depth 1–15) are enforced and unknown argument names are rejected instead of silently ignored.
Key capabilities
Type-aware call resolution — AST-extracted type bindings (annotations, constructors, self/this, return types) resolve
obj.method()calls to the correct target classConfidence-weighted blast radius —
impact_scoredecays multiplicatively through edges; low-confidence paths are prunedCo-change mining — Jaccard-scored file pairs from git history surface files that always change together
MRO walk — inherited methods resolved via class hierarchy traversal (depth 5, cycle-safe)
External MCP servers can be configured in your instance config with timeout_secs (default 30):
[[mcp_servers]]
name = "wiki-mcp"
command = "wiki-mcp"
timeout_secs = 60Web UI
A search-first, task-lens workspace over your code+notes graph, powered by Three.js/React-Three-Fiber. The landing view is a repo-galaxy constellation — one luminous cluster per repository — rendered dark-first with selective HDR bloom, in-scene SDF labels, and a procedural nebula backdrop. Everything encodes meaning: color = kind, size = importance, and Spark-green convergence rings mark betweenness bridges (architectural chokepoints).
nestweaver ui --db ./nestweaver.lbug --port 8080
nestweaver ui --db ./nestweaver.lbug --port 8080 --watch # live re-indexingWork by task, not by graph theory:
Workspace scope — switch between all indexed content, a single repo, or a vault; every view carries an honest trust chip (local-only / federated, current / stale, partial / truncated)
Command bar (
⌘K) + Search Phrases — plain-language queries resolve to typed scenes deterministically:impact of <symbol>,trace flow from <symbol>,callers of <symbol>,path from <A> to <B>,notes about <topic>,backlinks for <note>,hubs in <repo>,dead code in <repo>,stale reposTask lenses — Overview, Context, Impact (layered blast-radius DAG with affected tests and local/org trust states), Trace (execution stepper), Repos, Features, Local neighborhood
Tri-panel workspace — activating a node opens a focused graph, synced source/note evidence, and a knowledge card (identity, role, evidence, relationships, trust, next actions), cross-highlighted
Graph / table / JSON parity — every result set is inspectable as a graph, an accessible table, or raw JSON with provenance/trust
_metaDeep links restore workspace scope, selected node, active lens, and representation mode
Visual & motion (all gated behind prefers-reduced-motion, which the UI auto-detects):
Selective HDR bloom via Khronos PBR-Neutral tone mapping — loud only on focus, hubs, and bridges; the ambient field stays calm
In-scene SDF text labels with collision-aware placement (labels never overlap nodes) and a landmark hierarchy that reveals detail on zoom
Per-galaxy glowing edge web, hub coronas, and settle-and-freeze force layout that preserves spatial memory across re-indexing
Signature moments: repo-galaxy ignition on load and a focus impact-ripple that traces blast radius
Community overlay (Louvain), minimap, and an explicit System / Light / Dark theme control
Accessibility: all six task journeys have a keyboard-only path; reduced-motion preserves every static meaning channel; graph answers always have a table/JSON equivalent; a screen-reader landmark summary mirrors the canvas.
WASM mode — Append ?engine=wasm to load a WebAssembly copy of the graph snapshot. The browser downloads a MessagePack snapshot and the status bar shows its node and edge counts. Queries, including PPR, run on the server. Requires building the wasm first (use --remap-path-prefix so the build
machine's home path isn't baked into the artifact):
RUSTFLAGS="--remap-path-prefix=$HOME=/build" wasm-pack build crates/nestweaver-wasm --target web --out-dir ../../crates/nestweaver-web/frontend/src/wasm.
Keyboard shortcuts (press ? in the UI for the full list):
1–6— switch task mode (Overview, Context, Impact, Repos, Features, Local)⌘K— open the ask / Search-Phrase command bar ·/— focus search⌘L— cycle graph / list / matrix representation ·⌘⇧G— toggle zen (canvas-only) layoutI— impact of selected ·P— path from selected ·M/C/T— minimap / communities / tags⌘Z/⌘⇧Z— navigate history back / forward ·Esc— clear selection
Architecture
Crate | Description |
| Node/edge types, UIDs, confidence scoring, schema versioning |
| Tree-sitter + regex parsing for 32 languages |
| Cross-file symbol resolution with import graphs, monorepo workspace packages, and tsconfig path aliases |
| LadybugDB graph store, PageRank, hybrid search |
| Pluggable snapshot storage backends (local, S3, GitLab) |
| Indexing pipeline, query dispatch, config, snapshots, LLM integration |
| Pure-compute graph algorithms (PPR, impact BFS) — WASM-compatible, no I/O |
| Local embedding models (candle; Metal GPU on macOS) for vector search |
| gRPC service definition (protobuf) for daemon IPC |
| Federation coordinator — upstream routing, health/ejection, two-tier merge, staleness (leaf; used by client + daemon-mode mcp) |
| Background daemon — owns the database, serves gRPC over Unix socket |
| Daemon client with auto-start, flock-based race prevention, version check |
| MCP server — proxies tool calls through the daemon |
| Web UI (Three.js/R3F) and Axum API backend |
| Browser-side WASM module wrapping nestweaver-algorithms |
schema (zero internal deps)
<- parser
<- resolver
<- store
algorithms (zero internal deps — WASM target)
<- wasm
storage (zero internal deps)
proto (generated gRPC types)
federation (leaf: schema + proto — upstream routing/merge/staleness)
<- engine <- (parser, resolver, store, storage, algorithms)
<- daemon <- (engine, store, mcp, proto)
<- client <- (proto, daemon, federation)
<- mcp <- (engine, store, schema; proto + federation under the `daemon` feature)
<- webPerformance
71ms query p50 Next.js — 29,402 files
632ms incremental re-index Tailwind CSS — no full rebuild needed
14.8M edges extracted Elasticsearch — 511K symbols, 43K files
Query Speed (p50)
Repository | Files | NestWeaver | Graphify |
Tailwind CSS | 542 | 157ms | 185ms |
Deno | 14,136 | 82ms | 1,355ms |
Next.js | 29,402 | 71ms | 2,440ms |
Elasticsearch | 43,806 | 617ms | crashed |
Indexing Speed
Repository | NestWeaver | Graphify |
Tailwind CSS | 3.6s | 2.5s |
Deno | 51s | 33s |
Next.js | 33s | 111s |
Elasticsearch | 3,462s | crashed |
Incremental re-indexing (NestWeaver only — Graphify requires full re-index): 632ms (Tailwind), 4.0s (Next.js), 73s (Elasticsearch).
Graph depth: NestWeaver extracts 142K symbols / 280K edges on Deno (vs Graphify's 76K / 177K). On Elasticsearch: 511K symbols, 14.8M edges.
Result quality: NestWeaver returns ~30 connected symbols per query ranked by PageRank with full signatures. Graphify returns file-level nodes with 9-15% garbage stubs.
Benchmarked in daemon mode on M3 Pro (36 GB). See benchmarks/ to reproduce.
Contributing
See CONTRIBUTING.md for guidelines on building, testing, and submitting changes.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Hosted code graph over MCP: exact callers, dependencies, and cross-repo blast radius for AI agents.
Repository knowledge graph MCP server for codebase understanding and debugging.
Shared context for your codebase: a hosted code knowledge graph over MCP. Free plan, OAuth sign-up.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides a dynamic SQLite-backed code knowledge graph for AI assistants, with MCP tools to inspect symbols, find dependency paths, and analyze code structure across multiple languages.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to locally search, query, and understand codebases with token-efficient context, dependency graphs, history, architecture diagrams, and metrics through MCP.15 npm3MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents to query a local, continuously updated symbol graph of a codebase, providing ranked search, caller/callee exploration, dependency paths, and git-diff impact analysis through MCP tools.3 npmApache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables coding agents to query a local, multi-repo code graph for symbol exploration, blast radius analysis, co-change mining, and durable code-anchored memory via MCP tools.271 npm16Business Source 1.1