from my experience your therapist is right shaking your head is just as much of a compulsion as checking touching doors etc   one thing i’ve heard is instead of saying yes or no to the thought try maybe if you recognize that you are not your intrusive thoughts no matter how awful they are then telling ocd “maybe” is a sign of inaction that eventually signals your brain that you don’t need to be afraid of that thought not sure if i made sense but i hope that helps shaking my head is also a compulsion of mine