Hadithcore
Sahih Muslim, 665 a
sahih

Jabir b. Abdullah reported:

There were some plots vacant around the mosque. Banu Salama decided to shift (to this land) and come near the mosque. This (news) reached the Messenger of Allah (ﷺ) and he said to them (Banu Salama): I have received (information) that you intend to shift near the mosque. They said: Yes, Messenger of Allah, we have taken this decision. Upon this he (the Prophet) said: O Banu Salama, live in your houses, for your steps are recorded; live in your houses, for your steps are recorded.

حَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، حَدَّثَنَا عَبْدُ الصَّمَدِ بْنُ عَبْدِ الْوَارِثِ، قَالَ سَمِعْتُ أَبِي يُحَدِّثُ، قَالَ حَدَّثَنِي الْجُرَيْرِيُّ، عَنْ أَبِي نَضْرَةَ، عَنْ جَابِرِ بْنِ عَبْدِ اللَّهِ، قَالَ خَلَتِ الْبِقَاعُ حَوْلَ الْمَسْجِدِ فَأَرَادَ بَنُو سَلِمَةَ أَنْ يَنْتَقِلُوا إِلَى قُرْبِ الْمَسْجِدِ فَبَلَغَ ذَلِكَ رَسُولَ اللَّهِ صلى الله عليه وسلم فَقَالَ لَهُمْ ‏"‏ إِنَّهُ بَلَغَنِي أَنَّكُمْ تُرِيدُونَ أَنْ تَنْتَقِلُوا قُرْبَ الْمَسْجِدِ ‏"‏ ‏.‏ قَالُوا نَعَمْ يَا رَسُولَ اللَّهِ قَدْ أَرَدْنَا ذَلِكَ ‏.‏ فَقَالَ ‏"‏ يَا بَنِي سَلِمَةَ دِيَارَكُمْ تُكْتَبْ آثَارُكُمْ دِيَارَكُمْ تُكْتَبْ آثَارُكُمْ ‏"‏ ‏.‏

References2 variants
In-Book Reference
Book 5, Hadith 352
USC-MSA web (English) reference
Book 4, Hadith 1407 (deprecated numbering scheme)
Sharh · explanationclick to expand
Taking many steps to the mosque is one of the greatest means of reward. The more distant the mosque and the more steps are taken to it, the greater the reward. In this Hadīth, Jābir ibn ‘Abdullāh (may Allah be pleased with him) informs that the area around the Prophet's Mosque became empty; "so, Banu Salimah wanted" [some of it]. Banu Salimah was a group of the Ansār, and their houses were far away from the Prophet's Mosque, located behind Mount Sal’, west of Madīnah. They wanted to move and stay close to the Prophet's Mosque, thus becoming neighbors to the Messenger of Allah (may Allah's peace and blessings be upon him). The Messenger of Allah (may Allah's peace and blessings be upon him) was told about that. Thereupon, the Prophet (may Allah's peace and blessings be upon him) said to them: "I was told." In other words, your news reached me "that you want" and desire "to move near the mosque." They replied: Yes, we desire to do that, O Messenger of Allah. "We want to." So, the Prophet (may Allah's peace and blessings be upon him) said to them: "O Banu Salimah, your houses." That is: Stay at your houses and remain therein and do not move from there. "Your footsteps are recorded." That is: Your steps to the mosque are recorded. You gain a reward for the steps you take to the mosque. Then, the Prophet (may Allah's peace and blessings be upon him) repeated his statement once again: "Your houses, your footsteps are recorded." This was to urge and encourage them to obey his command and stay in their houses and not leave them. As related in another Hadīth reported by Anas (may Allah be pleased with him) and narrated by Al-Bukhāri: "The Messenger of Allah (may Allah's peace and blessings be upon him) disliked that Madīnah be vacated." In other words, parts of Madīnah become vacated. So, by staying in their places, the Prophet (may Allah's peace and blessings be upon him) wanted the areas of Madīnah to be inhabited, so that the Muslims would seem large in number in the eyes of the hypocrites and polytheists, thus frightening them and showing toughness towards them. The Messenger of Allah (may Allah's peace and blessings be upon him) did not explicitly say it to them; he only mentioned to them the clear benefit, which would encourage them to agree and prompt them to stay at their houses. The Hadīth highlights the merit of walking to the mosques..
Related hadiths2
Compare isnād across 2 related chains →