Our teacher, the Rema, wrote in section 1: "And some say that our standard karpifot are considered enclosed for dwelling, as it is customary to make the opening first and afterwards to enclose. And some say further, that any karpaf which is adjacent to his house is considered an enclosure for dwelling, for his mind is upon it; and some disagree regarding this." Thus far his words; he was brief in his words. And the first law is from the Mordechai there, who wrote that nowadays our karpifot are enclosed for dwelling, and so it is customary to make the opening first and afterwards to enclose. Thus far his words. That is to say, even though it has been explained that a karpaf behind the city where wood is placed is not considered enclosed for dwelling, this is because they were not entering and exiting it constantly, but nowadays, they enter and exit it constantly. And if it is because we require the opening and then the enclosure, our karpifot are also thus, for first they open the opening of this dwelling in it, and afterwards they enclose it. And he wrote further, that a karpaf adjacent to his house within the Shabbat limit is considered an enclosure for dwelling, for his mind is upon it, and some disagree. And behold, as it appears, this is entirely redundant, for since he wrote previously that all our standard karpifot are enclosed for dwelling, which is not similar to the karpifot in the time of the Gemara, what relevance does this dispute have, which pertains to the time of the Gemara? And it must be said, that he brought this even for one who does not hold of the previous law. (See Magen Avraham subsection 4 who wrote that regarding a watchman's hut and a dwelling house even the Tosafot admit that it is effective, see there. And the Eliyah Rabbah subsection 12 already challenged him, for it is explicitly proven that even in this they disagree, see there, and so we find in the Beit Yosef. And as for the fact that the Rema did not mention this, it seems to me because it was obvious to him like the opinion of the Tosafot, that it is not effective; and only regarding being adjacent to the city, where in any case according to the previous "some say" every karpaf is effective in this time, he also brought the opinion of the Hagahot Ashri. However, regarding the essence of the matter, I do not know if the Hagahot Ashri disagree with the Tosafot, for it seems to me that they only wrote this to explain the words of Rabbi Yochanan ben Beroka, and so it is explicitly explained in the Or Zarua HaGadol siman 130, see there and examine carefully).
וכתב רבינו הרמ"א בסעיף א'"ויש אומרים, דסתם קרפיפות שלנו מקרי מוקפות לדירה, דרגילים לעשות פתח תחלה ואחר כך להקיף. ויש אומרים עוד, דכל קרפף שהוא סמוך לביתו - מקרי היקף לדירה, כי דעתיה עילויה, ויש חולקין בזה" עכ"ל, קיצר בדבריו. והדין הראשון הוא מהמרדכי שם, שכתב דעכשיו קרפיפות שלנו הן מוקפות לדירה, וכן רגילים לעשות פתח תחלה ואחר כך להקיף, עכ"ל. כלומר, דאף על פי שנתבאר, דקרפף שאחורי העיר שמניחין שם עצים - לא הוה מוקף לדירה, זהו מפני שלא היו נכנסים ויוצאים בה תדיר, אבל עכשיו, נכנסין ויוצאין בה תדיר. ואי משום דבעינן פתח ולבסוף הוקף, גם קרקיפות שלנו כן הוא, דמתחלה פותחין בה הפתח של הדירה הזו, ואחר כך מקיפין אותה. וכתב עוד, דקרפף הסמוך לביתו בתוך תחום שבת - מקרי היקף לדירה, דדעתיה עליה, ויש חולקין. והנה לפי הנראה, זהו מיותר לגמרי, דכיון שכתב מקודם דסתם קרפיפות שלנו כולן מוקפות לדירה, שאינו דומה להקרפיפות שבזמן הגמרא, מה שייך מחלוקת זו שהיא על זמן הגמרא. וצריך לומר, שהביא זה אפילו למאן דלא סבירא ליה הדין הקודם. (עיין מג"א סק"ד שכתב דבשומירה ובית דירה גם התוס' מודים דמהני ע"ש. וכבר השיג עליו הא"ר סקי"ב, דמוכח להדיא דגם בזה פליגי ע"ש, וכן מצינו בב"י. ומה שלא הזכיר זה הרמ"א, נראה לי משום דפשיטא ליה כדעת התוס', דלא מהני, ורק בסמוך לעיר, דבלאו הכי להיש אומרים הקודם מועיל בזמן הזה כל קרפף, הביא גם דעת הגהות אשר"י. אך בעיקר הדבר לא ידעתי אם הגהות אשר"י חולקים על התוס', כי כמדומה לי שלא כתבו זה רק לביאור דברי רבי יוחנן בן בורקה, וכן מבואר להדיא באור זרוע הגדול סימן ק"ל ע"ש ודו"ק).