Q. If a fish jumps out from an aquarium on Shabbat, is one allowed to place it back while it is still alive?
A. Shemiras Shabbos K. (27: n. 98) permits returning the fish into the tank due to the Tzaar Baal Chaim or animal suffering involved. (See also Shulchan Aruch O,H, 305: 19)
Horav Shlomo Miller’s opinion is that even if Tzaar Baal Chaim, does not apply to very small fish, it is permitted in need, if leaving it to die would create an undesirable item of refuse that one may anyway be permitted to move (Geref Shel Rei). At that stage it may also be permitted to move if one owns an animal (cat) that may see it as food and benefit from consuming it.
Rabbi A. Bartfeld as advised by Horav Shlomo Miller, Horav Dovid Pam and Horav Aharon Miller Shlit’a