HAKIM 7734:
from ʿAlī —
[Machine] "He named his eldest son after his uncle, Hamza, and he named Hussain after his uncle, Jafar. The Messenger of Allah ﷺ called Ali and said, 'I have been commanded to change the names of these two.' Allah and His Messenger know best, so he named them Hasan and Hussain."
الحاكم ٧٧٣٤:
عن علي —
أَنَّهُ سَمَّى ابْنَهُ الْأَكْبَرَ بِاسْمِ عَمِّهِ حَمْزَةَ وَسَمَّى حُسَيْنًا بِعَمِّهِ جَعْفَرٍ فَدَعَا رَسُولُ اللَّهِ ﷺ عَلِيًّا فَقَالَ «إِنِّي قَدْ أَمَرْتُ أَنْ أُغَيِّرَ اسْمَ هَذَيْنِ» فَقَالَ اللَّهُ وَرَسُولُهُ أَعْلَمُ فَسَمَّاهُمَا حَسَنًا وَحُسَيْنًا
hadithunlocked.com