Open Source
Code is a graph.
Query the structure.
LENS maps your repo — import graph traversal, co-change analysis, hub detection, TF-IDF scoring — and delivers ranked results in one call. Fewer tokens wasted, smarter output.
$ npm install -g lens-engineHow It Works
Three commands. No API keys. Your code never leaves your machine.
Install & Start
Install the CLI globally and start the background daemon.
$ npm install -g lens-engine$ lens daemon start
Register & Index
Register a repo — indexing kicks off automatically. TF-IDF, import graph, and git history in one pass.
$ lens register .Registered: my-projectScanning files... 847 filesBuilding import graph... doneAnalyzing git history... doneIndex complete in 2.3s
Query
Search with pipe-separated terms. Get ranked results with structural context.
$ lens grep "auth|middleware|session"[auth] 12 resultssrc/middleware/auth.ts [hub] 0.94importers: routes/login.ts, routes/api.tssrc/lib/tokens.ts 0.87importers: middleware/auth.ts...
Right Context, Right Code
AI agents are only as good as the files they see. LENS gives them structural context — not just string matches.
Ranked Code Search
Pipe-separated term search with TF-IDF scoring, path weight, exports, and docstrings. Hub files surface first — the files that actually matter.
Import Graph
Full dependency graph traversal and hub-file detection. See which modules depend on which, drill into directories, or inspect a single file's neighborhood.
Git Co-Change
Files that change together get surfaced together. Co-change analysis catches cross-cutting concerns grep never finds.
MCP Native
Add LENS to .mcp.json — HTTP Streamable transport at localhost:4111/mcp. Claude Code, Cursor, and any MCP-compatible agent calls lens_grep, lens_graph, and lens_graph_neighbors.
Your Code Stays Local
Everything runs on your machine. No code leaves your laptop. No cloud dependency. Works offline, works air-gapped.
One Call, Done
One lens_grep call replaces dozens of Grep/Glob tool calls. Per-file: relevance score, exported symbols, importers, co-change partners. Under 1s cold.