Hadithcore
Riyad as-Salihin, 1056

Jabir (May Allah be pleased with him) reported:

There were some plots of land lying vacant around the mosque. The people of Banu Salamah decided to move to this land and come nearer to the mosque. The Messenger of Allah (ﷺ) heard about it and said to them, "I have heard that you intend to move near the mosque." They said: "Yes, O Messenger of Allah! We have decided to do that." Thereupon the Messenger of Allah (ﷺ) said, "O Banu Salamah! Stay in your houses, because your footprints (when you come to the mosque) will be recorded." He said this twice. They said: "We would not have liked it, had we moved near the mosque." <b>[Muslim]</b>.

وعن جابر رضي الله عنه قال‏:‏ خلت البقاع حول المسجد فأراد بنو سلمة أن ينتقلوا قرب المسجد، فبلغ ذلك النبي صلى الله عليه وسلم فقال لهم‏:‏ ‏"‏بلغني أنكم تريدون أن تنتقلوا قرب المسجد‏؟‏ قالوا‏:‏ نعم يا رسول الله قد أردنا ذلك، فقال‏:‏ ‏"‏ بني سلمة دياركم تكتب آثاركم، دياركم تكتب آثاركم‏"‏ فقالوا‏:‏ ما يسرنا أنا كنا تحولنا‏"‏ ‏(‏‏(‏رواه مسلم، وروى البخاري معناه من رواية أنس‏)‏‏)‏‏.‏

References1 variant
In-Book Reference
Book 8, Hadith 66
Sharh · explanationclick to expand
<b>Guidance from the Hadiths:</b><br> 1) It is better to walk to the mosque than to ride to it, unless walking involves difficulty. The easier, the better, for the Prophet (may Allah’s peace and blessings be upon him) “was never given a choice between two things except that he would choose what was easier, unless it was a sin.” [Narrated by Al-Bukhāri as reported by ‘Ā’ishah (may Allah be pleased with her)]<br> 2) The good deeds of a person are recorded for him, along with the resultant effects. This comes from the grace of Allah towards His servants.<br> 3) The Companions (may Allah be pleased with them) were keen to attend congregational prayers and live near the mosque, which shows their intent to hasten to do good deeds and reap the rewards. It behooves us to follow their example.
Related hadiths3
Compare isnād across 3 related chains →