We develop a model to show how agency conflicts, free-rider effects, and monitoring costs interact to affect optimal team size and workers’ incentive contracts. Team size increases with project risk, decreases with profitability, and decreases with monitoring costs as a proportion of output. Our predictions are consistent with empirical evidence that firm-specific risk has increased over time, average corporate earnings have declined, and firms’ organizational structures have also flattened. The predicted effects of monitoring costs on team size are supported by evidence that improvements in information technology likely to lower monitoring costs lead to larger teams. Further, firms with relatively more intangible assets, where monitoring costs are likely to be higher, are smaller. Optimal incentive intensities decrease with risk and increase with profitability. The endogenous determination of team size accentuates the positive effects of a decline in risk and an increase in profitability on incentives.This paper was accepted by Gustavo Manso, finance.