Peri, thank you for your comment.
Virginia had Black codes prior to the war as well, only they were confined to penitentiary prisoners used as cheap labor. After the war, the railroads cut deals with Virginia’s penitentiary warden and subsequently black inmates were farmed out to the worst jobs not only on railroads but in granite quarries and other jobs. These codes became institutionalized when the Legislature drew up lists of crimes that they knew itinerant freed slaves would easily break to force more black men into the prison system and thus onto the railroads and quarries. For example, it became a crime for a black man to “show an air of satisfaction about the end of the [civil] war.” This could get him 5–10 years in prison, and an appointment on the railroad through West Virginia. Other southern states adopted similar codes for similar reasons, and this was their relationship to Reconstruction in the South.
You can read more about Virginia’s Black Codes in my book “Virginia State Penitentiary: a Notorious History.” — DMB