This stuff happens all the time, it is obsessive thinking... I am having a real hard time with it myself.... I feel like I am going crazy, my pychologist tells me try to use a sense of humor with the thought, if you frighten yourself with say a thought of going crazy and stabbing your family, try to change the thought into something humorous, it is hard but the fact that you can change the thought is comforting, change the scary thought to squirting them with green jello or something stupid. I was told that these compulsive thoughts are thoughts that we try to distract ourselfs from the real problems with. I don't know exactly. I know tomorrow I go to my my psychiatrist and Am going to start Paxil. I can't stand these thoughts , they are very scarry but I am told they are just thoughts, they are nothing you would really do, and if you notice if you are distracted doing something they go away.. I also compulsively play the same song in my head sometimes, how annoying this becomes, hopefully the medicine will help me.
GOod luck