A walk-in closet that is four by four amot requires a mezuzah on the right side of one entering it.[A] If its area is sixteen amot sq., but it is long and narrow (e.g. two by eight amot), a mezuzah is placed there without a berachah.
If a walk-in closet is less than sixteen amot sq.,[1][B] some poskim suggest that it is praiseworthy to affix a mezuzah on the right of the closet as it opens into the room, without a berachah.[2] However, in America many rabbonim exempt this small walk-in closet in accordance with the view of R. Moshe Feinstein.[3]
Additionally, all would agree that when this small closet is generally accessed by standing outside of it and reaching in,[C] it is exempt from a mezuzah even on the right side of its door leading to the big room. Since the doorway is not for entry and exit, it is not truly a “walk-in” closet even when it is large enough for a person to “walk into” it. [4]
If the closet is inside the bedroom of a married couple, the mezuzah should be enclosed with two coverings, one of which being opaque. Even if the mezuzah is placed on the frame inside a closed closet door, it is advisable to cover it with two covers.[5]
[1] Kuntres HaMezuzah (286:149) writes that if it is less than 7 tefachim wide, its obligation is extremely doubtful.
[2] Hagahos R. Akiva Eiger 286:13, as interpreted by Chazon Ish Y.D. 168:5; Parashah Sedurah 42. Cf. Chamudei Daniel, cited in Pitchei Teshuvah Y.D. 286:13.
[3] Igros Moshe Y.D. 1:181. See Inside Stam p. 214.
[4] Shevet HaLevi 3:103; Kuntres HaMezuzah 286:104; Chovas HaDar 4:27.
[5] In case the door is inadvertently left open during marital relations. Shach Y.D. 286:10; Sha’arei HaMezuzah 18:9.