Lens

•

Provides token-efficient code and documentation retrieval for AI agents through FTS5 search, symbol outlines, and surgical line reads.

Lens is designed to optimize how AI agents interact with codebases and documentation, significantly reducing token consumption. It achieves this by allowing agents to search for ranked code snippets, obtain structural outlines of files, or perform surgical reads of specific line ranges, eliminating the need to process entire files. This zero-dependency tool, built on Node.js with SQLite FTS5, drastically cuts down on LLM costs and improves retrieval efficiency for complex coding tasks. It also features a web-based explorer that mirrors the agent's view, providing a human-readable interface for search, navigation, and understanding codebase structure.

Características Principales

01Token-efficient FTS5 search for ranked code and documentation snippets within a budget.
02Perform surgical line range reads for precise context retrieval.
03Generate symbol outlines (functions, classes, headings) for files without full reads.
04Incremental indexing of repositories, updating only changed files.
05Web explorer (`lens serve`) for human-browsable, token-budgeted code search and navigation.
060 GitHub stars

Casos de Uso

01Allowing AI agents to efficiently find relevant code sections without wasting tokens on entire files.
02Quickly understanding the structure of a codebase or file using symbol outlines.
03Analyzing where a specific symbol or function is used across a repository.
04Browsing code with a human-centric web explorer that mimics an agent's token-budgeted view.