CodeLens
Turns a pull request or local diff into an interactive brief, review queue, and impact map of callers, callees, and external effects.
At a Glance
Self-hosted CLI core under Apache-2.0; bring your own model (external costs not charged by the tool).
Engagement
Available On
Alternatives
Listed Nov 2026
About CodeLens
CodeLens is an open-source tool by blong8334 that helps reviewers understand and check pull requests, including AI-written ones. It opens a GitHub PR, local branch, or patch file as a brief, then walks through the change in a review queue with call-graph context. It can also explore whole codebases and is licensed under Apache-2.0.
What It Is
CodeLens is a code review and code exploration tool that runs from the command line and opens a local web canvas. It parses code with Tree-sitter in 15 languages, and TypeScript and JavaScript also get type information from the TypeScript compiler. The model writes the explanations, while the checks come from the code itself: the call graph, who depends on each change, broken signatures, and what each change touches.
How a Review Works
A review opens on a brief covering what the change does and why, concrete risks, things to check, and where to start reading. The review queue then presents one change at a time with its own diff and inline comments, its callers (marking those outside the change), the routes, CLIs and jobs that reach it, and the databases and APIs it touches. Keyboard shortcuts accept a change, move between changes, comment, open the whole-file diff, or jump to the map. For GitHub PRs, discussion threads are attached to the relevant functions, and users can comment, approve, or request changes. Patch files from other review tools can be reviewed against a local clone.
Exploring a Codebase
The explore command produces a guide to a package with what it is, a suggested reading order, and its parts, plus a map of systems, modules, entry points, and hotspots. Graphs can be exported without source code for sharing.
Models, Storage, and CI
Users bring their own model: Claude through Claude Code or the API, any OpenAI-compatible API including local Ollama, or an offline heuristic mode. Results are cached by content in SQLite or a shared Postgres store, so re-reviews only analyze what changed. A GitHub Action posts the review as a PR comment, can fail on high risk, and attaches the map as an artifact. Users can also write review preferences in a markdown file.
Community Discussions
Be the first to start a conversation about CodeLens
Share your experience with CodeLens, ask questions, or help others learn from your insights.
Pricing
Open Source (Apache-2.0)
Self-hosted CLI core under Apache-2.0; bring your own model (external costs not charged by the tool).
- Licensed under Apache-2.0
- Run via npx or npm install -g @blong8334/codelens
- 15 languages parsed with Tree-sitter
- Bring your own model: Claude, OpenAI-compatible API, or Ollama
- Offline heuristic fallback without a model
Capabilities
Key Features
- Brief of what a PR does, risks, things to check, and reading order
- One-at-a-time review queue with per-function diffs and inline comments
- Impact map of callers, callees, and external effects
- Entry point detection for routes, CLIs, and jobs
- Sink detection for databases, APIs, queues, and filesystems
- Breaking signature change and invariant-at-risk detection
- Codebase explore mode with guide, hotspots, and overview map
- 15 languages parsed with Tree-sitter plus TypeScript type information
- Bring-your-own model: Claude, OpenAI-compatible APIs, Ollama, or offline heuristics
- Content-keyed SQLite or Postgres store
- GitHub PR discussion threads, comments, approve and request changes
- GitHub Action posting PR review comments
- Patch file review for non-GitHub tools
- Ask panel for questions about a change
- Custom review preferences file
- CI failure threshold on risk level
