nutri. — running a production app inside an agentic stack
A nutrition-tracking PWA I design, build and operate entirely inside Claude Code. The interesting part isn't the app — it's the operating system that keeps an AI agent effective and safe on a real codebase with no second reviewer.
nutri. is a nutrition-tracking PWA in daily use — React, Supabase, no backend team, no co-maintainer. That’s the surface. The part worth writing about is how an AI agent and I operate on the codebase together, and the guardrails that make that safe when there is no second reviewer to catch a bad merge.
The AI surface, with receipts
Four AI features are live in production. Each links to a build write-up that carries its own proof — screenshots, scored baselines, or a verification run against the live database:
- AI nutrition extraction — a label photo or a description becomes a structured per-100 g estimate over a three-model fallback chain; every prompt or model change is gated by a golden-set eval scored against USDA ground truth. → Evals for a model cascade
- Semantic catalog search — hybrid keyword + pgvector; “citrus fruit” finds Orange, Grapefruit and Lemon without sharing a letter with any of them. → RAG that only cites what it retrieved
- “Ask your log” — structured RAG over the food diary; in the end-to-end check its answer cited 409.5 mg of sodium and the database view says 409.500. → same write-up
- Remote MCP server — OAuth 2.1 with dynamic client registration, eight tools, row-level security as the only authorization layer; Claude logs meals from claude.ai against production. → A remote MCP server
Conventions are the substrate
Two normative files load every session: a working-agreement (CLAUDE.md) and a permanent standards file (BIBLIA.md). They are not READMEs — they encode invariants the agent cannot violate: every nutrient stored per 100 g, totals computed in SQL views and never copied, a medical sodium floor that is non-negotiable and non-configurable. An agent is only as good as the context it is forced to re-read; convention files are the highest-leverage artifact in an agentic codebase.
Structural guardrails over guidelines
A guideline that says “check your branch” does not survive a race between two sessions sharing one working tree. A pre-commit hook that hard-rejects any commit to main does. Same for correctness: a change is not done because it looks right — it is done when 156 tests, lint and build pass. The gate is a machine, not a promise.
MCP in both directions
Schema changes go through the Supabase MCP connector: the agent writes a numbered, incremental migration, applies it against the live project, and verifies with a query before it is closed. Twenty-one migrations have shipped this way, with the numbering and the post-apply check as the audit trail.
The same pattern covers observability: the Sentry project was provisioned through its MCP connector — project, DSN and the CSP change shipped agent-side in a single session — so production errors feed back into the loop instead of dying in a user’s console.
The connector now runs the other way too: nutri exposes its own remote MCP server, so Claude operates the app in natural language against production — with row-level security as the only authorization layer and the same domain validators the UI uses. That build (OAuth 2.1, the tool-design decisions, and its zero-net-alteration verification against the live database) is its own write-up: A remote MCP server where RLS is the only authorization layer.
The product
Most of it sits behind a login wall, so these are the screens a reviewer would otherwise never see.
What it maps to at scale
Solo, this is a discipline. On a team, every piece here is a platform surface: convention files become shared skills, the pre-commit hook becomes CI policy, MCP access becomes governed infrastructure, and the eval harness becomes the evaluation practice the whole org measures against. Running the n=1 version is how I learned where the seams are.
Repo: github.com/vryahn/nutri · Live: nutri.vryahn.com/about (public tour; the app itself is login-gated)