1. The Book of Faith

١۔ كتاب الإيمان

1.60 Allah allows a person's thoughts and whatever occurs in his heart so long as they do not become established

١۔٦٠ باب تَجَاوُزِ اللَّهِ عَنْ حَدِيثِ النَّفْسِ، وَالْخَوَاطِرِ، بِالْقَلْبِ إِذَا لَمْ تَسْتَقِرَّ

(79) bukhari:5269Muslim b. Ibrāhīm > Hishām > Qatādah > Zurārah b. Awfá > Abū Hurayrah

The Prophet ﷺ said, "Allah has forgiven my followers the evil thoughts that occur to their minds, as long as such thoughts are not put into action or uttered."  

And Qatada said, "If someone divorces his wife just in his mind, such an unuttered divorce has no effect.:
(٧٩) البخاري:٥٢٦٩حَدَّثَنَا مُسْلِمُ بْنُ إِبْرَاهِيمَ حَدَّثَنَا هِشَامٌ حَدَّثَنَا قَتَادَةُ عَنْ زُرَارَةَ بْنِ أَوْفَى عَنْ أَبِي هُرَيْرَةَ ؓ

عَنِ النَّبِيِّ ﷺ قَالَ إِنَّ اللَّهَ تَجَاوَزَ عَنْ أُمَّتِي مَا حَدَّثَتْ بِهِ أَنْفُسَهَا مَا لَمْ تَعْمَلْ أَوْ تَتَكَلَّمْ  

قَالَ قَتَادَةُ إِذَا طَلَّقَ فِي نَفْسِهِ فَلَيْسَ بِشَىْءٍ