Hi Kimberly,
I understand how frustrating this can be. I have been without self harm for as long as you have actually and I have the same problem.
The best thing I can think of to do is keep focused on what you are doing and let the thoughts just be thoughts. Keep reminding yourself that just because you are thinking of harming does not mean you have to. The thoughts will go away because that is all they are and they do not mean you have to act or anything.
They are difficult to get rid of but with time I think this will get easier.
If you talk to a counselor or therapist, you can ask them what to do about this and they may have more suggestions that may be useful to you.
Take care and you can
PM me if you would ever like to talk.