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 --version
npm 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.lbug
search 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 index run from inside your repo also offers setup.
The prompt is skipped in CI, scripts, and non-TTY runs; index --setup
explicitly requests setup at the indexed repo root. Use setup --force only
when you want to overwrite customized skill/guide files or rebind an existing
registration to a different --db (a changed --db is reported otherwise).
It never overwrites .github/copilot-instructions.md, or an AGENTS.md
without NestWeaver's begin/end markers.
# Keep the graph current as you edit (runs until interrupted)
nestweaver watch . --db ./nestweaver.lbug
Run 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.
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.
12.2.8 uses resolver generation 24 and parsed cache 18. Re-index each
repository to pick up corrected declaration spans, Rust module call edges, and
partial SQLite parse diagnostics. Markdown derivation version 4 refreshes
eligible vaults on daemon startup.
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.8
requires resolver generation 24 (12.2.7 used 23). If your binary reports a generation-stale graph, run
nestweaver index --repo <path> --db <db> --force for 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
export identifiers. 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-check
continues 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 function aliases
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
var slices, 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.8 needs a forced re-index of every repository. Run
nestweaver index --repo <path> --force once per repository, using your usual
--db and --config bindings. Plain incremental indexing can leave an
unchanged graph on its old generation. stale-check exits 2 until repaired.
- Refresh any vault that still reports stale Markdown derivation. 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: