Ali bin Abu Talib reported,

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.

Azami 14518

Hasan

عن علي بن أبي طالب قال

لما ولد الحسن سماه حمزة، فلما ولد الحسين سماه بعمه جعفر، قال: فدعاني رسول الله ﷺ، فقال: إني أمرت أن أغير اسم هذين فقلت: الله ورسوله أعلم. فسماهما حسنا وحسينا.

الأعظمي 14518حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Superior moral conduct
Chapter
Names, kunyas, and titles
Section
Changing a name to a better one
Numbering
Jami al-Kamil 14518 (2nd edition)
Azami 14518