We analyze the effects of several class compositional dimensions on individual student achievement. We make use of a rich dataset that allows tackling major endogeneity concerns stemming from non-random allocation of students between and within schools. We find that increasing the percentage of high achievers in a 6th grade class has a negative effect on student performance, while in a 9th grade class the effect is in general non-significant. Students with no past retentions do better with an increasing proportion of this same type of classmate. Larger shares of low-income classmates hurt performance in general. Apart from the past retention dimension in which there is evidence supporting students’ tracking, along all other compositional dimensions each class should reflect the respective school-grade population heterogeneity. Class composition rearrangements are estimated to provide a larger increment to performance than comparable reductions of class size.