This paper shows empirical evidence and theory consistent with the US government using debt optimally to adjust the federal budget to news about long-term growth. First, using historical forecasts from the Congressional Budget Office (CBO) since 1984, I find that government purchases and deficits are positively correlated with expectations about long-term productivity, real gross domestic product, and tax revenue growth, whereas tax receipts are negatively correlated. A structural vector autoregression estimated with US quarterly data in 1955¿2015 identifies permanent and transitory productivity shocks and points to ¿trend¿ shocks as the source of these correlations. Second, I present an open economy real business-cycle model with stochastic productivity trend and optimal public purchases and taxes. Calibrating the model to the US economy, the Ramsey planners' allocation yields moments aligned with those observed in the data.