Track costs, analyze sessions, and compare efficiency across 9 AI CLIs — fully offline, fully private.
English · Português (BR)
Features · Quick Start · Stack · Integrations · Changelog · Contributing
Sessions![]() |
Analytics![]() |
Budgets![]() |
(Dashboard shown above) |
Most teams juggling multiple AI coding CLIs can't answer basic questions: which CLI is cheapest? which is most reliable? where is the money going? Sessionlens answers them by reading the on-disk artifacts each CLI already produces — no scraping, no proxies, no cloud. Your data never leaves your machine, every cost is tagged actual or estimated, and you can be productive in 60 seconds after pnpm install.
| Feature | Description |
|---|---|
| Multi-CLI | 9 supported CLIs: Codex, Claude Code, OpenCode, Gemini CLI, Kimi, Aider, Qwen, Antigravity, and CommandCode |
| Cost tracking | Real CLI cost, token-based estimation, and OpenRouter sync for up-to-date pricing. Confirmed vs. estimated spend shown separately |
| Smart sessions | Tokens (input/output/cache/reasoning), tool calls, duration, project context, per-model usage breakdown |
| Auto-ingestion | Filesystem watcher with debounce; incremental checkpoints skip unchanged files automatically |
| Feature | Description |
|---|---|
| Analytics | Dashboard with contextual filters, spend trends, breakdowns by model/provider/project, and dedicated insight/anomaly pages |
| Data reliability | Per-field quality, adapter drift counters, captured tools, touched files, and per-CLI coverage in Settings and Session Detail |
| Budgets | Global, per-project, CLI, provider, or model limits with local alert history |
| Full-text search | Search across session IDs, project paths, and full message content with result snippets |
| CSV export | Export filtered sessions and analytics breakdowns to CSV directly from the UI |
| Project controls | Hide/restore projects without deleting data; open folder; follow git timeline and related sessions |
| Premium UI | Sessionlens design system — DataPanel, DataTable, FigurePanel, CompactStat, ControlField, skeleton states, and tooltips |
| Themes | Dark and light mode with refined contrast, accessible chart palette, and localStorage persistence |
| Feature | Description |
|---|---|
| Privacy & security | Opt-in redaction of sensitive tool inputs; CORS restricted to localhost; no error details exposed to clients; git calls use execFileSync (no shell injection) |
| Local-first | SQLite via sql.js WASM — zero data sent externally, zero telemetry, zero accounts |
| i18n | English and Português (PT-BR) with localized dates, durations, currencies, and insight labels |
Full history in CHANGELOG.md.
- Overview forecast: new dashboard tile projecting month-end spend via linear regression on the last 7 days
- CLI comparison card: per-CLI cost/tool-call/token efficiency surfaced on the project detail page
- Extended thinking metrics: dedicated analytics surface for reasoning/thinking token usage
- Full-text search for messages: SQLite FTS5-backed search on the Sessions page with result snippets
- README & CONTRIBUTING overhaul: restructured hero, 2-row shields.io badge block, grouped Features, new
Contributingpointer - Removed tray feature: dropped the system tray and related Settings entries
- CI order fix: test step now runs before coverage so failures stop the pipeline earlier
git clone https://github.com/melloxyz/sessionlens.git
cd sessionlens
pnpm install
pnpm devFrontend: http://localhost:5173 — Backend API: http://127.0.0.1:3030
| Command | Description |
|---|---|
pnpm dev |
Full stack (backend + frontend) |
pnpm build |
Production build |
pnpm typecheck |
Typecheck across all packages |
pnpm lint |
Lint across all packages |
pnpm -r test |
Run test suite |
pnpm --filter @sessionlens/backend diagnose:adapters |
Local adapter diagnostic (capabilities, sources, quality) |
pnpm --filter @sessionlens/backend backfill:quality |
Idempotent backfill of tools, files, and data quality |
| Layer | Technology | Version |
|---|---|---|
| Runtime | Node.js | >= 20 |
| Package manager | pnpm | >= 9 |
| Language | TypeScript | 5.x |
| Backend | Fastify | 5.x |
| Database | SQLite via sql.js | WASM |
| Frontend | React + Vite | 18 / 6.x |
| Styling | Tailwind CSS | v4 |
| Charts | Recharts | 2.x |
| Icons | Lucide React | latest |
| Pricing | OpenRouter API | sync |
Adapters write RawSession, the ingestion engine normalizes/dedups/costs, and the frontend queries through Fastify.
sessionlens/
├── assets/
│ ├── logo/ # Black and white logos (theme-aware)
│ └── screenshots/ # UI screenshots
├── packages/
│ ├── backend/ # Fastify + sql.js + adapters + costing
│ ├── frontend/ # React + Vite + Tailwind v4 + Recharts
│ └── shared/ # Shared TypeScript types
├── scripts/ # Dev orchestration (Windows-safe)
├── .github/workflows/ # CI + Release (git-cliff)
└── CHANGELOG.md
- Fastify on
127.0.0.1:3030with CORS restricted to the configured frontend URL - SQLite via sql.js WASM — in-memory, persisted via atomic write + rotated backups
- Adapters (
claude,codex,opencode,gemini,kimi,aider,qwen,commandcode,antigravity) each emitRawSession; the ingestion engine owns normalization, costing, dedup, and upsert - Costing engine:
cost_sourcefield withactual/estimated/unknown; OpenRouter pricing synced at startup - Incremental ingestion: file-level checkpoints skip unchanged sources;
backfillEstimatedCostsscoped to touched sessions only - Privacy: opt-in
redactflag strips sensitiveinput_jsonand message content before storage
- Vite dev server on port
5173with/apiproxy → backend - Components:
DataPanel,DataTable,FigurePanel,FigureGrid,CompactStat,ControlField,MetricBlock,QueryBar,SectionHeader,AlertStrip,Skeleton - Themes: dark/light with CSS variables and refined contrast
- Languages: EN / PT-BR via
LanguageProviderwith locale-aware formatting - Cache: TTL + size-limited response cache, invalidated after ingest
- TypeScript types:
Session,CliProvider,SourceConfidence,SessionFilters,PaginatedResponse, etc. - Shared between backend and frontend to keep the API contract consistent
| CLI | Status | Data location | Confidence |
|---|---|---|---|
| Codex CLI | ✅ Supported | ~/.codex/state_5.sqlite + rollout JSONL |
HIGH |
| Claude Code | ✅ Supported | ~/.claude/projects/**/*.jsonl |
MEDIUM |
| OpenCode | ✅ Supported | ~/.local/share/opencode/opencode.db |
HIGH |
| Gemini CLI | ✅ Supported | ~/.gemini/tmp/**/chats/*.jsonl |
HIGH |
| CommandCode | ✅ Supported | ~/.commandcode/projects/**/*.jsonl + .meta.json |
HIGH |
| Kimi CLI | ~/.kimi/sessions/**/context.jsonl or KIMI_SHARE_DIR |
PARTIAL | |
| Aider | .aider.chat.history.md + .aider.llm.history |
PARTIAL | |
| Qwen CLI | ~/.qwen/sessions/**/*.json |
PARTIAL | |
| Antigravity | ~/.gemini/antigravity/ |
PARTIAL |
Each adapter is isolated — a schema change in one CLI does not affect the others. Confidence reflects the quality and completeness of data exposed by each source. Where CLIs don't expose cost, tokens, or tools, Sessionlens preserves what's available and flags the gap.
Contributions of any size are welcome — code, documentation, bug reports, new CLI adapters, and translations.
- Good first issues: label:good-first-issue
- Full contributor guide: CONTRIBUTING.md
- Code of conduct: this project follows the Contributor Covenant spirit (informal — no separate file yet).
github.com/melloxyz/sessionlens · CHANGELOG · CONTRIBUTING · Português (BR)
Sessionlens — local-first observability for AI Coding CLIs.



