Some Shaykhī interpretations of these portions of the Surah of the Cave.
Some Bābī-Bahā’ī interpretations of the Surah of the Cave
The Bābī-Bahā’ī Interpretation of the motifs, verses, pericopae and narratives contained within the Sūra of the Cave form a significant part of Bahā’ī sacred scripture. Episodes, themes and motifs contained in the important, rich and fascinating qur'anic Surat al‑kahf (Sura of the Cave; Q. 18; especially Q. 18:60‑102) were of central importance to the founders of the Bābi and Baha'i religions; the two contemporary messianic figures of the Iranian Qajar period, Sayyid `Ali Muhammad Shirazi known as the Bāb ("Gate" 1817‑50) and Mirza Husayn `Ali Nuri (1819‑92) entitled, Baha'‑Allah (The Glory of God). Within the extensive and largely unpublished Arabic and Persian writings of these two successive, revolutionary claimants there exist quite a number of exegetical‑eisegetical treatments of Q. 18:60ff. While the Bāb, for example, eisegetically rewrote or re‑revealed the story of Dhū'l‑Qarnayn ("The Possessor of the Two Horns") in his first major work, the Qayyūm al‑asmā’ (mid. 1844), Bahā'u'llāh wrote a detailed commentary on Q. 18:XXff. Various key figures, motifs and terms mentioned in the Surat al‑kahf receive novel interpretations by these Persian born persons who claimed to be the latter day manifestations of the Qā’im (Shī`ī messiah) and the Qayyūm (eschatological theophany).
Attention is given by the Bāb and Baha'-Allah, for example, to the multi‑faceted and influential account of the associated, highly suggestive phrase majma` al‑bahrayn (`confluence of the two seas'), the theme of the aṣḥāb al‑kahf (Companions of the Cave) and of Dhū'l‑Qarnayn (`The Possessor of Two Horns') in which Yajuj and Majuj (Gog and Magog) also figure. Such material was drawn upon and interpreted in diverse non‑literal (allegorical, typological... ) ways.
Both the Bāb and Baha'-Allah occasionally framed their claims based upon phrases or figures mentioned in the Surat al‑kahf. The latter, for example, in his Lawh‑i qinā' (Tablet of the Veil) called the Shaykhi leader Karim Khān Kirmānī (d.1871) to listen to him as the "Khidr of [these]days" capable of leading him to the "Kawthar [Fount] of Eternal Subsistence". Addressing a certain "letter qāf between two alifs (=Āqā [Mīrzā Āqā] Rikab Saz Shirazi ?) in another untitled Tablet he bade him "hearken" unto his message as the messianic personification of the majma al‑baḥrayn ("Confluence of the Two Seas") (see Māzandarānī, Āsrār al‑āthār, 4:230)
The Sūrat al-Kahf (Surah of the Cave) LXXIII (73) in the Qayyūm al-asmā' of the Bab.
Spanning 5-7 pages of Arabic text Qayyūm al‑asmā' surah LXXIII (73) is entitled the Sūrat al-Kahf (The Surah of the Cave). In neo-qur'anic fashion it commences with the basmalah then cites Qur'an 12:72 ("They said: "We have lost the great beaker [cup] of the king (ṣuwa`a al-malik) ; Anyone who produces it, will be given [the reward of] a camel-load [of grain]; I personally guarantee this") after which it has as verse 3 (of the QA) the isolated letters A-L-M (= also Q. 2 etc). It thus begins:
بسم اللّه الرحمن الرحيم
قَالُواْ نَفْقِدُ صُوَاعَ الْمَلِكِ وَلِمَن جَاء بِهِ حِمْلُ بَعِيرٍ وَأَنَاْ بِهِ زَعِيمٌ
ذكر اللّه فی الشّجرة المباركة فاستمع ندإ اللّه انّی انا اللّه الّذی لا اله الا انا وانا لعلیّ قد كنت علی الحقّ بالحقّ كبيراً
 The Dhikr-Allah (Remembrance of God) is in the Blessed Tree (shajarat al-mubārakah)! So hearken unto the Call of God (nida'-Allah), 'I, verily, am God, no God is there except I Myself". And I, I am indeed `Ali [One Transcendent] for I was, in very truth, One Mighty (kabīr an).
After this bold opening verse the Bāb refers to the Aṣḥāb al-kahf ("The Companions of the Cave") and al-Raqīm and seems, rewriting Q. 18: 9, to pose a rhetorical question about the people's failure to identify these figures with the person of the Bab -- it is somewhat unclear whether the adjectival "sleeping" (ruqūd an) refers to the people or those in the "cave" -- the translations is uncertain...
انحسب / افحسب/ ام حسب النّاس ان اصحاب الكهف والرقيم قد كانوا من دون الباب رقودا *
تا للّه انّ آياتنا فی ذلك الباب علی المؤمنين لكانت بالحقّ علی الحقّ البديع عجيباً
 The people have supposed that the Aṣḥāb al-kahf ("The Companions of the Cave") and al-Raqīm were "asleep" (ruqūd an) respecting the Bāb?  [Nay!] By God! Our wondrous (al-badi`) "verses" (or "signs") in this Bāb were, in very truth, something amazing (`ajib an) for the believers.
و انّ الكهف هذ الباب و فی امّ الكتاب قد كان حول النّار مسطورا
The "Cave" (al-kahf) is this Bab, something inscribed about the [Sinaitic] "Fire" (al-nar) in the Archetypal Book (umm al-kitab).
The Bāb's version of the story of Dhū'l‑Qarnayn in Qayyūm al-asmā' LXXV (75)
In one of the suras (LXXVI) of his "Tafsir surat yusuf" (= "Qayyūm al‑asma' ; mid. 1844 CE) the Bāb exegetically `rewrote' in waḥy (`revelation mode') Qur'an 18:83ff., the story of Dhū'l‑Qarnayn ("The One possessed of Two Horns"), traditionally [among others] Alexander the Great (356‑323 BCE). What follows is a sample of the Bāb's exegetical `rewrite' with some comments;
"O Solace of the Eye[s]!
The people shall ask thee about Dhū'l‑Qarnayn. Say [in reply]: `Yea! By my Lord! I am the King of the two Originations (malik al‑bad'ayn) in the two horns (al‑qarnayn). I am the elevated Dhū'l Qarnayn in the two bodies (al‑jismayn). I am the [Sinaitic] Fire in the two [cosmic] Waters (al‑mā'ayn). I am the [cosmic] Water (al‑mā') in the two [Sinaitic] Fires (al‑nārayn). So hearken unto my call from these two [Sinaitic] Mounts (al‑ṭūrayn).' We verily, established him [= Dhū'l‑Qarnaun = the Bāb] in the land and We, in very truth, bestowed a letter [of the alphabet] from the name of the Dhikr upon this Arabian Youth (al‑ghulam al‑`arabi = the Bāb) such that the ways and means to all ends became his. Say: I verily, when I followed the Path, journeyed until I reached the [place of the] setting of the Sun. I found it setting in the Fount of Salsal [= a paradisiacal well of limpid water]. At that place I gazed upon the denizens of the mystic Cloud (ahl min al‑`ama') [who were gathered] about the Fount. I saw them prostrating before God, the Exalted. They spoke to me about the secret knowledge (al‑`ilm al‑mustasirr), [concerning] a letter [of the alphabet] inscribed above the line (al‑satr) and I spoke to them of a cipher (ramz an) veiled in mystery (sirr al muhajjab). Then I followed the command (al‑amr) until I reached the dawning‑place of the Sun (mala` al‑shams). I found it [the Sun] rising from the Camphor‑Fount (`ayn al‑kafur) upon a company of the people of the mystic Cloud (al‑`amā'). We found that they had no covering [protection from the Sun] save the verse (or sign) of the Divine Unity (ayat al‑tawhid = the "shahada), "an affair mysteriously concealed. They said: `God, verily, is, in very truth, your Master, nothing is like unto Him'. I said to them: `He, God, is the True One, no god is there save Him, One Exalted and Mighty.' "
In this passage the Bāb identifies himself with Dhū'l‑Qarnayn. The dual form of qarn (= `horn') leads him to give vent to a variety of claims connected with his role as Bāb to the occulted or hidden [twelfth] Imam. God bestowed on him a letter (celestial potency ?) of the name of the "Dhikr</I> ("Remembrance" a quasi‑ messianic title in Bābism) such that he was able to undertake heavenly journeys or travel on the path of celestial initiation. At the setting‑place of the celestial Sun where the Fount of limpid water is located he saw the "ahl al‑`ama' </I>and had a conversation with them. Deep qabbalistic mysteries were discussed. Then, at the dawning‑place of the celestial Sun where the Camphor Fount is located he also met a company of the "ahl al‑ `amā'" who had no protection from the Sun of Reality save the `shield' of an expression of the Divine Unity ("al‑tawhid</I> = " la ilaha ila llah" (`There is no god but God'). While they proclaimed God's uniqueness the Bāb testified to His unity.
The ahl al‑`ama', it may be gathered, exist at the extreme orient and extreme occident of the spiritual world; those points where the Sun of Reality rises and sets. They are privy to the secret of the Hidden Imam and converse with the Bāb about deep mysteries. It appears that the journeys of Dhū'l‑Qarnayn ‑‑ transcendentalised by the Bāb ‑‑ are understood to be expressive of the recognition and heavenly initiation of the Bāb by the "ahl al‑ `ama'.</I> In this context it is likely that the "ahl al‑ama' </I> correspond with the inhabitants of twin cities of Jarbalqa (in the spiritual orient) and Jabarsa (in the spiritual occident) mentioned in various Shi`i traditions and in the writings, for example, of such exponents of "gnostic" (irfani) mysticism as Mir Muhammad Baqir, Damad Astarabadi (d. 1041/1631) and Baha al‑Din al‑`Amili (= Shaykh Baha'i, d. 1030/1621).They are the company of purified souls that inhabit the interworld of archetypal realities. Towards the end of the same surah of the Qayyūm al‑asmā' in which the story of Dhū'l‑Qarnayn is re-expressed and reinterpreted, the Bāb addresses the "ahl al‑`ama'" after stating that he was sent by God from the expected Imam:
"The polytheist's (mushrikin) shall ask you, `Who sent you unto us?'.. Say: `God the Cleaver of the heavens and the earth! from the Proof (min `ind hujjat), the expected [messianic] Qā'im. He, verily, is the True One and I am one of his servants.. And say unto the "ahl al‑`ama'" `God created you from clay; He will return you unto it and from it He will bring you forth yet again before this sublime Gate (al‑Bāb= the Bāb).'"
Here the Bāb underlines the essential createdness of the "ahl al‑`ama'". Fashioned by God they will be suject to the eschatological `recreation' and appear before the Bāb, the representative of the Hidden or expected Imam.