Abu Dharr reported,

Abu Dharr reported that the Prophet ﷺ said, "When the drop of fluid has been in the womb for forty nights, the angel of souls comes to it and ascends to the Lord. The angel asks, 'My Lord, is Your servant male or female?' and Allah decrees what He decrees. Then the angel asks, 'My Lord, wretched or blessed?' and what the person will encounter is written between their eyes."The narrator said, Abu Dharr then recited five verses from the opening of Surah at-Taghabun.

Azami 1006

Hasan

عن أبي ذر

أن النبي ﷺ قال: إذا دخلت- يعني النطفة في الرحم أربعين ليلة، أتى ملك النفس، فعرج إلى الرب، فقال: يا رب عبدك أذكر أم أنثى؟ فيقضي الله ما هو قاض. ثم يقول: أي رب أشقي أم سعيد؟ فيكتب بين عينيه ما هو لاق. قال: وتلا أبو ذر من فاتحة التغابن خمس آيات.

الأعظمي 1006حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Belief in the divine decree and predestination
Section
How the human is created in his mother's womb and the recording of his provision, lifespan, deeds, misery, and happiness
Numbering
Jami al-Kamil 1006 (2nd edition)
Azami 1006