How do economic and social position structure partisan affiliation? While neo-Durkheimian treatments of class and political behavior suggest the potential for extreme variability in the social bases of partisan affiliation, data limitations have largely restricted quantitative studies of this relationship to the postwar era. This temporal limitation restricts variation in observable social structure, thus limiting the ability of analysts to assess theoretical explanations. To address this gap, I introduce novel data on occupation and ethnicity for more than 20,000 Massachusetts state legislators in the nineteenth century. This allows me to find the "best fit" model for the social bases of party affiliation in four distinct periods in Massachusetts' political history. I show that the Massachusetts political system transitioned from a system of occupational cleavages to proto-class cleavages between the First Party System (1795–1826) and Second Party System (1835–54). The Civil War and Reconstruction Era (1855–77) was characterized by the emergence of an ethnic cleavage, but near-modern class divisions emerged as the strongest predictors of legislators' party affiliations for the remainder of the Third Party System (1878–93). Combined with historiographical accounts of the nineteenth century, these analyses suggest that the emergence of class politics requires intermediary organizations such as unions and professional associations, the liberalization of economic laws and regulation, and the increasingly unequal distribution of productive property.