Question: If among a cluster of grapes there are several rotten ones, may one remove the rotten grapes from the cluster so that only the good and edible ones remain?
Answer: In previous Halachot we have explained that it is forbidden to select waste from food on Shabbat, even if this is being done with the intention to eat the food immediately, as we have discussed.
Regarding a cluster of grapes (or cherry tomatoes for that matter) which contains several rotten grapes, clearly, one may not remove the bad grapes from the cluster as this constitutes selecting waste from food, for the bad grapes are “waste” and the good grapes are “food.” Thus, Maran zt”l rules that removing the bad grapes from the cluster is indeed a Torah prohibition.
This applies even if the rotten grapes are not so rotten and are still edible and one merely does not wish to eat them; it is nevertheless certainly forbidden to remove them on Shabbat, for, as we have already explained, any item one does not desire is considered “waste” relative to the item one does desire. (Nevertheless, in this instance the prohibition is only rabbinic in nature and is not a Torah prohibition.)
A certain great rabbi rules leniently on this matter and has brought a source for this based on what several Rishonim write that one may separate forbidden fats (found on certain cuts of meat from the hindquarters of the animal) from meat on Yom Tov. The reason for this is because the forbidden fat is attached to the meat and according to some, selecting does not apply to something which is attached.
Maran Rabbeinu Ovadia Yosef zt”l disagrees with his opinion and writes that there is a great distinction between meat which is actually attached to the forbidden fat and a bunch of grapes which are attached to a cluster (stem): Regarding meat attached to forbidden fat, separating the fat from the meat is tantamount to removing a fruit from the peel which surrounds it to which selecting does not apply. However, removing grapes from their cluster is not similar to peeling a fruit at all.
Summary: Regarding a cluster of grapes which contains some good grapes and some which are not so good, it is forbidden to separate the bad grapes and leave only the good ones, for this constitutes selecting “waste” from “food” which is forbidden. Therefore, one should remove the good grapes and eat them; afterwards, one may dispose of the stem with the bad grapes. The same applies to a cluster of cherry tomatoes which contains some good tomatoes and some rotten or green ones; one may not remove the bad ones first; rather, one must remove the good ones first, as we have explained.