Should the generosity of unemployment benefits and the progressivity of income taxes depend on the presence of business cycles? This paper proposes a tractable model where there is a role for social insurance against uninsurable shocks to income and unemployment, as well as business cycles that are inefficient due to the presence of matching frictions and nominal rigidities. We derive an augmented Baily-Chetty formula showing that the optimal generosity of the social insurance system depends on a macroeconomic stabilization term. This term pushes for an increase in generosity when the level of economic activity is more responsive to social programs in recessions than in booms. A calibration to the U.S. economy shows that taking concerns for macroeconomic stabilization into account substantially raises the optimal unemployment insurance replacement rate, but has a negligible impact on the optimal progressivity of the income tax. More generally, the role of social insurance programs as automatic stabilizers affects their optimal design.