We study the welfare properties of an economy where both monetary and fiscal policy follow simple rules, and where a subset of agents is borrowing constrained. The optimized fiscal rule is far more aggressive than automatic stabilizers, and stabilizes the income of borrowingconstrained agents, rather than output. The optimized monetary rule features super-inertia and a very low coefficient on inflation, which minimizes real wage volatility. The welfare gains of optimizing the fiscal rule are far larger than the welfare gains of optimizing the monetary rule. The preferred fiscal instruments are government spending and transfers targeted to borrowing-constrained agents.