I begin with a model that generates quantity credit rationing by banks in the spot credit market when the real interest rate is high and there is an economic downturn. Then I rationalize a bank loan commitment as partial insurance against such future rationing. Incorporating uncertainty about both the creditworthiness of borrowers and the abilities of banks to screen borrowers, I extend the bank contracting literature wherein I examine banks' decisions of whether to lend under the commitments sold earlier. I show that this discretion of whether to honor borrowing requests under commitments generates reputational concerns on the part of banks and can lead to an equilibrium in which loan commitments serve their role in increasing credit supply relative to the spot credit market, but produce the inefficiency of excessive credit supply when the real interest rate is low and the economy is doing well. Despite this, welfare is higher with loan commitments than with spot credit. Numerous empirical predictions and policy implications are drawn out.