The Gemara in Masechet Beitzah (30a) states that one may not drum, clap, or dance on Shabbat lest one come to fix a musical instrument (ibid. 36b).
This means that just as we have discussed in the previous Halachot that our Sages have decreed that one may not play musical instruments on Shabbat lest one come to fix them on Shabbat by tuning the cords and the like, they have likewise banned all forms of sound production which resemble musical tunes on Shabbat.
Our Sages therefore forbade clapping one’s hands, dancing (as we shall soon discuss), and drumming on a table to the rhythm of a song on Shabbat, for all of these things are included in the prohibition of producing sound on Shabbat and Yom Tov.
We have already mentioned that the concern of our Sages that one will come to repair a musical instrument still applies nowadays, for musicians commonly “repair” their instruments by tuning their instruments and the like while they are playing.
However, the Tosafot write that the reason for this decree no longer applies so much nowadays and as such, it is customary to act leniently nowadays. The Poskim deal with this matter lengthily regarding whether or not we say that once the reason for the decree no longer applies then the decree is thereby nullified. (Some say that although tuning musical instruments is common nowadays, the original decree was instated lest one come to create a new musical instrument, which no longer applies that much nowadays.)
Halachically speaking, the Rambam (Chapter 23 of Hilchot Shabbat) and Maran Ha’Shulchan Aruch (Chapter 339) rule that it is forbidden to clap one’s hands together on Shabbat lest one come to repair a musical instrument. The Rama notes on this point that nowadays there are those who are lenient in this regard and the reason we do not protest this is because it is better for people to do so unintentionally than to do so intentionally. This means that since those who are customarily lenient in this regard will not listen to us if we say it is forbidden, it is better to keep quiet and not to protest. He adds another reason for leniency based on the words of the Tosafot that the reason for the decree no longer applies nowadays and there is therefore room for leniency. (It is for this reason that several Ashkenazim and some Chazzanim of Moroccan descent are customarily lenient, for they rely on the opinion of the Tosafot.)
Even those who are customarily lenient and regarding whom the Rama writes that we do not protest, this only applies to clapping one’s hands; however, with regards to actually playing musical instruments, the Poskim (Sha’ar Ephraim, Chapter 36 and Maran zt”l in his Chazon Ovadia writes lengthily on this topic) write that there is only room for leniency regarding clapping. However, regarding actually playing an instrument, such as a whistle, bell, or drum, this is certainly forbidden even nowadays, even according to the opinion of the Tosafot.
Thus, halachically speaking, one should act stringently and not clap one’s hands together on Shabbat. This is especially true in Israel where the rulings of Maran Ha’Shulchan Aruch have been accepted and since this is based on the words of the Rambam who was the chief halachic authority in all Middle Eastern lands.
Summary: One should not clap one’s hands on Shabbat. One should likewise not drum on the table to the rhythm of a tune on Shabbat. However, it is permissible to do so on Shabbat in an unusual manner such that this does not resemble the way one would do so during the week, such as clapping the back of one’s hand into the palm of one’s other hand or drumming on the table with the back of one’s hand.