كتاب الجهاد والسير
32
The Book of Jihad and Expeditions
(48)
Chapter: Women who take part in military expeditions are to be given a reward but not a regular share; And the prohibition of killing children of the enemy
(48)
باب النِّسَاءُ الْغَازِيَاتُ يُرْضَخُ لَهُنَّ وَلاَ يُسْهَمُ وَالنَّهْىُ عَنْ قَتْلِ صِبْيَانِ أَهْلِ الْحَرْبِ

This tradition has been narrated by the game authority (Yazid b. Hurmus) through a different chain of transmitters with the following difference in the elucidation of one of the points raised by Najda in his letter to Ibn Abas:

The Messenger of Allah (ﷺ) used not to kill the children, so thou shouldst not kill them unless you could know what Khadir had known about the child he killed, or you could distinguish between a child who would grow up to he a believer (and a child who would grow up to be a non-believer), so that you killed the (prospective) non-believer and left the (prospective) believer aside.
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَإِسْحَاقُ بْنُ إِبْرَاهِيمَ، كِلاَهُمَا عَنْ حَاتِمِ بْنِ إِسْمَاعِيلَ، عَنْ جَعْفَرِ بْنِ مُحَمَّدٍ، عَنْ أَبِيهِ، عَنْ يَزِيدَ بْنِ هُرْمُزَ، أَنَّ نَجْدَةَ، كَتَبَ إِلَى ابْنِ عَبَّاسٍ يَسْأَلُهُ عَنْ خِلاَلٍ، ‏.‏ بِمِثْلِ حَدِيثِ سُلَيْمَانَ بْنِ بِلاَلٍ غَيْرَ أَنَّ فِي، حَدِيثِ حَاتِمٍ وَإِنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم لَمْ يَكُنْ يَقْتُلُ الصِّبْيَانَ فَلاَ تَقْتُلِ الصِّبْيَانَ إِلاَّ أَنْ تَكُونَ تَعْلَمُ مَا عَلِمَ الْخَضِرُ مِنَ الصَّبِيِّ الَّذِي قَتَلَ ‏.‏ وَزَادَ إِسْحَاقُ فِي حَدِيثِهِ عَنْ حَاتِمٍ وَتُمَيِّزَ الْمُؤْمِنَ فَتَقْتُلَ الْكَافِرَ وَتَدَعَ الْمُؤْمِنَ ‏.‏
Reference : Sahih Muslim 1812 b
In-book reference : Book 32, Hadith 167
USC-MSA web (English) reference : Book 19, Hadith 4457
  (deprecated numbering scheme)