A self-hosted AI Coding Session Intelligence Platform — capture every AI coding-tool session on
your machine(s), archive it with full fidelity, and turn it into reports on cost, token/context
efficiency, tool-call failures, and Git outcomes.
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
AI coding tools produce valuable but fragmented operational data — sessions live in vendor-specific local stores, CLIs, and logs that can crash, change format, or lose history. 420AI captures that data across machines, archives it with maximum fidelity, and turns it into Markdown reports and a live dashboard so you can answer questions like which projects/tools/models are worth the spend and where context is wasted.
It is local-first and self-hosted (nothing leaves your home server), event-sourced (raw records are the permanent truth; everything else is a re-buildable projection), and deterministic-metrics-first, AI-interpretation-second. The repo is an npm-workspaces monorepo:
packages/shared— token shape, event taxonomy, fingerprint, pricing, cost, ingest wire typespackages/db— Drizzle Postgres schema + migrations, AES-256-GCM field encryption, repositoriesapps/ingest— Fastify Ingest API (pairing, bearer-authed idempotent ingest, projections, reports)apps/collector— headless capture agent (connectors, durable queue, watcher, sync, CLI)apps/dashboard— Next.js + shadcn/theGridCN Live Monitorapps/desktop— Tauri (Rust) tray app that supervises the collector as a sidecar
- TypeScript on Node.js ≥ 24 (ESM, strict)
- Fastify — the Ingest API
- Drizzle ORM + PostgreSQL 17 (Docker)
- Next.js + shadcn/ui + theGridCN — the dashboard
- Tauri (Rust) — the desktop/tray collector
- Vitest — unit + integration tests
- Node ≥ 24 (see
.nvmrc) — the collector queue uses the built-innode:sqlite. - Docker — for the PostgreSQL 17 archive (host port 5433).
- Clone the repo
git clone https://github.com/seanrobertwright/420AI.git cd 420AI - Install workspace dependencies
npm install
- Create your env file and fill the two secrets
cp .env.example .env # ARCHIVE_ENCRYPTION_KEY — 32 bytes, base64: node -e "console.log(require('crypto').randomBytes(32).toString('base64'))" # ADMIN_TOKEN — gates admin endpoints: node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))"
- Start the archive and apply migrations
npm run db:up # postgres:17 on host port 5433 npm run db:migrate - Run the Ingest API
npm run ingest:dev # http://localhost:8420
Pair a machine and capture sessions (collector CLI, run with tsx — no build needed):
# Create a pairing code (admin-gated), then pair the collector
curl -s -X POST localhost:8420/v1/pairing-codes -H "authorization: Bearer $ADMIN_TOKEN" -d '{}'
npx tsx apps/collector/src/cli.ts pair <code> --url http://localhost:8420 --name win-dev
# Run the background capture agent (Ctrl-C drains and stops)
npx tsx apps/collector/src/cli.ts watch
# One-shot ops: drain the queue / inspect backlog / discover repos
npx tsx apps/collector/src/cli.ts sync
npx tsx apps/collector/src/cli.ts queue
npx tsx apps/collector/src/cli.ts discoverRun the dashboard (Live Monitor):
npm run dashboard:dev # reads INGEST_URL + ADMIN_TOKEN from envFor the full setup and day-to-day guide, see docs/guide/install.md and
docs/guide/usage.md.
- M1–M9 — capture → archive → projections → reporting → AI interpretation → Live Monitor
- M10 — hardening: exports, catalog signing, operational alerts, replay metadata
- M11 — Tauri desktop/tray collector
- M12 — Production Readiness / GA (in progress, 8 slices): basic search, dashboard surfaces, auth hardening, ops baseline, archive-replay engine, alert delivery, connector hardening, export/distribution polish
See SUMMARY.md and the open issues
for the full list.
This is a single-maintainer project. Contributions, issues, and feature requests are welcome — fork the repo, create a feature branch, and open a PR. Before committing, ensure the gate passes:
npm run repo-health # typecheck + tests + NUL/stray-artifact scans
npm run repo-health -- --require-db # also runs the Postgres integration layerDistributed under the MIT License. See LICENSE for more information.
Sean Wright —
Project Link: https://github.com/seanrobertwright/420AI
- othneildrew/Best-README-Template — README structure
- Shields.io — badges
