We study the optimal duration of contracts in a principal-agent framework with both moral hazard and adverse selection. Agents decide on a contract-specific and non-verifiable investment. Incentive compatibility requires that initial contracts, which serve to screen the ability of newly hired agents, cannot be longer than continuation contracts, offered to successful agents. Initial contracts remain unpaid unless service quality is unobservable to other agents and the share of high-ability agents is high. Optimal durations depend, in non-monotonic ways, on the principal’s ow valuation of the agent’s service and the share of high-ability agents.