We examine a model of contracting where parties interact repeatedly and can contract at any point in time, but writing formal contracts is costly. A contract can describe the external environment and the parties' behavior in a more or less detailed way, and the cost of writing a contract is proportional to the amount of detail. We consider both formal (externally enforced) and informal (self-enforcing) contracts. The presence of writing costs has important implications both for the optimal structure of formal contracts, particularly the tradeoff between contingent and spot contracting, and for the interaction between formal and informal contracting. Our model sheds light on these implications and generates a rich set of predictions about the determinants of the optimal mode of contracting.