Al-Imām al-Bukhārī narrates that Muḥammad ibn Gharīb al-Zuhrī related to us; he said: Ya’qūb ibn Ibrāhīm narrated to us; he said: My father narrated to me, from Ṣāliḥ, from Ibn Shihāb, who narrated that ‘Ubaydullāh ibn ‘Abdullāh informed him from Ibn ‘Abbās (may Allāh Almighty be content with both of them) that:
He once had a discussion with Ḥurr ibn Qays ibn Ḥiṣn al-Fazārī concerning the companion of Mūsā. Ibn ‘Abbās said: “The companion of Mūsā was al-Khiḍr.” At that time Ubayy ibn Ka’b (may Allāh Almighty be content with him) passed by. Ibn ‘Abbās called him and said: “There has been a discussion between me and this companion of mine regarding Mūsā (peace be upon him), the one who asked about the way to meet him. Have you heard the Prophet ﷺ mention anything about him?” Ubayy said: “Yes. I heard the Messenger of Allāh ﷺ say: When Mūsā was among a gathering of the Children of Isrā’īl, a man came to him and asked: ‘Do you know of anyone more knowledgeable than you?’ Mūsā said: ‘No.’ So Allāh revealed to Mūsā: ‘Yes—Our servant al-Khiḍr is more knowledgeable than you.’ Mūsā then asked about the way to reach him, so Allāh made a fish a sign for him, and it was said to him: ‘Wherever you lose the fish, that is the place to turn back, and there you will meet him.’ They set out, following the trace of the fish by the sea. Then Mūsā’s attendant (Yūsha’ ibn Nūn) said to him: ‘Did you see? When we took rest by the rock, I forgot the fish—and none made me forget to mention it except Shayṭān.’ Mūsā said: ‘That is exactly what we were seeking.’ So they returned, retracing their footsteps.” (al-Kahf: 61–64) Then they found al-Khiḍr, and thereafter occurred the story of their dialogue, which Allāh, Mighty and Majestic, has mentioned in His Book.
حَدَّثَنِي مُحَمَّدُ بْنُ غُرَيْرٍ الزُّهْرِيُّ قَالَ: حَدَّثَنَا يَعْقُوبُ بْنُ إِبْرَاهِيمَ قَالَ: حَدَّثَنِي أَبِي، عَنْ صَالِحٍ، عَنِ ابْنِ شِهَابٍ حَدَّثَ أَنَّ عُبَيْدَ اللهِ بْنَ عَبْدِ اللهِ أَخْبَرَهُ عَنِ ابْنِ عَبَّاسٍ
أَنَّهُ تَمَارَى هُوَ وَالْحُرُّ بْنُ قَيْسِ بْنِ حِصْنٍ الْفَزَارِيُّ فِي صَاحِبِ مُوسَى، قَالَ ابْنُ عَبَّاسٍ: هُوَ خَضِرٌ. فَمَرَّ بِهِمَا أُبَيُّ بْنُ كَعْبٍ، فَدَعَاهُ ابْنُ عَبَّاسٍ فَقَالَ: إِنِّي تَمَارَيْتُ أَنَا وَصَاحِبِي هَذَا فِي صَاحِبِ مُوسَى الَّذِي سَأَلَ مُوسَى السَّبِيلَ إِلَى لُقِيِّهِ، هَلْ سَمِعْتَ النَّبِيَّ ﷺ يَذْكُرُ شَأْنَهُ؟ قَالَ: نَعَمْ، سَمِعْتُ رَسُولَ اللهِ ﷺ يَقُولُ: بَيْنَمَا مُوسَى فِي مَلَإٍ مِنْ بَنِي إِسْرَائِيلَ، جَاءَهُ رَجُلٌ فَقَالَ: هَلْ تَعْلَمُ أَحَدًا أَعْلَمَ مِنْكَ؟ قَالَ مُوسَى: لَا. فَأَوْحَى اللهُ إِلَى مُوسَى: بَلَى، عَبْدُنَا خَضِرٌ. فَسَأَلَ مُوسَى السَّبِيلَ إِلَيْهِ، فَجَعَلَ اللهُ لَهُ الْحُوتَ آيَةً، وَقِيلَ لَهُ: إِذَا فَقَدْتَ الْحُوتَ فَارْجِعْ، فَإِنَّكَ سَتَلْقَاهُ، وَكَانَ يَتَّبِعُ أَثَرَ الْحُوتِ فِي الْبَحْرِ، فَقَالَ لِمُوسَى فَتَاهُ: ﴿ اَرَءَیْتَ اِذْ اَوَیْنَاۤ اِلَى الصَّخْرَةِ فَاِنِّیْ نَسِیْتُ الْحُوْتَ٘-وَ مَاۤ اَنْسٰىنِیْهُ اِلَّا الشَّیْطٰنُ اَنْ اَذْكُرَهٗۚ﴾ ﴿ذٰلِكَ مَا كُنَّا نَبْغِ ﳓ فَارْتَدَّا عَلٰۤى اٰثَارِهِمَا قَصَصًا﴾ فَوَجَدَا خَضِرًا، فَكَانَ مِنْ شَأْنِهِمَا الَّذِي قَصَّ اللهُ ﷿ فِي كِتَابِهِ.
Reference: Sahih Al Bukhari 74