Black codes were created at the end of the civil war making it harder for African Americans to have rights and freedom.This was a way for them to regain control of the freed slaves by maintaining white supremacy and to continue segregation. Which led to the creation of Jim Crow era and of segregation.