كتاب الإيمان
1  
Faith
(4b)
Chapter: Belief in the Divine Decree - Section 2
(4b)
باب الإيمان بالقدر - الفصل الثاني
Mishkat al-Masabih 94
‘Ubada b. as-Samit reported God’s messenger as saying, “The first thing God created was the pen. He told it to write and when it asked Him what it should write He told it to write what was decreed, so it wrote what had taken place and what would take place to all eternity.” Tirmidhi transmitted it, saying that this is a tradition whose isnad is gharib.
وَعَن عبَادَة بن الصَّامِت قَالَ: سَمِعْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسلم يَقُول «إِنَّ أَوَّلَ مَا خَلَقَ اللَّهُ الْقَلَمُ فَقَالَ اكْتُبْ فَقَالَ مَا أَكْتُبُ قَالَ اكْتُبِ الْقَدَرَ مَا كَانَ وَمَا هُوَ كَائِنٌ إِلَى الْأَبَدِ» . رَوَاهُ التِّرْمِذِيُّ وَقَالَ هَذَا حَدِيثٌ غَرِيبٌ إِسْنَادًا
Grade: Sahīh (Zubair `Aliza'i)  ضَعِيف   (الألباني) حكم   :
  صحیح   (زبیر علی زئی)
Reference : Mishkat al-Masabih 94
In-book reference : Book 1, Hadith 88