The Messenger of Allah ﷺ said, "Adam and Musa, peace be upon them, argued before their Lord, and Adam outargued Musa.Musa said, 'You are Adam, whom Allah created with His own hand, into whom He breathed of His spirit, before whom He made the angels prostrate, and whom He settled in His Paradise. Then by your sin you caused humanity to be sent down to the earth.'Adam replied, 'You are Musa, whom Allah chose for His message and His direct speech, and to whom He gave the tablets in which everything is made clear, and whom He drew near in intimate conversation. By how many years did you find that Allah wrote the Torah before I was created?'Musa answered, 'By forty years.'Adam asked, 'Did you find in it, "And Adam disobeyed his Lord and erred" [Ta-Ha 20:121]?'Musa said, 'Yes.'Adam said, 'Then do you blame me for doing a deed that Allah had decreed I would do forty years before He created me?'"The Messenger of Allah ﷺ said, "So Adam outargued Musa."
قال رسول الله ﷺ: احتج آدم وموسى عليهما السلام عند ربهما فحج آدم موسي، قال موسى: أنت آدم الذي خلقك الله بيده، ونفخ فيك من روحه، وأسجد لك ملائكته، وأسكنك في جنته، ثم أهبطت الناس بخطيئتك إلى الأرض، فقال آدم: أنت موسى الذي اصطفاك الله برسالته، وبكلامه، وأعطاك الألواح، فيها تبيان كل شيء، وقربك نجيا، فبكم وجدت الله كتب التوراة قبل أن أخلق، قال موسى: بأربعين عاما. قال آدم: فهل وجدت فيها {وعصى ءادم ربه فغوى} قال: نعم. قال: أفتلومني على أن عملت عملا كتبه الله على أن أعمله قبل أن يخلقني بأربعين سنة، قال رسول الله ﷺ: فحج آدم موسى.
Muslim narrated it in the Book of Qadar (15:2652) via Anas bin Iyad, who said, Harith bin Abu Dhubab told me, from Yazid (that is, Ibn Hurmuz) and Abdul-Rahman Araj, who both said, We heard Abu Hurairah say, and he mentioned the hadith.