Writing, 51 articles

Primers and field notes.

First-principles writeups on AI engineering, distributed systems, and building companies. Written from the work, not from theory.

Get new writing by email

One email when something new goes up. Unsubscribe in one click. Privacy.

Latest
AI engineering, 40 min, Jun 2026

Testing a Zendesk AI agent before launch and measuring it after

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 ↗

AI-native engineering

36 articles
01
AI in production, 11 min

What goes in a CLAUDE.md file: data from 42,106 AGENTS.md, CLAUDE.md and SKILL.md files

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.

Nov 2026
02
Ancient algorithms, 14 min

Where the word algorithm comes from: al-Khwarizmi's arithmetic, in Python

The word algorithm comes from al-Khwarizmi, whose 9th-century arithmetic reached Latin as Dixit Algorizmi. His rules for Indian numerals, tested in Python.

Nov 2026
03
AI engineering, 14 min

Evaluating LLM extraction before go-live: Wilson intervals and Cohen's kappa

LLM evaluation before go-live: a stratified sample, a model labeler checked with Cohen's kappa, and precision reported with Wilson intervals.

Nov 2026
04
AI engineering, 13 min

LLM as a judge in production: ship it in shadow mode first

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.

Nov 2026
05
Ancient algorithms, 15 min

Completing the square the way al-Khwarizmi did it, in Python

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.

Nov 2026
06
Ancient algorithms, 15 min

Maya numerals and the Long Count: base 20 and a calendar converter in 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.

Nov 2026
07
Ancient algorithms, 18 min

Qin Jiushao's dayan method: the general remainder algorithm of 1247, in Python

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.

Nov 2026
08
Ancient algorithms, 16 min

The Chinese remainder theorem from the Sunzi Suanjing, worked and implemented in 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.

Nov 2026
09
Ancient algorithms, 12 min

Heron's method for square roots, from the Metrica, in 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.

Nov 2026
10
Ancient algorithms, 12 min

The sieve of Eratosthenes, from Nicomachus to a segmented sieve in Python

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.

Nov 2026
11
Ancient algorithms, 13 min

The Euclidean algorithm from Euclid's Elements: the greatest common divisor, in Python

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.

Nov 2026
12
Ancient algorithms, 15 min

Plimpton 322 and Pythagorean triples: rebuilding a Babylonian table in 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.

Nov 2026
13
Ancient algorithms, 15 min

The square root of 2 on YBC 7289: Babylonian base 60 and a square root algorithm, in Python

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.

Nov 2026
14
Ancient algorithms, 14 min

The katapayadi system: how Sanskrit verses encode numbers, with a Python decoder

The katapayadi system from the Sanskrit sources: the Sadratnamala rule, pi to 17 places decoded syllable by syllable, raga numbers and a Python decoder.

Nov 2026
15
Ancient algorithms, 15 min

The chakravala method for Pell's equation, from Bhaskara II, in Python

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.

Nov 2026
16
Ancient algorithms, 15 min

Panini's Ashtadhyayi as a rewrite system, compared with Backus-Naur form, in 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.

Nov 2026
17
Ancient algorithms, 15 min

Pingala's binary: Sanskrit meters, the meru prastara and Pascal's triangle, in Python

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.

Nov 2026
18
Ancient algorithms, 15 min

The Madhava-Leibniz series for pi, with Madhava's correction terms, in 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.

Nov 2026
19
Ancient algorithms, 17 min

The kuttaka method: Aryabhata's extended Euclidean algorithm, in Python

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.

Nov 2026
20
AI engineering, 18 min

On-device OCR benchmark: Apple Vision, ML Kit and Gemini

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.

Aug 2026
21
AI engineering, 16 min

Agentic coding loops: ComPilot's compiler checks vs Alfred's CI

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.

May 2026
22
AI engineering, 12 min

Designing a reward verifier for agent RL on tau-bench

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.

May 2026
23
AI engineering, 13 min

Reducing a coding agent's token usage: 3 changes, measured

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.

Apr 2026
24
AI engineering, 16 min

Offline OCR on phones: how OCR works and why it is hard

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.

Mar 2026
25
AI engineering, 14 min

An agent harness for coding agents that run unattended

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.

Mar 2026
26
Engineering, 14 min

Durable execution vs idempotent re-derivation for AI workflows

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.

Feb 2026
27
Engineering, 14 min

Scaling WebSockets across servers: load balancing and pub/sub

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.

Jan 2026
28
Engineering, 13 min

SSE vs WebSockets vs HTTP/3, from first principles

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.

Dec 2025
29
AI engineering, 13 min

Building a ChatGPT-style streaming AI chat UI from scratch

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.

Nov 2025
30
Engineering, 15 min

Machine learning for algorithmic trading: where the model fits

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.

Jul 2025
31
Engineering, 11 min

Running Claude Code on Vertex AI through a local proxy

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.

Jun 2025
32
Engineering, 14 min

Event sourcing and CQRS, explained with a trading engine

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.

May 2025
33
Engineering, 12 min

Idempotent writes on natural keys for data you do not control

Vendor data arrives duplicated, reordered and late. Idempotent writes keyed on each record's natural key keep ingestion correct anyway, with Postgres upserts.

Apr 2025
34
Engineering, 12 min

A hotel KPI pipeline on dbt and DuckDB that dedups snapshots

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.

Mar 2025
35
Engineering, 14 min

Snowflake cost optimization: attributing cost to each query

Snowflake cost optimization starts with attribution: rebuilding cost per query from ACCOUNT_USAGE, the apportionment math, and the auto-suspend fix.

Feb 2025

AI enablement

9 articles
01
AI enablement, 19 min

Onyx vs RAGFlow vs Dify vs AnythingLLM for company documents

Connecting AI to company documents: Onyx, PipesHub, RAGFlow, Dify and AnythingLLM benchmarked, their licence limits, and permission-aware RAG that fails closed.

Sep 2026
02
AI enablement, 19 min

Enterprise AI adoption beyond the engineering team

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.

Aug 2026
03
AI enablement, 30 min

An AI adoption framework for a 60-person engineering org

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.

Jul 2026
04
AI enablement, 10 min

LLM as a judge: how to build one you can trust

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.

Jul 2026
05
AI enablement, 16 min

Running AI enablement as a P&L: the operating model

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.

Jul 2026
06
AI enablement, 13 min

Marketing automation migration with AI: 200+ email templates

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.

Jul 2026
07
AI enablement, 8 min

AI cost optimization through standards and engineering

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.

Jun 2026
08
AI enablement, 8 min

AI spend management: attributing AI cost to each initiative

AI spend management starts with attribution: give each initiative its own metered credential before work starts, and the provider's reports split the bill.

Jun 2026
09
AI enablement, 9 min

AI use case prioritization: choosing which AI projects to build

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.

Jun 2026

Building companies

6 articles
01
Startup, 12 min

How to build an MVP in 3 months: a primer for technical founders

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.

Dec 2025
02
Founder sales, 15 min

Founder-led sales: a primer for technical founders

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.

Nov 2025
03
Fundraising, 24 min

How to raise a seed round: a primer for technical founders

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.

Oct 2025
04
Event marketing, 12 min

How to measure event ROI for B2B: cost, pipeline and payback

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.

Sep 2025
05
Startup journey, 17 min

Corporate venture building at Bain: Aura, $0 to $3.6M ARR

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.

Sep 2025
06
Founder lessons, 12 min

Unit economics and timing: lessons from a teen banking startup

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.

Aug 2025