Mission to Agamar (2 BBY)

In 2 BBY, Captain Rex and the Spectres undertook a mission to the planet Agamar to obtain proton bombs from a Separatist transport ship. However, they were captured by a platoon of still-functioning battle droids led by the super tactical droid Kalani. The malfunctioning Kalani wished to end the Clone Wars on his own terms, and challenged the rebels to a battle that would decide the victors, taking Zeb hostage. Led by Rex, Ezra and Kanan eventually managed to overpower the droids and confront Kalani, but the Galactic Empire suddenly arrived and attacked the Separatist ship. The rebels and Separatists came to the conclusion that the Empire was the real victor of the Clone Wars, and decided to unite to get a victory of their own. They used the droids to distract the Imperial stormtroopers and walkers in order to cripple them with proton bombs, which allowed them to steal Separatist Sheathipede-class transport shuttles and escape the planet.

Prelude
After the Separatist leaders were slaughtered by Darth Vader in the aftermath of the Clone Wars, all Separatist battle droids were to be shut down. However, the super tactical droid Kalani assumed that the extermination of the Jedi was just a Galactic Republic trick and avoided the shutdown along with the droids under his control.

In 2 BBY, the Ghost crew received information about a destroyed Separatist supply ship on Agamar from Rex, and they traveled there in order to gain the ammunition left behind, especially proton bombs. Kanan Jarrus, Ezra Bridger, Garazeb Orrelios and Chopper accompanied Rex while Hera Syndulla and Sabine Wren departed to handle other business.

Blast from the past
The rebels entered the transport ship and uncovered a large supply of proton bombs in the hangar, but as they were about to collect them, they were surrounded by a ray shield. They were then surrounded by Separatist battle droids, who mistook the rebels for Republic troops and prepared to shoot them. However, they immediately received orders to stun and capture the rebels instead, and they did so. Chopper, who had deviated from his allies' path, remained free and unnoticed in the hangar.

Rex, Ezra, Kanan, and Zeb awoke in the command center, where they came face to face with the Separatist super tactical droid Kalani. Kalani revealed to the rebels how he and his troops were still functioning, and told them about his desire to end the Clone Wars with a Separatist victory, despite the rebels telling him that the Clone Wars had ended. Kanan and Rex refused to fight the droids, but Ezra agreed, on the conditions that Zeb would be released and they would gain possession of all the proton bombs if they won, which Kalani agreed to. Kanan and Rex decided to agree with Ezra, and the battle preparations began.

Meanwhile, Chopper found a Sheathipede-class transport shuttle in the hangar and sent a distress signal to the Ghost. However, the Ghost was being pursued by Governor Arihnda Pryce and Agent Kallus during a supply run, and the Imperial fleet intercepted the signal. They decided to take advantage of the rebels' distress call and head to Agamar.

Reenacting the Clone Wars
On Agamar, Rex, Kanan, and Ezra returned outside as Kalani laid out the conditions for the battle: he would take Zeb hostage, and the three rebels would fight his battle droids. If the rebels captured the command center, they would win. Kanan chose Rex to lead them into battle due to his combat experience, and Rex told them that since they were heavily outnumbered, they would have to attack the hangar aggressively. As the battle droids approached, the rebels adopted a sword and shield formation, where Kanan and Ezra blocked the droids' blaster bolts with their lightsabers in order to give Rex cover to throw detonators at the droids. The rebels managed to push through the droids as they took refuge in the hangar, and they seemed to face no opposition after that.

However, this was all part of Kalani's tactics, and when the rebels went out into the open, Kalani sent Droidekas into the crosswalk above the hangar to fire at them. Overwhelmed by the droidekas, Ezra got the idea to attack them with a nearby crane while Rex and Kanan drew their fire away. They split up, and Rex and Kanan resumed their attack on the droidekas, though Rex was wounded in the right shoulder. Meanwhile, Ezra ran into Chopper, who told him about the Separatist shuttle. Ezra then used the Force to control the crane and ram it into the bridge, causing the droidekas to fall and break. Ezra reunited with Kanan and Rex, but Rex was angry at Ezra for not executing their plan efficiently.

The rebels exited the hangar into the halls of the ship, where they were surrounded by two droidekas. Kanan managed to Force push one of them, causing it to malfunction and destroy itself. The other one managed to graze Ezra, but Rex threw his helmet at it, causing its shields to fall and allowing the clone to destroy it with a blaster shot. The rebels reflected that the droids were not as durable as they used to be due to their age.

The real Clone Wars victors
The rebels entered the command center and prepared to claim victory, but Kalani was not about to honor it as he claimed that his droids would have won if they were in their peak condition. Rex prepared to shoot the droid, but Ezra stopped him, having realized that neither the Republic nor the Separatists really won the Clone Wars. As an imperial platoon arrived on Agamar, Ezra realized that the two sides had been decimated by the true victors: the Empire. Meanwhile, some battle droids confronted the stormtroopers at the front of the ship, but were easily dispatched. Ezra offered an alliance between the two sides to fight against the Imperial platoon, convincing Kalani's programming that the Empire, as an extension of the Republic, was his enemy as well, and the two sides agreed.

Ezra created a plan to escape on the Stealthipede-class shuttles that Chopper had found, but the problem was that the remaining battle droids were too depleted to battle the Empire, and the shuttles had no weapons. However, the rebels had the idea to attack the Imperial All Terrain Armored Transport walkers with the proton bombs they came for. Due to the battle droids' aim not being accurate enough to set off the bombs, they would instead fire at Kanan and Ezra, who would redirect the blaster shots toward the bombs.

The rebels and the Separatists moved to the hangar, and Zeb led the battle droids in direct combat against the All Terrain Defense Pod walkers, which the droidekas managed to heavily damage. While this happened, Rex threw the proton bombs at the AT-AT, and Kanan and Ezra redirected the shots they had fired at them, successfully setting off the bombs and destroying one of the AT-ATs. In the midst of the chaos, the rebels boarded one shuttle while Kalani and the remaining battle droids boarded the other two, although the shuttle occupied entirely by battle droids was shot down. The remaining two shuttles managed to fly through the Imperial platoon and successfully escape into space.

Aftermath
The two ships entered space, where the Ghost was waiting for the rebels. Due to calculating a low chance of success of defeating the Empire, Kalani and his forces parted ways with the Rebels. Kanan contacted Hera, who was shocked to hear that they had not gained any proton bombs, but Kanan told her that instead they had gotten a new Phantom: the shuttle they were currently piloting.