The Halacha permits handling a "Kli She’melachto L’isur" (a utensil whose primary function is prohibited, e.g. a hammer) L’sorech M’komo (if it is in the way). Once it is picked up to be removed, Maran rules that it does not have to be dropped as soon as it is out of the way; he may continue to handle it and store it normally, as long as it is still in his hand. Once he puts it down, of course, he may not pick it up again to put it away.
There is a stricter category of Mukse called "Mukse Machmat Gufo"-something which is not a utensil and is inherently rejected for any use on Shabbat. Examples include, sticks, stones and nut shells. Such items may not be handled at all, even L’sorech M’komo-if they are in the way. While all agree that one may eat a pistachio nut on Shabbat, the Poskim discuss what to do with the shell that remains in his hands after eating the nut. Must he immediately drop it wherever he is, because it is this strict type of Mukse, or, may he continue to hold it until he brings it to the garbage can, just as with regard to a hammer.
The Vilna Gaon (Rav Eliyahu of Vilna, 1720-1797) is strict and distinguishes between the two cases. Only in the case of Kli She’melachto L’isur, such a hammer, does the Halacha allow continuing to hold the Mukse, since that type of Mukse has other leniencies. However, items such as shells, which belong to the strict category of Mukse, must be discarded immediately. This is also the opinion of the Eben HaOzer, cited by the Sha’are Sion.
On the other hand, the Magen Abraham (Rav Abraham Gombiner, Poland, 1637-1682) holds that any type of Mukse that came to one’s hand with permission, may be continued to be handled until properly discarded. The Ben Ish Hai (Rav Yosef Haim Baghdad, 1833-1909) concurs with this opinion. According to the letter of the law, he permits continuing to handle a putrid vessel after disposing of its contents, until it can be properly stored. This is Halacha L’ma’aseh for the Sepharadim as recorded by the Menuhat Ahaba.
The question then becomes whether it is permitted to transfer the item to the other hand while he continues to bring it to its proper place. The Ben Ish Hai prohibits doing so, arguing that it would be considered a new act of handling. Certainly, it would be prohibited to pass it on to someone else to store it.
All of these Halachot dealt with cases where the Mukse was picked up "B’heter"-under permitted circumstances. What is the Halacha in a case where a person accidentally picked up a Mukse item? Does he have to drop it immediately, or may he continue to handle it until he can properly stow it? The Magen Abraham is lenient and treats such as case like the case where the Mukse entered his hands B’heter."
Any type of Mukse item that was picked up under permitted circumstances, may be handled until it is properly stored or discarded. However, one may not switch hands or transfer it to another person. This also applies to a case in which a person inadvertently picked up the Mukse item.