The Black Codes were laws passed by southern states in the United States during Reconstruction that limited the rights of former slaves.
Note that the Black Codes are not the same as the Jim Crow laws. The Black Codes were enacted in 1865 directly after the Civil War, whereas the Jim Crow era began in 1890.