I have anxiety and diagnosed with high functioning autism, so automatic thoughts and repetitive actions (including thoughts) is an aggravating part of my life.
I think about chumros and psaks that others get sometimes. I know I don’t plan to accept them deep down but I get superficial thoughts about them sometimes. And then I get scared that I actually am considered accepting them. I make sure not to verbalize them at all but I read something about thinking about giving tzedakah obligates one to give tzedaka and I am scared about all my automatic thoughts if they count for other kinds of thoughts. I know I most likely will have an anxiety break down if I am forced to be obligated to my automatic thoughts. My anxiety has gotten bad to the point I was nearly fired from my job. I used to scream and make some other noises at my thoughts to make them go away even in public sometimes. Now I try to shun the thoughts as soon as I can internally but sometimes I don’t think it is quick enough and too scared to be forced to accept them.
So how much do thoughts matter in halacha?
When someone thinks that he will give something to tzedakah it is only considered a neder if he indeed decided to actually give the item of money. Therefore if you only had a fleeting thought about it, it is still not considered a neder to tzedakah, and you don’t have to worry about it.
With other mitzvos it is not a neder unless you say it out of your mouth.
It would be very helpful to make a declaration that in any instance of giving tzedokoh, that you absolutely do not want it to be a neder to give tzedakah in any circumstance. This way you can feel calm that even I you do have such thoughts, they will not be binding on you. This is also true as a general rule that one should say that if they do something or mistakenly say something that would have a connotation of a neder, that it should not be a neder. This way you won’t have to be nervous that you made any nedarim
S:A CH:M 112-8, Rama Y:D 258-13, (see Pischei Teshuva ibid 15, and Gilyon Maharsha, that this applies only if he spoke out that he wants to give ,but had the amount in his mind, other however disagree) MG”A 562-11, Tzedakah U’mishpat chap. 4 ftnt 12.