CC-2224 or Commander Cody often spent his time leading the Clone Troopers to fight against the Battle Droids during the Clone Wars.
Commander Cody appears in Star Wars: Episode III Revenge of the Sith, where he and his army went to help Obi-Wan Kenobi fight against General Grievous and his Battle Droid army. He later gave Obi-Wan his lightsaber back and afterwards was given orders from Darth Sidious to execute order 66. This caused him to to fire at Obi-Wan and possibly leave.
Commander Cody later went to work for the Galactic Empire as a member of the Storm Troopers.