How do you avoid baby getting mom's HIV in pregnancy?

Pre-natal/natal care. Present aggressive management of pregnant HIV moms has reduced fetal/neonatal transmission from ~ 40 to less than 5%. By reducing mom's viral load, the transfer of the disease may be avoided.The babies receive meds at birth until later testing verifies that they escaped the disease.
Prophylactic Tx. There are anti-retrovirals used during pregnancy which dramatically reduce the risk of the baby being born with hiv, but they are not 100% effective. Talk to your OB doctor about this. They are very aware of the need for these agents.