We characterize optimal incentive contracts in a moral hazard framework extended in two directions. First, after effort provision, the agent is free to leave and pursue some ex-post outside option. Second, the value of this outside option is increasing in effort, and hence endogenous. Optimal contracts may entail properties such as inducing first-best effort and surplus, or non-responsiveness with respect to changes in verifiable parameters. Moreover, while always socially inefficient, separation might occur in equilibrium. Except for the latter, these findings are robust to renegotiation. When the outside option is exogenous instead, the standard results obtain