“L’shem Kedushat Sefer Torah”
Is a sofer required to explicitly declare “l’shem Kedushat Sefer Torah” when writing a Torah?
There is some question whether a sofer is required to explicitly declare “l’shem Kedushat Sefer Torah” when writing a Torah and/or when writing the name of God.
In OC 32:8, the Shulchan Aruch writes, “The parchment must be processed with a gall-nut solution or lime mixture, and it must be processed l’shma. It is proper to verbally state at the beginning of the production that one is producing the parchment for the sake of Tefillin or a Sefer Torah. But if it was manufactured for the sake of a mezuzah it is passul.”
This seems to imply that a verbal declaration is a “proper” thing to do, but that it is not an outright obligation.
One the other hand, in YD 276:2, the Shulchan Aruch writes, “One is obligated to verbally declare before writing a Torah that one is doing so l’shma – for the sake of the holiness of a Sefer Torah. If he did not do this, his writing is passul.”
This seems to imply that a verbal declaration is halachically required.
How do we reconcile this contradiction?
Perhaps, there is a “de-facto” l’shma regarding the production of klaf since it is certainly going to be used for something sacred. When writing a Sefer Torah, however, a declaration is vital to distinguish between writing for practice or even for study, and writing for the sake of a true Sefer Torah.
 This essay appeared on the Torahmusings.com website where I serve as halacha columnist and General Editor. At the time, I received the following two responses: Joel Rich cites Rabbi Akiva Eiger who asks this question in his note to OC 32:8 but leaves the question unanswered -- “tzarich iyun.” Rabbi Yoseph Oziel suggests that a connection cannot be made between the OC citation and the YD one. He is of the opinion that the former is referring exclusively to klaf and the latter, exclusively to the writing, and no connection can be drawn between them. This approach, however, is refuted by the Shach, YD 271:3, who insists that a connection can be drawn between the two cases.
Rabbi Millman's Marei Mekomos Halacha
New Daf Hashavua newsletter - Shavua Matters
Rabbi Yechiel Grunhaus - Points to Ponder
Rabbi Azriel Katz - Meforshim Overview