When Hasan was born, he named him Hamza, and when Husayn was born, he named him Jafar after his uncle. He said, "The Messenger of Allah ﷺ called me and said, 'I have been commanded to change the names of these two.'"I replied, "Allah and His Messenger know best."So he named them Hasan and Husayn.
لما ولد الحسن سماه حمزة، فلما ولد الحسين سماه بعمه جعفر، قال: فدعاني رسول الله ﷺ، فقال: إني أمرت أن أغير اسم هذين فقلت: الله ورسوله أعلم. فسماهما حسنا وحسينا.
Ahmad (1370) narrated it, with this wording being his, as did Bazzar (657), Abu Yaala (498), and Tabarani in Al-Kabir (1023), all of them through various routes from Abdullah bin Muhammad bin Aqeel, from Muhammad bin Ali bin Hanafiyyah, from his father Ali bin Abu Talib, who said, and then he mentioned it.Its isnad is hasan because of Abdullah bin Muhammad bin Aqeel bin Abu Talib, for his hadith is hasan when he does not contradict others, and this is one such case. Haythami said in Al-Majma (8/52), "Ahmad, Abu Yaala, Bazzar, and Tabarani narrated it, and it contains Abdullah bin Muhammad bin Aqeel, whose hadith is hasan, while the rest of its narrators are the narrators of the Sahih."