In Star Wars: The Clone Wars, the astromech droid that becomes Anakin Skywalker's companion is R2-D2.
The animated film and television series place R2-D2 alongside Anakin during the Clone Wars. Unlike many astromech units, R2-D2 is repeatedly sent into dangerous situations, where his ability to interface with computers, repair equipment, and improvise solutions helps the Jedi and clone troopers.
The series also introduces R3-S6, a gold-colored astromech assigned to Anakin as a replacement. R3-S6 is secretly a Separatist infiltrator, while R2-D2 remains loyal to Anakin and eventually exposes the deception. This plot is a frequent source of confusion because both droids accompany Anakin during the same storyline.
R2-D2's Clone Wars appearances connect the prequel-era character to his later role beside Luke Skywalker in the original trilogy.