lmnr
CLAUDE.md3.4k starsChanged 20 days agoApache-2.0View on GitHub
Laminar is an open-source observability platform for AI agents: OpenTelemetry-native tracing, evaluations, AI monitoring, and SQL access to all data. Multi-service monorepo: Some features (Signals evaluation, Laminar Agent, clustering) are enterprise-only and live in the private lmnr-private repo behind the signals cargo feature; OSS ships stubs and public scaffolding for them. Don't document them as OSS features.
- Reads credentials
- Installs packages
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 53
NEVER run cargo fmt, even as cargo fmt -- <file> (the file arg does NOT scope it).
- Very specific: line 121
Every env var is registered in app-server/src/env/ (typed NumEnv/StringEnv/BoolEnv descriptors) — never inline a string-literal env name at …
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
Laminar is an open-source observability platform for AI agents: OpenTelemetry-native tracing, evaluations, AI monitoring, and SQL access to all data.
Repository Structure
Multi-service monorepo:
- app-server/ — Rust backend (Actix-web HTTP, Tonic gRPC). SQL query validation + JSON↔SQL conversion run in-process (
src/query_engine/, built onsqlparser). - frontend/ — Next.js/TypeScript web UI.
- pii-redactor/ — optional standalone Rust gRPC service running a HuggingFace PII model on CPU via ONNX Runtime. See
pii-redactor/README.md.
Some features (Signals evaluation, Laminar Agent, clustering) are enterprise-only and live in the private lmnr-private repo behind the signals cargo feature; OSS ships stubs and public scaffolding for them. Don't document them as OSS features.
Development Commands
Frontend (Next.js)
cd frontend
pnpm install # Install dependencies
pnpm run dev # Start dev server (Turbopack)
pnpm lint # oxlint (lint:fix to auto-fix)
pnpm format:write # oxfmt
pnpm type-check # TypeScript type checking
pnpm test # Run tests (tsx --test tests/**/*.test.ts)
pnpm build # Production build- The sandbox's global pnpm is v10 but the lockfile is written by pnpm 11 (
frontend/Dockerfile).pnpm addon v10 rewrites hundreds of(supports-color@…)peer suffixes. Add deps withnpx -y pnpm@11 add <pkg> --lockfile-only, thenpnpm install --frozen-lockfileto syncnode_modules. - Format only the files you changed:
npx oxfmt --write <files>.prettieris present innode_modules(transitive dep) but is NOT the project formatter — running it reformats files oxfmt then flags in the pre-commit hook. - In a fresh checkout,
pnpm type-check(and the husky pre-commit hook) fails withTS2307: Cannot find module '@/assets/...svg'errors —next-env.d.tsis gitignored. Fix:npx next typegen(or anynext dev/next buildrun). tsconfig.jsonsets"incremental": true, so a barenpx tsc --noEmitcan report zero errors on files it skipped and give a false green. When verifying a type fix, runnpx tsc --noEmit --incremental false(the pre-commit hook does a full check and will catch what you missed otherwise).pnpm teston a cleandevalready has two red tests (afterpnpm install --frozen-lockfile,ai7.0.15):tests/test-ai-sdk-parser.test.ts"skips empty text/reasoning parts" andtests/test-normalize-messages.test.ts"end-to-end: a bare AI-SDK parts array …". Both expect emptytext/reasoningparts to be dropped and get 2 parts instead of 1. Pre-existing —git stash -uand re-run before blaming your change.- A stale
node_modulesfakes ~47 "pre-existing" type errors. An installed tree older thanpnpm-lock.yaml(e.g. recharts 2.15.4 where the lock pins 3.10.1) makestsc --noEmitandpnpm buildfail onBarStack/MouseHandlerDataParam/useYAxisScale/<YAxis width="auto">acrosschart-builder/,charts/,evaluation/,landing/. They look exactly like the recharts v2→v3 debt they are not:pnpm install --frozen-lockfileclears all of them. Verify the install matches the lock before writing any of it off as pre-existing. - Turbopack is the Next 16.3 default for both commands;
buildopts out with--webpack,devdoes not. Turbopack's production output miscompiled chunks (module factory is not availableon client navigation). So both bundler blocks innext.config.tsare live, and a production repro needspnpm build, not a barenext build.next devgeneratesfrontend/AGENTS.mdon every run; it is gitignored (do not commit it).
Backend (Rust)
cd app-server
cargo r # Run in development mode
cargo build --release # Production build
cargo test -- --nocapture # Run tests- The
aws-*crates inCargo.lockrequire rustc ≥ 1.94.1; on 1.94.0cargo checkfails during resolution ("requires rustc 1.94.1") before compiling anything —rustup update stable. cargo check --features signalsandcargo fmtonmain.rsboth fail in OSS — thesignalsfeature gates modules that live only inlmnr-private. Default-featurecargo checkis the real gate; format leaf files individually withrustfmt --edition 2024 <file>. Full stub workaround list:docs/internal/app-server.md.- NEVER run
cargo fmt, even ascargo fmt -- <file>(the file arg does NOT scope it). The tree is not rustfmt-clean at HEAD, so it rewrites ~40 unrelated files and buries the real diff. Userustfmt --edition 2024 <file>on the files you changed. cargo test --libfails with "no library targets found" —app-serveris a binary crate. Usecargo test --bin app-server <filter>; the filter takes a single path prefix, not a list.
Local Development Setup
cp app-server/.env.example .env # app-server reads .env at the repo root (dotenv)
cp frontend/.env.local.example frontend/.env.localPostgreSQL and ClickHouse are required. Everything else degrades gracefully: RabbitMQ → in-memory queue, Redis → in-memory cache, Quickwit → search disabled, S3 → MockStorage.
Docker-based:
# Frontend-only (pre-built app-server image):
docker compose -f docker-compose-local-dev.yml up
cd frontend && pnpm run dev
# Full-stack (all dependencies, run app-server + frontend yourself):
docker compose -f docker-compose-local-dev-full.yml up
cd app-server && cargo r # Terminal 1
cd frontend && pnpm run dev # Terminal 2Gotcha: dotenv does NOT override already-exported env vars. A shell that exports PORT silently breaks the app-server HTTP listener (bind error is swallowed) and next dev (EADDRINUSE). Launch with explicit PORT=8000 cargo r / PORT=3000 pnpm run dev, or env -u PORT. Details: docs/internal/app-server.md.
Architecture
Frontend (5667 prod / 3000 local-dev) ────┐
│
App Server │
├─ REST API (8000) ◄──────────────────────┘
├─ gRPC ingestion (8001) ◄─── SDK traces
└─ Realtime SSE (8002)
│
├──► PostgreSQL (5433) - main database [required]
├──► ClickHouse (8123) - analytics/spans [required]
├──► RabbitMQ (5672) - async processing [optional]
└──► Quickwit (7280/81) - full-text search [optional]Database Migrations
Schema is managed with Drizzle ORM; the database itself is the source of truth — do NOT edit schema files directly.
cd frontend
pnpm db:generate # generate migrations AND strip "public". qualifiers (required)
# Migrations are applied automatically on frontend startup- Migration SQL must stay schema-neutral (no
"public".qualifiers) —pnpm db:generatehandles the strip; if you generate by hand, runpnpm db:strip-schemaafter. - Hand-written migrations also need a
meta/NNNN_snapshot.jsonor the next generate produces a duplicate migration. - ClickHouse migrations (
frontend/lib/clickhouse/migrations/) run once and are checksummed — NEVER modify an applied migration file; always add a new numbered one. - Full details (drizzle-kit quirks, snapshots,
POSTGRES_SCHEMA):docs/internal/database.md.
Comments
Comments are welcome when they add a WHY that names cannot: a constraint, invariant, or workaround. Keep them to a line or two. Skip comments that restate the next lines, and skip changelog notes ("previously X, now Y") — describe the current code, not the diff. Longer design notes belong in docs/internal/.
// Exclusive parks happen after admission; a wait_count>0 wake already owns the claim.App-server conventions
- Every env var is registered in
app-server/src/env/(typedNumEnv/StringEnv/BoolEnvdescriptors) — never inline a string-literal env name at a call site. mod envshadowsstd::env: inside files withuse crate::env;, writestd::env::var(...)fully qualified.- Backend
Featureflags are fine-grained — one flag per feature; never gate a new feature on another feature's flag. - More:
docs/internal/app-server.md, anddocs/internal/rust-best-practices.mdfor reuse/layering/scoping rules.
Frontend conventions
- One component per file; keep components <150 lines; related components in a folder with
index.tsx. - Complex state belongs in a Zustand store (with
shallowselectors); use nuqs for URL param state — never sync URL params into a store viauseEffect. - Client fetches:
try/catch, checkres.ok, toast on error. API routes:try/catch, 400 forZodError, 500 otherwise, always JSON with anerrorfield. UseAbortControllerfor superseded in-flight fetches. - Recharts is on v3 (
^3.10.1).CategoricalChartFuncis defined fromMouseHandlerDataParaminchart-builder/charts/line-chart.tsx(the v2recharts/types/chart/generateCategoricalChartpath is gone). Use<YAxis width="auto">and<BarStack>for stacked rounded bars — do not reintroduce a custom barshape. - New data tables MUST follow the
InfiniteDataTablesplit pattern (index/contents/controls/constants). Full patterns:docs/internal/frontend-best-practices.md.
Key Technical Details
- Rust edition: 2024
- Node version: 26 (
frontend/Dockerfileisnode:26-alpine) - Package managers: Cargo (Rust), pnpm (frontend)
- Git workflow: Submit PRs to
devbranch, which merges tomainperiodically
Pre-commit Hooks
Frontend uses Husky with lint-staged: oxfmt, oxlint, a circular-import check, and tsc --noEmit run on staged files. Config lives in frontend/.oxfmtrc.json and frontend/.oxlintrc.json. If type-check fails on pre-existing SVG/PNG asset-import errors, verify your own files are clean (npx tsc --noEmit 2>&1 | grep "your-file") before using --no-verify.
Detailed topic notes (read on demand)
docs/internal/ holds detailed, hard-won working notes. Before working in one of these areas, read the matching file — it documents invariants, security boundaries, and gotchas that are not inferable from the code:
| File | Read when touching |
docs/internal/rust-best-practices.md | Any app-server change — reuse, layering, db/cache scoping, named types, error retryability |
docs/internal/database.md | Postgres migrations, POSTGRES_SCHEMA, name-sort collation |
docs/internal/sql-query-engine.md | query_engine/ validator (a security boundary), SQL editor schema/autocomplete, /v1/sql/query guards, rate limiting |
docs/internal/clickhouse-traces.md | traces_agg/traces_static/traces_v0, spans query scoping, trace aggregation, async-insert tuning, traces-table filters, project data deletion |
docs/internal/dedup-search.md | unique_content group-scoped dedup (traces/dedup/), spans_v0 reconstruction, Quickwit indexing/search |
docs/internal/ingestion.md | OTLP /v1/traces, GenAI semconv parsing, trace metadata patches, input/output extraction, system-prompt extraction, system-prompt / user-template versioning, checkpoints, 413s |
docs/internal/observability.md | App-server self-tracing, Sentry layers/sampling |
docs/internal/mq-redis.md | RabbitMQ queues + streams transport, Redis resilient connections, readiness probes |
docs/internal/auth.md | Better Auth, OAuth providers, CLI device-flow auth, project API keys |
docs/internal/rbac.md | piiMode (off/redact/dual), PII masks (*_masks, pii_checked, redactor contract), spans_v1/traces_v1 policy param, AccessPolicy (maskPii, traceFilters), trace_access_policy_dict, SQL route actor, role-based PII masking |
docs/internal/billing.md | Tiers, Starter free trial, usage warnings/hard limits, signal cost metering, custom model costs |
docs/internal/signals.md | Signals, alerts, signal events, CLI CRUD (trigger/filters/mode) |
docs/internal/slack.md | Slack OAuth broker + brokered self-hosted integration |
docs/internal/ai-features.md | getLanguageModel, LLM provider config, llm_feature_routes (per-feature model routing), Vercel AI SDK v7 |
docs/internal/analytics.md | PostHog, Loops sync, self-hosted telemetry heartbeat |
docs/internal/labeling-queues.md | Labeling queues (ClickHouse RMT items, dirty-state, push-to-dataset) |
docs/internal/debugger.md | Debugger replay cache, debugger session blocks/timeline |
docs/internal/frontend-tables.md | Data-table filters, advanced search, saved views, evaluations page, dashboards |
docs/internal/frontend-trace-view.md | Trace view, span rendering/message parsing, ContentRenderer, rrweb replay |
docs/internal/frontend-app.md | Settings pages, onboarding, base-path serving, render templates, SSE proxy routes, landing page, agent stubs |
docs/internal/frontend-best-practices.md | Any new frontend component/table/store work |
docs/internal/app-server.md | App-server env vars, local dev env quirks, signals-feature build stubs |
Trending
Less talk lately.about the whole repository
Who's talking about lmnr-ai/lmnr
- A Hacker News story“Show HN: Laminar – Open-Source DataDog + PostHog for LLM Apps, Built in Rust”Hacker News · Sep 4, 2024 · 203 points
- A Hacker News story“Show HN: Open-source Langsmith alternative written in Rust”Hacker News · Jan 6, 2026 · 3 points
- lmnr-ai/lmnr-python“fix astreaming generator return in wrap pregel”GitHub · Jun 12, 2025 · 2 reactions
- lmnr-ai/lmnr-python“fix AttributeError in ThreadingInstrumentor”GitHub · Nov 4, 2025 · 1 reactions
- OpenHands/software-agent-sdk“Screenshots from browser-use are jpeg, while LLM expects PNG”GitHub · Oct 20, 2025 · 1 reactions
The biggest 5 of 16 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 16
Talked about on GitHub, Hacker News and Bluesky (16 times).
On GitHub · 13
- Jun 12, 2025fix astreaming generator return in wrap pregel — lmnr-ai/lmnr-python2 reactions
- Nov 4, 2025fix AttributeError in ThreadingInstrumentor — lmnr-ai/lmnr-python1 reaction
- Oct 20, 2025Screenshots from browser-use are jpeg, while LLM expects PNG — OpenHands/software-agent-sdk1 reaction · 2 comments
- Sep 25, 2025fix observe on streaming functions — lmnr-ai/lmnr-python1 reaction
- Oct 2, 2026feat(cli): signal update --name for renaming (LAM-2328) — lmnr-ai/lmnr-ts0 reactions
8 more on GitHub
- Sep 8, 2026Weekly link audit needs attention — yzhao062/awesome-auditable-ai0 reactions
- Aug 27, 2026lmnr-claude-code-proxy: add build-lmnr-claude-code-proxy.yml for riscv64 wheels — riseproject-dev/python-wheels0 reactions
- Aug 13, 2026Weekly link audit needs attention — yzhao062/awesome-auditable-ai0 reactions · 1 comment
- Jul 9, 2026feat(trajquery): SQL/MCP query-your-own-trajectory + scope-by-view-rewrite validator — borrowed from Laminar@39a1e595 — anthony-chaudhary/fak0 reactions · 1 comment
- Jul 9, 2026feat(signals): plain-English behavioral signal evaluators — borrowed from Laminar@39a1e595 — anthony-chaudhary/fak0 reactions · 1 comment
- Mar 2, 2026Research: Building a One-Person Software Company with AI Agent Employees — humanjack/ai-engineering0 reactions
- Feb 23, 2026Research: AI Agents for AIOps & DevOps Automation — humanjack/ai-engineering0 reactions
- Apr 2, 2025this repository does not support lmnr Instrumentation — vercel/chatbot0 reactions
On Hacker News · 2
- Sep 4, 2024Show HN: Laminar – Open-Source DataDog + PostHog for LLM Apps, Built in Rust203 points · 45 comments
- Jan 6, 2026Show HN: Open-source Langsmith alternative written in Rust3 points
On Bluesky · 1
- Sep 5, 2024Show HN: Laminar – Open-Source DataDog + PostHog for LLM Apps, Built in Rust (@github.com) Main Link | Discussion — @newsycombinator.bsky.social1 likes and repost
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

