Many organizations rely on teamwork, and yet field evidence on the impacts of team-based incentives remains scarce. Compared to individual incentives, team incentives can affect productivity by changing both workers’ effort and team composition. We present evidence from a field experiment designed to evaluate the impact of rank incentives and tournaments on the productivity and composition of teams. Strengthening incentives, either through rankings or tournaments, makes workers more likely to form teams with others of similar ability instead of with their friends. Introducing rank incentives however reduces average productivity by 14%, whereas introducing a tournament increases it by 24%. Both effects are heterogeneous: rank incentives only reduce the productivity of teams at the bottom of the productivity distribution, and monetary prize tournaments only increase the productivity of teams at the top. We interpret these results through a theoretical framework that makes precise when the provision of team-based incentives crowds out the productivity enhancing effect of social connections under team production.