Coffee extraction performed in an espresso machine is a process that depends on a delicate interplay between grind setting, coffee mass, water pressure and temperature, and beverage volume. Using a mathematical model based on the transport of solubles through a granular bed, paired with cafe-setting experiments, we elucidate the origin of inconsistencies in espresso production. Informed by the model, a protocol is proposed to systematically reduce coffee waste and beverage variation, resulting in highly reproducible shots.