First-principles writeups on AI engineering, distributed systems, and building companies. Written from the work, not from theory.
Testing a vendor-hosted Zendesk AI agent: black-box tests through the web widget, 2-layer grading, repeated runs, and the verified resolution rate after launch.
Read the piece ↗Data on CLAUDE.md and AGENTS.md files in 38,272 active GitHub repos with 1,000+ stars: length, sections, test commands, and how often CLAUDE.md skips AGENTS.md.
The word algorithm comes from al-Khwarizmi, whose 9th-century arithmetic reached Latin as Dixit Algorizmi. His rules for Indian numerals, tested in Python.
LLM evaluation before go-live: a stratified sample, a model labeler checked with Cohen's kappa, and precision reported with Wilson intervals.
LLM as a judge in production: replacing a regex quality gate with a judge that runs in shadow mode, fails open to a deterministic floor, and flips on numbers.
Completing the square from al-Khwarizmi's Algebra (c. 820 CE): his 6 types of equation, the x^2 + 10x = 39 figure, the 2-root case, and tested Python.
Maya numerals from the Dresden Codex to tested Python: base 20 with a zero, the Long Count, the 260 and 365-day counts, and a converter to Julian Day Numbers.
Qin Jiushao's dayan method from the Shushu jiuzhang (1247): the Chinese text and a translation, his rice and dike problems, the qiuyi step and tested Python.
The Chinese remainder theorem from its oldest known source, the Sunzi Suanjing: the Chinese text with a translation, the 70, 21, 15 recipe and tested Python.
Heron's method for square roots as Heron of Alexandria works it in Metrica I.8 on the root of 720, with the Greek, tested Python and the tie to Newton's method.
The sieve of Eratosthenes as Nicomachus gives it in Introduction to Arithmetic I.13, then the standard, segmented and wheel sieves in Python, tested and timed.
The Euclidean algorithm as Euclid states it in Elements VII.1 and VII.2, by repeated subtraction, then the division form, Lamé's 1844 step bound, and Python.
Plimpton 322 lists 15 right triangles with whole-number sides, c. 1822 to 1762 BCE. I rebuild every row in Python and locate the scribe's 7 known errors.
YBC 7289 gives the square root of 2 as 1;24,51,10 in base 60. How the tablet works, the square root algorithm called the Babylonian method, and tested Python.
The katapayadi system from the Sanskrit sources: the Sadratnamala rule, pi to 17 places decoded syllable by syllable, raga numbers and a Python decoder.
Pell's equation solved by Bhaskara II's chakravala method (1150): the Sanskrit verses word by word, his N = 61 and N = 67 examples, and tested Python.
Panini's Ashtadhyayi states Sanskrit grammar in about 4,000 ordered, context-sensitive rewrite rules. Vowel sandhi in Python, compared with Backus-Naur form.
Pingala's Chandahshastra lists every pattern of heavy and light syllables and numbers each one, which reads as binary. The sutras, the meru prastara and Python.
The Madhava-Leibniz series for pi from the Sanskrit verses: a word-by-word translation, Madhava's end corrections, tested Python and a convergence benchmark.
Aryabhata's kuttaka (499 CE) from the Sanskrit verses to tested Python, with a worked example from the 629 CE commentary and the RSA modular inverse.
An OCR benchmark on phone photos: field-level F1 for Apple Vision, ML Kit, PaddleOCR and tesseract.js against Gemini 2.5 Flash, and when to use each.
ComPilot (PACT 2025) and Alfred run the same agentic coding loop: propose, check, retry. What a compiler checker and a CI-and-review checker each cost.
A reward function is a specification of correctness. On tau-bench, my verifier took about 215 lines; the cost was 12 minutes of expert time per task.
3 ways to reduce token usage in coding agents, tested one at a time over 17 repos: a code graph, tool-output compression, and prompt caching behind a gateway.
A primer on offline OCR on phones: how OCR works, why real inputs and Latin-skewed datasets make it hard, and why devices still run engines like Tesseract.
The agent harness I run for unattended coding agents: per-run budgets and stop rules, a sandbox, CI and review gates, human merges, and evidence-backed memory.
AI workflows fail partway through at real volume. Durable execution resumes from a checkpoint; idempotent steps re-derive. How each works and when to pick each.
Scaling WebSockets past 1 server: why messages drop behind a load balancer, the pub/sub backplane that fixes delivery, and the limits a long connection adds.
SSE vs WebSockets, built up from first principles: polling, Server-Sent Events, WebSockets, HTTP/2 multiplexing and HTTP/3 over QUIC, and how to choose.
How to build a streaming AI chat UI: SSE vs WebSockets, server and client message state, partial tokens, cancellation and streamed tool calls, with code.
Where machine learning fits in algorithmic trading: features, labels, a backtest that reuses live code, a serving path, and risk checks that can veto the model.
How vertex-proxy lets Claude Code run on Vertex AI: it refreshes the 60-minute OAuth token and translates between OpenAI, Anthropic and Gemini request formats.
Event sourcing stores every fact and derives state from it; CQRS splits writes from reads. Both from first principles, with Axon code from a real order book.
Vendor data arrives duplicated, reordered and late. Idempotent writes keyed on each record's natural key keep ingestion correct anyway, with Postgres upserts.
A daily hotel KPI pipeline on dbt and DuckDB: dedup snapshots before aggregating, separate status rules for occupancy and revenue, and a CI reconciliation gate.
Snowflake cost optimization starts with attribution: rebuilding cost per query from ACCOUNT_USAGE, the apportionment math, and the auto-suspend fix.
Connecting AI to company documents: Onyx, PipesHub, RAGFlow, Dify and AnythingLLM benchmarked, their licence limits, and permission-aware RAG that fails closed.
Enterprise AI adoption for 200 people at a regulated fintech: Slack as the interface, 1 self-hosted LLM gateway, governance in config, and spend attribution.
The AI adoption framework I run for 60 engineers at a 200-person regulated fintech: a baseline first, outcome metrics, 1 gateway, and governance as config.
How to use an LLM as a judge in production: deterministic gates first, grading against a written policy, cached verdicts, and calibration with Cohen's kappa.
AI enablement run as a small P&L: find expensive repetitive work, start only projects with a number, tie every AI dollar to an initiative, and build standards.
A marketing automation migration run as a pipeline: AI cleans up 200+ near-duplicate email templates and moves them, with human checks and a reversible cutover.
AI cost optimization without cutting seats: standards that live in the tooling, so each project reuses the last, plus model routing and caching on the calls.
AI spend management starts with attribution: give each initiative its own metered credential before work starts, and the provider's reports split the bill.
How I prioritize AI use cases: find expensive repetitive work, prefer tasks AI can remove, gate every project on a number, and prove value in a 1-day test.
How to build an MVP in 3 months: scope it to 1 workflow, keep a won't-have list, buy the hard part, and use a stack you know. With numbers from Mainteny's MVP.
Founder-led sales for engineers: why the builder is credible on a call, outreach that gets replies, discovery questions, objections, and when to hire a seller.
How to raise a seed round in 2026: what investors check, metrics and data room, outreach templates, the live demo, technical due diligence, and dilution math.
How to measure event ROI in B2B: fully loaded cost, sourced and influenced pipeline, an attribution window matched to the sales cycle, and cost per opportunity.
Corporate venture building at Bain & Company: how I took Aura from $0 to $3.6M ARR in 15 months as CTO, grew the org from 5 to 33, and what it cost.
Spendzer, my first startup, was a banking app for teens in Germany. Demand was there; the per-card unit economics and the timing were what sank it.
I use analytics to see which pages are useful. Nothing else. You can decline. Privacy