Coase's Coffee
Starbucks spends $400 million a year on software and just started replacing Microsoft and IBM tools with AI-built code of its own. A 26-year-old economist explained the move in 1937. He also explains why most companies copying it will regret it.
An inventory system goes wrong before the coffee rush. Who gets the call? I made this argument about agents (you can't sue an agent), and it applies with full force here: a SaaS contract is a counterparty with skin in the game. When the inventory system is wrong today, Starbucks calls Microsoft, and an army of people whose careers depend on that phone call gets paged. When the in-house replacement is wrong at 4:30 in the morning before the rush, Starbucks calls Starbucks. Maintenance is where AI-built software goes to get quietly expensive. And AI in the stockroom has already bitten this exact company once: in May, Starbucks retired Automated Counting, a vendor-built AI system for counting milk and syrups, after it kept confusing products that looked alike, and sent stores back to counting by hand. Or ask Ford, which spent June rehiring the gray-beard engineers it thought AI had replaced. Starbucks' software bill does not disappear. Some fraction of it converts into engineers, pager rotations, and the slow institutional discovery that "the model wrote it" is not an acceptable sentence in a Sev-1 postmortem.
On July 9, 2026, Bloomberg reported that Starbucks is using AI to build in-house replacements for software it currently rents, including a Microsoft system that tracks inventory and an IBM tool that manages equipment maintenance. Starbucks spends about $400 million a year on software, according to CTO Anand Varadarajan, and the enterprise technology team expected roughly $30 million in budget savings this fiscal year, about $10 million of it from software. The first replacements could roll out by the end of 2027, pending testing. A coffee company looked at Microsoft and IBM and said: we'll take it from here.
If you want to understand why this is happening, and why it is going to happen a few hundred more times over the next three years, don't read an AI newsletter. Read a paper from 1937. Ronald Coase was 26 years old when he published The Nature of the Firm, which asks a question so simple that economists were mildly embarrassed nobody had answered it: if markets are so efficient, why do companies exist at all? Why is anything done inside a firm instead of contracted out on the open market? His answer, which eventually earned a Nobel, was transaction costs. You pull an activity inside the firm when coordinating it internally is cheaper than buying it outside, and you push it out when the reverse becomes true. The boundary of the firm isn't strategy, and it isn't culture. It's a price. When relative prices change, the boundary moves.
SaaS is a forty-year bet on one side of that equation. Building software internally was brutally expensive (hire the engineers, keep the engineers, maintain the thing forever), so vendors amortized one build across ten thousand customers and rented it back to you. This was correct. It was so correct that we stopped noticing it was a bet on a particular cost structure rather than a law of nature. Then AI coding tools cut the internal cost of producing working software by some large and still-unmeasured factor, and the equation started running backward. Gartner now expects agentic AI to put $234 billion of SaaS spending in play. And Starbucks is exactly the company you'd expect at the front of the line: its problems are specific (predicting inventory across roughly 40,000 stores, keeping espresso machines alive), the data feeding those problems comes off Starbucks' own machines and registers, and the vendor products it's replacing are general-purpose tools priced like moats.
We have run this loop before, in the other direction. In 1900, factories generated their own electricity, because that was the only way to get reliable power at industrial scale. Then central utilities got good, and by 1930 buying off the grid had crushed self-generation. Nicholas Carr wrote The Big Switch in 2008 arguing that computing would follow electricity into the utility model, and for fifteen years he was dead right: the cloud became the utility and SaaS became the appliance plugged into it. The lesson from both cycles is not that make beats buy, or that buy beats make. The lesson is that the answer is cyclical, it follows the cost structure of the era, and anyone who tells you the current boundary is permanent is selling you the current equilibrium.
The honest version of the math has three terms, and AI only changed one of them. Insourcing wins when your requirements are genuinely specific rather than generic. It wins when the data feeding the system is yours (Starbucks' machine telemetry is exactly that, and it never needed to leave the building in the first place; shipping your operational exhaust to a vendor so they can rent you insights about your own espresso machines was always a little absurd). And it wins when you can carry the maintenance burden for the life of the system, not the life of the demo. Starbucks, with a real engineering organization and a $2 billion cost program giving the project air cover, may clear all three. The 200-person company currently asking a coding agent to clone Salesforce will clear none of them, and will rediscover each term of Coase's equation the hard way, in production.
Coase's insight survived the corporation, the conglomerate, the outsourcing wave, offshoring, and the cloud. It will survive this too. The boundary of the firm is a price. AI just changed the price, and the map is getting redrawn, one $400 million line item at a time.
Want to learn how intelligent data pipelines can reduce your AI costs? Check out Expanso. Or don't. Who am I to tell you what to do.
NOTE: I'm currently writing a book based on what I have seen about the real-world challenges of data preparation for machine learning, focusing on operational, compliance, and cost. I'd love to hear your thoughts!