Castro agreed to a minor-league contract with Houston on Monday, which includes an invitation to major-league spring training, Jon Heyman of the New York Post reports.
The Diamondbacks released Castro on Wednesday.
Castro was designated for assignment by the Diamondbacks on Tuesday, Alex Weiner of ArizonaSports.com reports.
Castro allowed one hit and struck out one over a scoreless inning in Saturday's 12-1 win over the Blue Jays.
The Diamondbacks reinstated Castro (shoulder) from the 15-day injured list Thursday.
Castro (shoulder) threw 17 pitches in an appearance with Triple-A Reno on Wednesday, Jesse Friedman of GoPHNX.com reports.
Castro (shoulder) made his second rehab appearance in the rookie-level Arizona Complex League on Saturday, striking out four and allowing one hit and no walks over two scoreless innings.
Castro (shoulder) threw a 26-pitch bullpen session Friday, Jesse Friedman of GoPHNX.com reports.
Castro (shoulder) threw a 21-pitch bullpen session Tuesday, Alex Weiner of Arizona Sports reports.
Castro (shoulder) was pulled back from his throwing program, Alex Weiner of Arizona Sports reports.