Assalamualaikum w.b.t. Can you explain about kasyaf? Was it ever mentioned in al-Quran and al-Sunnah?
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions and all those who follow his footsteps until the Last Day.
Definition of kasyaf
The word kasyaf originates from the Arabic word (كشف). Ibn Manzur said, “Kasyaf is defined as you lifting something from what is covering or protecting it.” 
“Kasyaf is defined as the removal of hijab and the terminology means something placed inside the heart in the form of a blessing from the ghaibi meaning and matters of truth through wujudi and syuhudi.”
Abu Nasr al-Sarraj defined kasyaf as an explanation of what hinders the understanding of a person, the understanding is granted to the slave by Allah just like he sees it with his own eyes. 
In Kamus Dewan, kasyaf is defined as exposing the secrets of the unseen realm through the eyes of the heart; kasyaf (opening) of the heart. 
True sufi scholars reject the knowledge of kasyaf or dzauqi except if it is in line with the Book and Sunnah. This is as stated by Imam Abu Sulaiman al-Darani, “Something may cross my heart regarding a matter of a certain people for several days, thus, I accept from it (kasyaf) except with two fair witnesses, that is al-Quran and al-Sunnah.” 
This is the stringent condition of previous Sufi in living their lives and worshipping. Whatever happens in their lives must be based on al-Quran and Sunnah.
Between True and False Kasyaf
We may differentiate true and false kasyaf in two matters:
First: The situation where they claim to have kasyaf. If he is a pious man, regardless of whether it is a man or woman, from among the kasyaf Rabbani, then it can be accepted. Consequently, if he is a deviant, he may be incited by shaytan. Allah SWT states:
هَلْ أُنَبِّئُكُمْ عَلَىٰ مَن تَنَزَّلُ الشَّيَاطِينُ ﴿٢٢١﴾ تَنَزَّلُ عَلَىٰ كُلِّ أَفَّاكٍ أَثِيمٍ ﴿٢٢٢﴾ يُلْقُونَ السَّمْعَ وَأَكْثَرُهُمْ كَاذِبُونَ
“Shall I inform you upon whom the devils descend? They descend upon every sinful liar. They pass on what is heard, and most of them are liars.” 
Allah SWT said: Allah SWT dedicated this statement towards the idolaters who assumed that what came to the Prophet PBUH is untrue. However, it is from their own actions and feelings, or it may be that they went to a place and showed to them by the jinn, hence, Allah SWT cleansed this matter from Rasullullah PBUH and rejected their claims and lies and Allah SWT emphasized that it is the truth from Allah SWT. 
Second: The content of the kasyaf, whether what is claimed contradicts the Quran and Sunnah? This should be considered true information and truly understood knowledge. If this occurs, then it can be accepted.
Imam al-Ghazali acknowledged that kasyaf cannot be attained through an ordinary route, it can only be attained through the road of taqwa  and mujahadah , however, according to him, not everyone can attain it.
Ibn Khaldun said, “Kasyaf is experienced to numerous people of Mujahadah. They learned and understand the truth about life that others don’t. In previous times, the companions who perform Mujahadah such as this and a lot of them attain Karamah (honor). However, they didn’t mind this matter. There are numerous specialties or honour related to this that happened to Saidina Abu Bakar, Saidina Umar, Saidina Uthman and Saidina Ali. And they are followed by the people of Tariqat as mentioned in the book Kitab al-Risalah al-Qusyairiyyah.”
Kasyaf in al-Quran and al-Hadith
Coming back to the above question, the main story that becomes the evidence of the existence of kasyaf is the incident that happened between the Prophet Moses AS and Prophet Khidir AS. There are three matters that were questioned by the Prophet Moses AS, which are:
- Damaging a ship.
- Murdering of a teenager.
- Treasure under a wall.
Allah SWT states:
أ َمَّا السَّفِينَةُ فَكَانَتْ لِمَسَاكِينَ يَعْمَلُونَ فِي الْبَحْرِ فَأَرَدْتُ أَنْ أَعِيبَهَا وَكَانَ وَرَاءَهُمْ مَلِكٌ يَأْخُذُ كُلَّ سَفِينَةٍ غَصْبًا )79( وَأَمَّا الْغُلَامُ فَكَانَ أَبَوَاهُ مُؤْمِنَيْنِ فَخَشِينَا أَنْ يُرْهِقَهُمَا طُغْيَانًا وَكُفْرًا )80( فَأَرَدْنَا أَنْ يُبْدِلَهُمَا رَبُّهُمَا خَيْرًا مِنْهُ زَكَاةً وَأَقْرَبَ رُحْمًا )81( وَأَمَّا الْجِدَارُ فَكَانَ لِغُلَامَيْنِ يَتِيمَيْنِ فِي الْمَدِينَةِ وَكَانَ تَحْتَهُ كَنْزٌ لَهُمَا وَكَانَ أَبُوهُمَا صَالِحًا فَأَرَادَ رَبُّكَ أَنْ يَبْلُغَا أَشُدَّهُمَا وَيَسْتَخْرِجَا كَنْزَهُمَا رَحْمَةً مِنْ رَبِّكَ وَمَا فَعَلْتُهُ عَنْ أَمْرِي ذَلِكَ تَأْوِيلُ مَا لَمْ تَسْطِعْ عَلَيْهِ صَبْرًا )82
“As for the ship, it belonged to poor people working at sea. So, I intended to cause a defect in it as there was after them a king who seized every [good] ship by force. And as for the boy, his parents were believers, and we feared that he would overburden them by transgression and disbelief. So, we intended that their Lord should substitute for them one better than him in purity and nearer to mercy. And as for the wall, it belonged to two orphan boys in the city, and there was beneath it a treasure for them, and their father had been righteous. So, your Lord intended that they reach maturity and extract their treasure, as a mercy from your Lord. And I did it not of my own accord. That is the interpretation of that about which you could not have patience.” 
According to Imam al-Qusyairi: “After Moses separated from Khidir, Moses was dissatisfied and disagreed. He immediately removes this feeling after receiving the explanations. He was then told the secrets of the purpose why Khidir damages the ship to save it and maintain the ownership of the people from the evil king who likes to seize the ships of his people. Hence, the ownership of the ship remains with the people. This is the harm of anger, (thus, what is done) is good for their safety.” 
While, in a hadith, it is apparent in the life of Rasullullah PBUH himself. The kasyaf he was granted is in the form of miracles.
Narrated by Anas bin Malik RA, he said, “Iqamat was called. God’s Messenger faced us and said,
أَقِيمُوا صُفُوفَكُمْ، وَتَرَاصُّوا، فَإِنِّي أَرَاكُمْ مِنْ وَرَاءِ ظَهْرِي
“Make your rows straight and stand close together, for l can see you behind my back.” 
From Anas bin Malik RA, he said, “Rasullullah PBUH said:
أَخَذَ الرَّايَةَ زَيْدٌ فَأُصِيبَ، ثُمَّ أَخَذَهَا جَعْفَرٌ فَأُصِيبَ، ثُمَّ أَخَذَهَا عَبْدُ اللَّهِ بْنُ رَوَاحَةَ فَأُصِيبَ – وَإِنَّ عَيْنَيْ رَسُولِ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ لَتَذْرِفَانِ – ثُمَّ أَخَذَهَا خَالِدُ بْنُ الوَلِيدِ مِنْ غَيْرِ إِمْرَةٍ فَفُتِحَ لَهُ
“Zaid took over the flag and was martyred. Then it was taken by Jafar who was martyred as well. Then `Abdullah bin Rawaha took the flag but he too was martyred and at that time the eyes of Allah’s Messenger (ﷺ) were full of tears. Then Khalid bin Al-Walid took the flag without being nominated as a chief (beforehand) and was blessed with victory.” 
The death of this companion is informed by Rasullullah PBUH even before their death. This proves that Rasullullah PBUH has kasyaf as emphasized by Syeikh Abdul Qadir ‘Isa al-Syazili. 
Kasyaf is one of the blessings granted by Allah SWT for His chosen slaves. Any kasyaf that contradicts al-Qur’an and al-Sunnah regardless of whether it is to those who claim to have it or are informed of it should be rejected for it might lead to confusion.
We end this discussion with the supplication:
اللَّهُمَّ أَرِنَا الْحَقَّ حَقَّا وَارْزُقْنَا اتِّبَاعَهُ وَأَرِنَا الْبَاطِلَ بَاطِلًا وَارْزُقْنَا اجْتِنَابَهُ
“O Allah! show us the truth as true, and inspire us to follow it. Show us falsehood as falsehood, and inspire us to abstain from it.”
 See Lisan al-‘Arab, 9/300
 See al-Ta’rifat, pg. 237
 See al-Luma’, pg. 422
 See Tabaqat al-Sufiyyah, 1/76
 Surah al-Syu’ara’ (221-223)
 See Tafsir al-Quran al-‘Azim, 6/172
 Saidina Ali R.A said:
التقوى هي الخوف من الجليل، والعمل بالتنزيل، والقناعة بالقليل، والاستعداد ليوم الرحيل
Maksudnya: Taqwa is the fear and awe towards the Almighty Allah SWT obeying what is written in al-Quran and adopt the attitude of qanaah with what little do one has and prepare for the hereafter. (See Subul al-Huda wa al-Rasyad by al-Solihi al-Syami, 1/421)
 Mujahadah is striving and putting one’s best efforts for good and 6seeking the blessings of Allah SWT. (See Lisan al-‘Arab, 1/710)
According to Imam al-Ghazali, Mujahadah al-nafs is the first process of tazkiyah al-nafs (purifying one’s soul). It is also said as al-takhalli that means emptying one’s soul from anything other than Allah SWT and all mazmumah attributes from the illness of the heart such as backbiting, jealousy, vengeance, bad thoughts and others.
According to Harith al-Muhasibi, riyadah and mujahadah is fighting to overcome all one’s bad habits and directing it to reject the whispers of desires and shaytan that are always present. Both these elements always tempt people to love this world and distract us from remembering Allah SWT. (See al-Ri’ayah li Huquq Allah, 331-332)
 See Muqaddimah Ibn Khaldun, pg. 329
 Surah al-Kahfi: 79-82
 See Lata’if al-Isyarat, 2/412
 Narrated by al-Bukhari (719)
 Narrated by al-Bukhari (1246)
 See Haqa’iq ‘an al-Tasawwuf, pg. 340-342