Commander Cody was the commander of the 212th Attack Battalion along with Jedi Master Obi-Wan Kenobi.
He went through A.R.C Trooper (Advanced Recon Commando) training through Alpha-17. He was assinged to Obi-Wan durng the battle of Genosis but never got to fought alongside him since Obi-Wan was fighting Count Dooku with his padawan Anakin.
The Clone Wars
In the clone wars he frequently fought alongside Captain Rex and Jedi General Anakin Skywalker. Rex and Cody grew a close bond and became good. friends.
Cody and his Jedi general cracked jokes from time to time but Cody also betrayed the Republic and gave the order to shoot down Obi-Wan.
Commander cody was killed when He tried to stop Obi-Wan from leaving Utapua. Obi-Wan had no other choice but to shoot down his friend.