Understanding how production shocks influence food prices is increasingly critical in a world facing climate change and growing dependence on international trade for crops. This study examines how production shocks influence crop prices by combining machine learning methods and gravity modeling. Using a two-stage least squares (2SLS) approach with weather instruments selected via the Least Absolute Shrinkage and Selection Operator (LASSO), we first predict crop production using high-resolution weather variables. The instruments exhibit strong predictive power and pass weak instrument tests. In the second stage, we find that increases in domestic production significantly reduce local prices, while the effects of production changes in trade partners vary across crops. Higher output by major sellers lowers rice prices but raises wheat prices, and greater production by major buyers increases maize and wheat prices. We estimate trade flows using a structural gravity model, incorporating WTO membership, free trade agreements (FTA), and border effects. Results show that WTO membership significantly promotes wheat trade, while border frictions tend to reduce trade volumes, especially after 2010. These findings highlight the complex transmission mechanisms of production shocks through global trade networks and underscore the importance of accounting for both supply and demand channels when evaluating food price dynamics and international food security.