Rubbing and peeling shells/ stalks/ pods off from nuts/seeds/beans on Shabbos:
Note: In these laws there are various discrepancies between the rulings of the Shulchan Aruch and that of the Siddur. Although both rulings have been brought below, it is incumbent upon the reader to read the summary to know how we practically rule, taking into account all the rulings of the Siddur, which is the final say in these matters.
- The rulings of Admur in the Shulchan Aruch:
First opinion-It is allowed to do so with an irregularity: One may not extract seeds from stalks in the same method used during the week, which is to rub the stalks within the palms of one’s hands in order so the seeds fall out from it. Rather he must rub them with a slight irregularity using the tips of his fingers.
The reason this is allowed: Now, although by doing so he separates the seeds from the stalks with his hands, and one who separates [seed from a stalk] with his hands is [liable for transgressing] an offshoot of the threshing prohibition which is done using a vessel, as was explained in chapter 305 [Halacha 28], nevertheless [here] since he is separating it irregularly in order to eat (right away) it is permitted.
It was not decreed against doing so due to that one may come to separate [the seeds] as regularly done, being that even one who separates them in the usual method is also only considered to be doing so irregularly being that he does not take the food and actually remove it with his hands [from the stalks] but rather just rubs the stalk and causes the grains to fall and [this method] is usually only done with a vessel that is designated for threshing. However nevertheless it is Rabbinically forbidden [to separate by rubbing it with ones hands], although when this too is done with an irregularity they made no decree against doing so.
Other Opinions: [However] there are opinions which are stringent to not sort at all [the seeds out from] stalks of grains or from pods of legumes even using the tips of one’s fingers.
Rubbing off the green shell of nuts: Therefore [according to this latter opinion] it is forbidden to rub out the Luz nuts or large nuts from within their upper green shell which covers over their thick and hard shell, even with the tips of one’s fingers.
The Final Ruling: It is proper to be stringent [to not rub off the shell] being that one can anyways break it open and eat it without needing to separate [the shell]. [However according to Siddur rubbing is forbidden under all circumstances]. [See Q&A]
To peel off the thin peel of nuts, grains and legumes: It is permitted to break [the shell] and then peel off the thin peel that is on the fruit which is under the hard shell which is broken, as the Mifarek/detaching prohibition is only applicable by the top [greenish] shell. [See Q&A]
Similarly it is permitted to peel [the chaffs off] grains and legumes which have been removed from their stalks and pods from before Shabbos, although one must be careful to only peel as much as he needs to eat right away and not for what he will need to eat later on as will be explained in chapter 321 [Halacha 19]
[Regarding if one may shake off the thin peels from amongst the grains in a case that they have already been peeled off and are now sitting together with the grains- see Chapter 3.]
Peeling off the pods from legumes: However (according to all opinions) it is forbidden to peel the pods on Shabbos and remove the legumes from within them (with ones hands as doing so is [Halachicly considered] actually Mifarek/detaching [which is forbidden]).
Moist pods: However [the populace of] the world is accustomed to allow this to be done and there are opinions which seek merit [to justify] their actions [saying] that since the stalks are still moist and thus the pods themselves are still edible, it is thus like one is simply separating food from food which does not contain the detaching prohibition as explained in chapter 305 [Halacha 28].
Inedible-dry-pods: However those legumes which their pods are not edible there contains no permission at all to remove the legumes from within them on Shabbos unless the legumes are not at all attached to their pods, having been detached from them before Shabbos and it is rather simply sitting [loosely] within [the pod]. In such a case it is permitted to remove [as many legumes from the pod] as he wishes to eat right away, however he may not do so to eat later on due to the separating prohibition.
- The ruling of Admur in the Siddur:
Not to eat legumes that is still in their pods on Shabbos:
Inedible pods: [One] needs to be very careful not to eat on Shabbos beans, whether raw or cooked, which are still in their [inedible] pods. [See Q&A]
The reason for this is: because being that their pods are not edible, removing them contains the Mifarek/detaching prohibition according to all opinions, which is an offshoot of the threshing prohibition which one is liable for a sin offering and stoning Heaven Forbid.
The above applies even if the beans have detached from their pods: Now, although the beans have already [become] detached [inside] from their pod through the cooking process and are thus no longer attached to it [nevertheless the above Mifarek prohibition still applies].
Sesame seeds: The same restriction applies also towards sesame seeds.
Legumes with edible pods: A meticulous person should be stringent upon himself also with regards to the species of legumes called (Arbes) when they are still attached to their pods, even though their pods are also edible, as [separating the seeds from the pods] is not clearly allowed.
Avoid eating shelled nuts/seeds on Shabbos:
It is proper to avoid eating almonds and nuts on Shabbos unless they have been removed from their shells from before Shabbos. [See Q&A]
The reason for this is: because, although even when the nut/fruit remains totally or partially in its shell [on Shabbos] it is permitted to remove its shell with ones hands and does not contain [a] separating bad from good [prohibition], nevertheless after the fruit has been removed if there remains a piece of the shell amongst the pieces of fruit/nut or amongst whole nuts, then if one removes [that shell] from there he is liable for a sin offering [if done unintentionally] and stoning [if done intentionally] for [transgressing the prohibition of] separating waste from food. Rather one must separate the fruit/nut from amongst the shells and may not touch the shells at all.
Furthermore [in additional reason to avoid nuts] even if the shells are bunched up alone without having any mixture of fruit [of the nuts] amongst them, [nevertheless] there [still remains] a great prohibition in moving them due to that they are Muktzah, as is known.
And [since] it is difficult to beware from all the above [prohibitions, therefore it should be avoided.]
Pods of legumes and stalks of grains:
Rubbing off the pods and stalks of grains and legumes: If the pods are inedible then it is completely forbidden to rub them off [due to the threshing prohibition] even if they were cooked, and thus the legumes have already separated within the pod. If the pods are edible then a meticulous person should avoid eating them even in such a case.
Peeling off the pods of legumes:
Peeling off the thin peel of nuts, legumes and grains: Does not contain any Mifarek prohibition, although contains the separating restrictions and thus may only be peeled directly prior to the meal.
Nuts with shells:
Avoid eating nuts/seeds on Shabbos:It is proper to avoid eating them unless they have been shelled before Shabbos and are thus no longer mixed in with their shells. In the event that one eats nuts with shells on Shabbos the following are the laws involved in removing its shell:
Rubbing off the upper green shell:  It is forbidden to be done even with the tips of one’s fingers due to the threshing prohibition and rather one must crack it open.
Peeling off the upper green shell:  Is forbidden due to the Mifarek prohibition.
Peeling off the thin peel of nuts, legumes and grains: Does not contain any Mifarek prohibition, although contains all the separating restrictions, and thus may only be peeled directly prior to the meal.
Does the Mifarek prohibition also apply to pods which are grown with intent to be marketed together with their pods?
In such a case the Mifarek prohibition does not apply, although if the pod is inedible then all the Borer prohibitions would still apply. See next question.
May one peel off the pods of beans, peas, green beans? 
Legumes which are grown with intent to be marketed without their pods: If the pods are inedible then they may not be removed, due to the Mifarek prohibition, even if the beans have already become detached from within the pods.
If the pods are edible then from the letter of the law the pods may be removed without restriction and do not contain either the Mifarek or Borer prohibitions. However as Admur concludes in the Siddur a meticulous person is to be stringent even in such a case.
Pods which are grown with intent to be marketed while still within their pods: Such as green beans and Okra and the like, then if the pod is also edible, it contains neither a Mifarek or Borer prohibition. If the pod is inedible then although it does not contain a Mifarek prohibition, nevertheless it contains all the Borer restrictions and thus may only be peeled off right before the meal.
May one cut the pod and remove the beans?
May one remove corn from the cob on Shabbos?
To remove the kernels from the root in the cob is disputed amongst the Poskim. Some hold that doing so does not contain the Mifarek prohibition [although one must guard the Borer restrictions in doing so]. Others hold that it does contain the Mifarek restrictions and thus cannot be done at all.
To cut the kernels off the cob without removing the root from the cob: Since one only cuts off the upper part of the kernel, it does not contain the Mifarek prohibition although does contain the Borer restrictions and thus may only be done in close proximity to the meal.
To eat the kernels while on the cob: Is permitted according to all.
May one break open the shells of a nut using a vessel which is specified for that purpose, such as a nut cracker?
Depends on the nut. If it is a type of nut, such as a hazel nut, which upon having its shell cracked will have the nut fall out and thus be completely separated from the shell, then all the separating restrictions apply and one may not use a designated vessel in order to break it. However nuts which even after breaking still need to be separated from their shell, then one may use even a specified vessel to break it open.
May one use a hammer to break open the nut? 
Yes as a hammer is Muktzah Machamas Issur which may be used for a permitted purpose on Shabbos.
Once the shell has been cracked may one remove it from around the nut or must he remove the nut from out of the shell?
When the nut remains totally or partially in its shell it is permitted to remove its shell with ones hands and does not contain [a] separating bad from good [prohibition], [despite that by doing so one is removing the bad from the good, being that this is equivalent to peeling a fruit.]
Nevertheless after the fruit has been removed if there remains a piece of the shell amongst the pieces of fruit/nut or amongst whole nuts, then if one removes [that shell] from there he is liable for a sin offering [if done unintentionally] and stoning [if done intentionally] for [transgressing the prohibition of] separating waste from food. Rather one must separate the fruit/nut from amongst the shells and may not touch the shells at all.
May one peel off the shells of peanuts?
Some have forbidden doing so being that they consider this to be under the prohibition of Mifarek. Many others however have permitted this so long as it is done right before the meal and so is the general custom. In any event those which are stringent like Admur in the Siddur not to eat nuts with shells on Shabbos also avoid eating peanuts that have not been shelled before Shabbos.
May one peel off the outer peel of garlic [the peel which contains within it all the cloves] and take apart the cloves from each other on Shabbos?
Being that there are opinions which hold that removing the outer shell may contain the Mifarek prohibition therefore one is to remove this peel and separate the cloves from before Shabbos. If one did not do so from before Shabbos then he is to rub off the outer shell using the tips of his fingers which is an irregularity.  However Rav Farkash suggests that prior to resorting to this option one should try to remove the clove together with its outer peel and then remove the garlic from both the outer and inner peel without separating between the inner and outer peel.
According to Admur in the Siddur may one eat sunflower seeds on Shabbos?
If they are still in their shell certainly one is to avoid eating them on Shabbos for the reasons mentioned in the Siddur.
 This refers to almonds which when small are sweet and when they ripen become bitter. [Likuteiy Sichos 33 page Matos]
 The upper green shell usually is removed in the field or by the distributer and is thus usually not seen on the nut by the time it reaches the consumer. However there are times during the year that fresh original nuts are sold still in their green shell and thus due care must be taken not to remove the upper green shell through rubbing it.
 Lit. Good
 It seems that this is referring to nuts, being that the shell can be cracked, however by pods being that the only option is to rub them, then doing so would be allowed with an irregularity according to the final ruling of Admur, and so is implied also from chapter 321 Halacha 1.
 In Rama, the end of the chapter was not printed in the Alter Rebbe’s Shulchan Aruch. There he explained that one may not peel onions and garlic to eat later on.
 So is evident from below in which the case of edible pods is mentioned with different laws.
 So rules also M”B in Biur Halacha 6, as opposed to the ruling of Admur in the SH”A.
 This term is used today to refer to chickpeas
 Lit. good
However in the Shulchan Aruch 319/9 Admur rules that merely “It is proper to be stringent to not rub them even with an irregularity“, which is with using the tips of one’s fingers, even though that there are opinions which permit doing so in order to eat right away. However to rub them without an irregularity is forbidden according to all opinions even in the Shulchan Aruch.
 319/9 and Siddur
However according to the Shulchan Aruch 319/9, if the beans have been separated from the pods from before Shabbos then there is no Mifarek prohibition involved, although one must beware of all the separating restrictions explained above
 319/9 Regarding whether or not the restrictions of Borer apply too in this case. Rav Farkash in chapter 13 page 318 [see Biurim 6] sides that it is permitted being that it is simply like removing food from food. So rules also the Ketzos Hashulchan [126 footnote 3] and Peri Megadim.
However according to the Shulchan Aruch: It is proper to be stringent to not rub off the shell being that one can anyways break it open and then eat it without needing to separate the shell.
 Shabbos Kehalacha Vol. 2 p. 320
 So rules Ketzos Hashulchan 126 Footnote 4
 Shabbos Kehalacha Vol. 2 p. 316-320
 This follows the ruling of the Siddur, however according Admur in the SHU”A [Halacha 9] it is permitted in a case that the legumes have detached from within from their pod.
 Based on Ketzos Hashulchan 126 footnote 4
 So is implied from Admur 319/9 which forbids peeling the pod and then removing the beans with one’s hands.
 Shabbos Kehalacha Vol. 2 p. 321-322
 Tehila Ledavid 319/9, Mahrsham
 Being that it is only covered from its inner side as opposed to its outer side, and according to them only a food which is covered from both sides contains the Mifarek prohibition.
 Shevisas Shabbos leaves this as a Tzaruch Iyun. The Ketzos Hashulchan [126/5 footnote 11] goes into depth on the sides of the doubt and rules that one is to be stringent out of doubt based on the words of the Shevisas Shabbos.
 Shabbos Kehalacha Vol. 2 p. 307
 Shabbos Kehalacha Vol. 2 p. 307
 Siddur of Admur, taken from above
 Shabbos Kehalacha Vol. 2 p. 313
 Shut Sheivet Halevy 1/81
 Minchas Yitzchak 3/32, Bear Moshe, Mahrshag and others.
 Shabbos Kehalacha Vol. 2 p. 313-315
 Peri Megadim
 So rules Ketzos Hashulchan 126 footnote 8
 This is because based on Admur in the Siddur it seems that he rules like the stringent opinion above that it is forbidden to peel even using an irregularity such as using the tips of one’s fingers.
 Shabbos Kehalacha Vol. 2 p. 313