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.

Terminal
$ npm install -g lens-engine

How It Works

Three commands. No API keys. Your code never leaves your machine.

01

Install & Start

Install the CLI globally and start the background daemon.

$ npm install -g lens-engine
$ lens daemon start
02

Register & Index

Register a repo — indexing kicks off automatically. TF-IDF, import graph, and git history in one pass.

$ lens register .
Registered: my-project
Scanning files... 847 files
Building import graph... done
Analyzing git history... done
Index complete in 2.3s
03

Query

Search with pipe-separated terms. Get ranked results with structural context.

$ lens grep "auth|middleware|session"
[auth] 12 results
src/middleware/auth.ts [hub] 0.94
importers: routes/login.ts, routes/api.ts
src/lib/tokens.ts 0.87
importers: 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.