guidelines for relaxing coronavirus disease 2019 (COVID-19) social distancing policies, local leaders are concerned about future pandemic waves and lack robust strategies for tracking and suppressing transmission. Here, we present a strategy for triggering short-term shelter-in-place orders when hospital admissions surpass a threshold. We use stochastic optimization to derive triggers that ensure hospital surges will not exceed local capacity and lockdowns are as short as possible. For example, Austin, Texas-the fastest-growing large city in the United States-has adopted a COVID-19 response strategy based on this method. Assuming that the relaxation of social distancing increases the risk of infection sixfold, the optimal strategy will trigger a total of 135 d (90% prediction interval: 126 d to 141 d) of sheltering, allow schools to open in the fall, and result in an expected 2,929 deaths (90% prediction interval: 2,837 to 3,026) by September 2021, which is 29% of the annual mortality rate. In the months ahead, policy makers are likely to face difficult choices, and the extent of public restraint and cocooning of vulnerable populations may save or cost thousands of lives.