Language:
كتاب الطلاق
68  
Divorce
(11)
Chapter: A divorce given in a state of anger, under compulsion or under the effect of intoxicants or insanity
(11)
باب الطَّلاَقِ فِي الإِغْلاَقِ
Sahih al-Bukhari 5269

Narrated Abu Huraira:

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.:

حَدَّثَنَا مُسْلِمُ بْنُ إِبْرَاهِيمَ، حَدَّثَنَا هِشَامٌ، حَدَّثَنَا قَتَادَةُ، عَنْ زُرَارَةَ بْنِ أَوْفَى، عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ إِنَّ اللَّهَ تَجَاوَزَ عَنْ أُمَّتِي مَا حَدَّثَتْ بِهِ أَنْفُسَهَا، مَا لَمْ تَعْمَلْ أَوْ تَتَكَلَّمْ ‏"‏‏.‏ قَالَ قَتَادَةُ إِذَا طَلَّقَ فِي نَفْسِهِ فَلَيْسَ بِشَىْءٍ‏.‏
Reference : Sahih al-Bukhari 5269
In-book reference : Book 68, Hadith 19
USC-MSA web (English) reference : Vol. 7, Book 63, Hadith 194
  (deprecated numbering scheme)