newxlens 0.1 — now on npm→

Analytics that read your code— and fix what they find.

xlens maps every click to component → file:line, watches real sessions on your own server, and opens pull requests for the engineering, UX and UI problems it finds. Then it checks that the fix actually worked.

★ Star on GitHub
  • ~4 KBbrowser SDK, gzipped
  • file:linefor every click
  • 0cloud dependencies
  • 1 PRper issue, verified
shop — src/pages/Checkout.tsx⎇ main
~/shop ❯ npx xlens issues --kind validation-loop
UX-0003 high ux fixable Postcode rejected 3.1× per session [pr-open .../pull/128]
fix verified: 41% → 3% of sessions in build c19a0e2 (n=812, p<0.001)
~/shop ❯
01 — the loop

From a click in production to a merged fix, in one pipeline.

Most analytics tools record behaviour and work backwards to the code. xlens starts from the code, so every issue already knows its file, and so does the fix.

A tiny SDK records what people do, never what they type.

Clicks, navigation, form validity, API timing, errors and vitals. Field values never leave the browser, query strings are stripped, and routes are normalised.

src/main.tsxts
import { init } from '@xlens/sdk';

init({
  endpoint: 'https://ux.internal.example.com/v1/e',
  app: 'shop',
});
02 — what it finds

22 issue types across engineering, UX, UI and product.

Every issue is ranked by reach and cost, keeps a stable id across runs, and is marked resolved when it stops appearing. Open a file to see how it's detected.

ISSUES
▾ engineering/
▾ ux/
▾ ui/
▾ product/
issues/ux/validation-loop.md
kindvalidation-loop
categoryux
detectedThe same field rejected again and again in one session.
fixable✓ auto-fix → PR
examplepostcode rejected 3.1× per session · Checkout.tsx:35

// Where people struggle, even when nothing throws.

03 — in your agent

Hand production issues to the agent you already use.

xlens mcp is a stdio MCP server. Your agent gets the issue, the evidence, the timelines and the source with line numbers: the same brief xlens fix uses. It reports the result back to your server.

terminalbash
claude mcp add xlens -e XLENS_TOKEN=… -- npx xlens mcp
agent session
  1. youfix the worst open xlens issue
  2. toollist_issues(minSeverity: "high", fixable: true)
  3. → UX-0003 validation-loop · Postcode rejected 3.1× per session
    → UX-0001 dead-click · "Apply" on /cart
  4. toolget_issue("UX-0003")
  5. → evidence · 41% of checkout sessions · regression in b7d2e41
    → src/pages/Checkout.tsx:35 · pattern="[0-9]{6}"
  6. agentedits Checkout.tsx · runs tests · opens PR #128
  7. toolrecord_fix("UX-0003", "pr-open", pr: "…/pull/128")
  8. → recorded · will verify on the next build
04 — architecture

Three places, and nothing leaves them that shouldn't.

The server never needs your source code or an internet connection. The machine that fixes never needs your users' data, only the issues. Credentials stay where they already are.

01your users' browsers
@xlens/sdk · ~4 KB
  • clicks, nav, forms
  • API timing, errors
  • vitals, visibility
⊘ never sends input values
02your server (on-prem)
xlens serve
  • every session → events.db
  • analysis every 15m
  • issues.log · report · admin API
⊘ never needs your source
03a dev machine or CI
xlens fix · xlens mcp
  • worktree → fix → checks
  • commit → push → gh pr
  • your git + gh credentials
⊘ never sees users' data

// app model: xlens scan --push after each release, from build plugin → server

05 — safety model

Strict by default. Lint rules you can't turn off.

✔ xlens/no-input-values error

No input values, ever.

The SDK sends field names, lengths and validity, never what was typed. Query strings are stripped and routes normalised. Do-Not-Track and Global Privacy Control are respected.

✔ xlens/labels-from-controls-only error

Text comes from controls only.

Up to 40 characters from buttons, links and form controls. Emails become <email> and runs of digits become <num> before anything is sent. Turn it off with captureText: false.

✔ xlens/evidence-is-untrusted error

Evidence is untrusted.

Labels and errors come from browsers, so the fix engine gets them as data. Its tools can't reach anything outside the repo's editable folders and your configured checks.

✔ xlens/humans-merge error

Humans merge.

xlens only ever opens PRs, with one commit per issue, so a reviewer can drop any of them. Manifests, lockfiles, CI and .env files are off limits.

06 — compare

Not another dashboard. The step after it.

Playwright tests what you expect users to do. Session tools show what they did. xlens finds what they actually hit, traces it to the line, and fixes it. Use it alongside the tools you already have.

CapabilityxlensPlaywrightPostHogFullStory / LogRocketSentryDatadog RUM
Maps findings to component → file:lineOthers map JS errors through source maps, but not clicks, forms or UX issues.✓———◐◐
Real-user sessionsPlaywright drives scripted, synthetic browsers.✓—✓✓✓✓
Dead and rage clicks✓—✓✓✓✓
Root cause found in codeFor example, a validation pattern that rejects its own placeholder.✓———◐—
Funnels from real paths✓—✓✓—◐
Writes the fix and opens a PRAI fix features elsewhere focus on errors and exceptions.✓———◐◐
Verifies the fix on later buildsxlens runs a one-sided z-test on the issue rate in builds after the fix.✓———◐—

✓ yes · ◐ partly · — no · Based on public docs as of Nov 2026. Spotted a mistake? Open an issue.

Full comparison →
07 — pricing

One plan. It's free.

package.json
"license": "MIT"
$0/ forever · self-hosted
  • Every detector: engineering, UX, UI, product
  • Unlimited apps, sessions and retention
  • Auto-fix PRs with your own model key or CLI agent
  • Fix verification on later builds
  • MCP server for Claude Code, Cursor, Codex
  • Self-hosted: Node + SQLite, no cloud
Read the docs →
cloud.ts
// TODO: xlens cloud

A hosted server for teams that would rather not run one. Same detectors, same PRs.

Join the waitlist
Is it actually free?

Yes. xlens is MIT licensed and runs on your own infrastructure. The only cost is the model tokens for auto-fixes, billed by your own provider. Plug in a CLI agent instead and that cost is whatever you already pay.

What does it need to run?

Node 22.13+ for the server (it uses node:sqlite, so no native dependencies). React apps with Vite, webpack, Rollup, esbuild, Rspack or Next.js. More frameworks are on the roadmap.

Will there be a paid cloud?

Maybe later, for teams that would rather not run a server. Self-hosted xlens will stay free and complete.

Where does my data go?

Nowhere you don’t control. Sessions stay on your server, source stays on your machines, and fixes go through your own git and gh logins.

Ship it. xlens will tell you what broke, and fix it.

zsh — ~/your-app
❯ npm i @xlens/sdk && npm i -D @xlens/plugin @xlens/cli
❯ npx xlens init
Created xlens.config.json
❯ 
★ Star on GitHub