Trapping animals was one of the melakhot performed for the Mishkan. They would trap teĥashim to make curtains from their skins and the ĥilazon to produce tekhelet to dye the curtains (Shabbat 73a; Rashi ad loc.; Shabbat 75a).
The Torah prohibition of Tzad is limited to those animals – beasts, birds, or fish – that are normally trapped or hunted for a purpose, whether to eat their meat, use their skins, or enjoy their beauty (as is the case with parrots). In contrast, one who traps species that are not normally hunted, such as flies and other insects, violates rabbinic law (Shabbat 106b; SA 316:3).
The prohibition of Tzad does not apply to tame animals that do not run away from their owners, such as cows, donkeys, and dogs. Since in any case they stay with their owners, there is no such thing as trapping them (Rema 316:12; MB ad loc. 59). Nevertheless, carrying these animals is prohibited, as they are muktzeh. When necessary they may be grabbed and dragged into their pen or kennel, as long as they are not picked up (SA 308:40; see section 3 above).
If an animal is partially tame in that it runs away when a human tries to grab it but returns to its cage at night, its trapping is rabbinically prohibited (Rema 316:12: MB ad loc. 57, 59). When necessary, in order to avoid monetary loss or tza’ar ba’alei ĥayim, one may rely on those who are lenient and trap a partially tame animal. (See SA ad loc.; SSK 27:36.)
The Torah prohibition refers to completely trapping an animal; that is, holding it in hand, with ropes, or in a cage such that one can do with it as he pleases. Similarly, one who shepherds an animal into an area small enough that he can chase and catch it in one motion, he violates Torah law. In contrast, if one herds an animal into a large area where he would still need to chase it down in order to capture it, he does not violate Torah law, as the animal is not well and truly trapped. However, this is rabbinically prohibited, because the animal can now be more easily trapped. If he subsequently captures it, even though doing so is easier than usual, he is still violates Torah law, as this is the Tzad that the Torah forbids (Shabbat 106b; SA 316:1).
Hunting with the aid of a dog is forbidden. However, if one commands the dog with his voice and does not actually touch it, the prohibition is rabbinic. If he takes any action to help with the capture, he violates Torah law (Rema 316:2; MB ad loc. 10).
A mouse trap may be put out on Friday, since no action is taken on Shabbat. However, it is rabbinically prohibited to put out a trap on Shabbat. This is not prohibited by Torah law, as it is not certain that the trap will succeed in catching anything (MB 316:18).
An animal may be freed from a trap on Shabbat. While there is a prohibition to trap an animal, there is no prohibition to free an animal from a trap on Shabbat (MB 316:25).
One who wishes to feed a caged animal or bird whose nature is to try to escape must take care not to open the cage even briefly. If he mistakenly opened the cage, then if the cage is so small that confining the animal or bird to it would be considered Tzad by Torah law, then the cage may not be closed even be-di’avad. If the cage is large enough that confining the animal or bird to it would only be rabbinically prohibited, be-di’avad one may close it, since the animal or bird was inside when Shabbat began (Pri Megadim; BHL 316:6 s.v. “ve-halakh”).