Commander Cody, a key clone trooper commander during the Clone Wars, was forced to betray his Jedi general Obi-Wan Kenobi due to an inhibitor chip implanted in him by the Sith, which compelled clones to execute Order 66
. After the Clone Wars, Cody served the Galactic Empire for about a year, carrying out missions such as putting down riots and reclaiming worlds
. Over time, the effects of the inhibitor chip began to wear off, and Cody started to regret his actions, including betraying his Jedi comrades
. In Star Wars: The Bad Batch Season 2, Cody is shown leading a mission to retake a Separatist world. During this mission, he witnesses the Empire's ruthless tactics firsthand, including the execution of a surrendered leader by Crosshair, one of his clone troopers. This experience causes Cody to question the Empire's motives and his role in it
. Following these events, Cody is said to have deserted or gone AWOL from the Empire, though the exact circumstances and his fate remain unknown as of the latest episodes of The Bad Batch Season 3
. There were plans to include him in the Kenobi series, but these were dropped
. His ultimate fate is still a mystery, but it is speculated he might be in hiding like other clones who resisted Order 66. In summary, Commander Cody served the Empire reluctantly after the Clone Wars, came to regret his actions under Order 66, and eventually deserted, with his current whereabouts and fate remaining unknown