The soldiers were bred to fight against the separatist planetary and sectorial governments seeking to leave the Republic, known as Confederacy of Independent Systems, in the coming war. Rex displayed a strong working relationship and a degree of friendship with Commander Cody. Though loyal and committed to his duty and to his fellow clones, Rex proved capable of questioning his superiors and, under extreme circumstances, outright disobeying orders if he believed them to be wrong. Rex served under Jedi General Anakin Skywalker, and was a freethinking, tough, and aggressive trooper.