Hadithcore
Hadith #2312820
da’if· Al-Albani

Shahr ibn Hawshab said, "Me and my maternal aunt visited 'A'isha and said, 'Sometimes something occurs to one of us such that, if he had spoken about it, that would have been the end of his hopes for the Next World. If it were to be revealed, he would be killed for it.' She said the takbir three times and then said, 'The Messenger of Allah, (ﷺ), was asked about that and said, "If that happens to one of you, he should say the takbir three times. Only a believer feels that.'"

وَعَنْ جَرِيرٍ، عَنْ لَيْثٍ، عَنْ شَهْرِ بْنِ حَوْشَبٍ قَالَ‏:‏ دَخَلْتُ أَنَا وَخَالِي عَلَى عَائِشَةَ، فَقَالَ‏:‏ إِنَّ أَحَدَنَا يَعْرُضُ فِي صَدْرِهِ مَا لَوْ تَكَلَّمَ بِهِ ذَهَبَتْ آخِرَتُهُ، وَلَوْ ظَهَرَ لَقُتِلَ بِهِ، قَالَ‏:‏ فَكَبَّرَتْ ثَلاَثًا، ثُمَّ قَالَتْ‏:‏ سُئِلَ رَسُولُ اللهِ صلى الله عليه وسلم عَنْ ذَلِكَ، فَقَالَ‏:‏ إِذَا كَانَ ذَلِكَ مِنْ أَحَدِكُمْ فَلْيُكَبِّرْ ثَلاَثًا، فَإِنَّهُ لَنْ يُحِسَّ ذَلِكَ إِلا مُؤْمِنٌ‏.‏

References2 variants
Sunnah.com reference
Book 55, Hadith 4
Arabic/English book reference
Book 55, Hadith 1285