Ibn Abbas had a dispute with Hurr bin Qays bin Hisn al-Fazari about the companion of Musa. Ubayy bin Kaab passed by them, so Ibn Abbas called him over and said, "I have been disputing with my companion here about the companion of Musa, the one whom Musa asked for the way to meet. Did you hear the Messenger of Allah ﷺ mention his story?"Ubayy replied, "Yes, I heard the Messenger of Allah ﷺ say, 'While Musa was among a gathering of the Children of Israil, a man came to him and asked, "Do you know anyone more knowledgeable than yourself?"Musa answered, "No."So Allah revealed to Musa, "Yes, Our servant Khidr is more knowledgeable."Musa then asked for the way to meet him, and Allah made the fish a sign for him. He was told, "When you lose the fish, turn back, for you will meet him there."Musa began following the trail of the fish in the sea. Then Musa's young companion said to him, "Do you remember when we took shelter at the rock? I forgot the fish, and none but Satan made me forget to mention it."Musa said, "That is what we were seeking." So they retraced their steps and found Khidr, and what happened between them was as Allah has recounted in His Book.'"
أنه تمارى والحر بن قيس بن حصن الفزاري في صاحب موسى فمر بهما أبي بن كعب فدعاه ابن عباس، فقال: إني تماريت أنا وصاحبي هذا في صاحب موسى الذي سأل السبيل إلى لقيه، هل سمعت رسول الله ﷺ يذكر شأنه؟ قال: نعم سمعت رسول الله ﷺ يقول: بينما موسى في ملأ من بني إسرائيل إذ جاءه رجل فقال: تعلم أحدا أعلم منك؟ قال موسى: لا، فأوحى الله إلى موسي: بلي، عبدنا خضر فسأل السبيل إلى لقيه، فجعل الله له الحوت آية، وقيل له: إذا فقدت الحوت فارجع فإنك ستلقاه، فكان موسى يتبع أثر الحوت في البحر، فقال فتى موسى لموسى: أرأيت إذ أوينا إلى الصخرة فإني نسيت الحوت، وما أنسانيه إلا الشيطان أن أذكره. قال موسى: ذلك ما كنا نبغي، فارتدا على آثارهما قصصا، فوجدا خضرا، فكان من شأنهما ما قص الله في كتابه.
Bukhari narrated it in the Book of Knowledge (78), and Muslim in the Book of Virtues (2380:174), both through Zuhri, from Ubaydullah bin Abdullah bin Utba bin Masud, from Ibn Abbas, who said, then he mentioned the hadith.