Skip to content

sebiomoa/codelens

Repository files navigation

CodeLens

Local-first AI code review dashboard. Auto-detects AI CLIs on your machine, watches your repos for new commits, and gives you automated reviews without sending code anywhere.

No API keys. No external servers. Everything runs on your computer.

CodeLens Dashboard

What it does

  • Auto-detects providers - finds Claude Code, Ollama, Gemini CLI, or OpenAI CLI on your machine. No config needed.
  • Watches repos - polls your local git repos for new commits every 60 seconds and triggers reviews automatically.
  • Reviews commits - sends the diff through your installed AI tool, parses the structured response into findings.
  • Reviews entire codebases - deep review mode scans all source files, not just the latest diff.
  • Tracks fix status - when a new commit modifies a file with open findings and the issue no longer appears, it marks the finding as fixed.
  • 3-panel review view - findings on the left, code diff in the center, suggested fixes and copy-paste prompts on the right.
  • Exports as Markdown - download any review as a formatted .md file for PRs, Notion, or client reports.
  • Notifications - bell icon with unread count, tracks all review completions across repos.
  • Fun loading messages - 500 rotating messages with pastel colors while reviews run.

Who it's for

  • Solo developers with no one to review their code
  • Freelancers managing multiple client repos
  • Privacy-conscious devs who can't send code to third-party APIs
  • Small teams without formal code review processes
  • Vibe coders who want a second pair of eyes

Quick start

# Clone the repo
git clone https://github.com/sebiomoa/codelens.git
cd codelens

# Install dependencies
npm install

# Set up the database
npm run db:migrate

# Start the app
npm run dev

Open http://localhost:3377 in your browser.

Adding a repo

  1. Click Add Repo on the dashboard (opens a side drawer)
  2. Click Browse to pick a folder, or type the path manually
  3. The folder picker highlights git repos with a green badge
  4. Pick a provider from the dropdown (only shows installed ones)
  5. Hit Add. CodeLens immediately reviews the last 30 days of commits in the background.

Or go to Settings to manage repos, toggle them on/off, or remove them.

Supported providers

Provider How it works Auto-detected via
Claude Code Pipes diff to claude CLI via stdin claude --version
Ollama HTTP API at localhost:11434 GET /api/tags
Gemini Pipes diff to gemini CLI via stdin gemini --version
OpenAI Pipes diff to openai CLI via stdin openai --version

You don't configure these. If the CLI is installed, it shows up on the Settings page as "Available". If it's not, it shows "Not available".

How reviews work

  1. The watcher detects new commits (polls every 60s)
  2. Extracts the git diff, respecting ignore patterns
  3. Splits large diffs into chunks that fit within context limits
  4. Pipes each chunk to your selected provider via stdin
  5. Parses the structured JSON response into findings
  6. Stores everything in a local SQLite database
  7. Marks previously open findings as fixed or stale based on what changed

Each finding includes: file path, line number, severity (critical/warning/info), category (bug/security/performance/style/logic), description, suggested fix, and confidence score.

Deep review

On any repo detail page, click Deep Review to scan the entire codebase, not just the latest commit. This reads all tracked source files (skipping binaries, lock files, and files over 100KB), chunks them, and sends to the AI for a full audit.

Review page

The review detail page has three panels:

  • Left - compact list of findings. Click one to select it. Shows severity dots, category, and file path. Expands to show full description and suggested fix when selected.
  • Center - the actual code diff with old/new line numbers. Green for additions, red for removals. Colored dots on lines that have findings. Clicking a finding scrolls the diff to the relevant line.
  • Right - details for the selected finding: full description, suggested fix code block, and a ready-to-paste prompt for your AI chat. Also has a Copy All dropdown with options to copy findings only, findings + suggestions, or findings + suggestions + prompts. Plus Export as Markdown to download the review as a file.

Finding status tracking

Findings have three states:

  • open - issue exists, not yet addressed
  • fixed - a later commit modified the file and the same issue category was no longer flagged
  • stale - the file was modified but a similar issue still exists

Fixed findings appear dimmed with a green "fixed" label. This happens automatically, no manual marking needed.

Notifications

The bell icon in the sidebar shows unread review notifications with a count badge. Click to see recent reviews across all repos with finding counts and status. Read state persists in localStorage. Polls every 10 seconds.

Dashboard

  • Stat cards: total repos, reviews this week, findings this week, critical count
  • Repo table with search, provider badges, review count, last reviewed time, status
  • Review Now button with 500 rotating fun messages and pastel colors
  • Add Repo side drawer with folder picker
  • Sticky table header, viewport-locked layout (no page scroll)

Configuration

The app works out of the box with zero config. If you want to customize:

// codelens.config.json
{
  "port": 3377,
  "repos": [],
  "provider": {
    "default": "claude-code",
    "ollama": {
      "baseUrl": "http://localhost:11434",
      "model": "codellama"
    }
  },
  "watch": {
    "interval": 60,
    "ignorePatterns": ["*.lock", "node_modules/**", ".next/**", "dist/**"]
  },
  "review": {
    "confidenceThreshold": 70,
    "maxDiffSize": 50000
  }
}

Tech stack

  • Next.js 16 (App Router) with Turbopack
  • SQLite via Drizzle ORM, zero setup
  • Lucide icons
  • Google Sans + Google Sans Code typography
  • Custom component library (no browser defaults): Button, Input, Select, Toggle, Modal, Drawer, Badge, Card, Toast, FolderPicker, EmptyState

Project structure

app/
  api/                    # REST API
    browse/               # Filesystem browser for folder picker
    notifications/        # Review notifications
    providers/            # Provider detection + per-provider check
    repos/                # Repo CRUD + reviews per repo
    review/               # Manual review trigger + deep review
    reviews/              # Review detail + finding dismissal
    stats/                # Dashboard statistics
  components/
    ui/                   # Reusable component library
    diff-viewer.tsx       # Code diff renderer
    notification-bell.tsx # Notification dropdown
    review-button.tsx     # Review button with fun messages
    severity-badge.tsx    # Severity dots
  repos/[id]/             # Repo detail page
  reviews/[id]/           # Review detail (3-panel split)
  settings/               # Provider detection + repo management
lib/
  db/                     # Drizzle schema, connection, stale cleanup
  providers/              # Claude Code, Ollama, Gemini, OpenAI adapters
  reviewer/               # Orchestrator, diff chunking, prompt, parser
  watcher/                # Git operations, polling scheduler

Scripts

npm run dev           # Start the app (includes watcher)
npm run build         # Production build
npm run db:generate   # Generate a new migration
npm run db:migrate    # Run migrations
npm run db:studio     # Open Drizzle Studio

Contributing

CodeLens is currently maintained solo. See CONTRIBUTING.md for details.

Provider adapters are the easiest way to contribute. Each one is a single file in lib/providers/ implementing the Provider interface:

interface Provider {
  name: string;
  isAvailable(): Promise<boolean>;
  review(request: ReviewRequest): Promise<ReviewResponse>;
}

Bugs and feature requests

License

MIT

About

Local-first AI code review dashboard. Auto-detects AI CLIs on your machine, watches your repos, and gives you automated reviews without sending code anywhere.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors