I tend to struggle a lot with those same thoughts, so I know how scary it can be. It's terrifying to realize that you have no reason to want to hurt yourself at that moment and yet you're doing it anyway, and at some point you feel like you've lost all control over the thoughts in your head. It definitely sucks.
Some things that I think might help you (they've helped me):
1) Counting the days since you last self harmed: If you keep track of them, then when you get to, say, 13 days, and you really feel like cutting...you can remind yourself that you're soooo close to 2 weeks (14 days) and you don't want to break that streak yet! When/if you do self harm again, go for a new record number of days. This helps me a lot.
2) Distract yourself: Just try to keep your brain occupied with other things as much as possible. Sometimes I find that if I'm hanging out with people or watching an exciting movie or something, I'll go hours without thinking about self harm even once. Just try to avoid idle time, and especially time when you're alone.
3) "Cut" yourself with red marker/pen. Just make sure it's washable.

(DON'T use Sharpie unless you want to have lines on your skin [and awkward questions/stares] for a week!) I tried this once when I was feeling REALLY triggered and it actually worked. It calmed me down and served my purpose, without leaving any marks or scars.
4) Snap a rubber band on your wrist. You've probably heard this one before. Just be careful not to snap it too hard or too often - it can become addicting in itself (I started getting addicted to it and had to make myself stop).
Those suggestions seem to help me in particular when I'm not feeling very triggered, and I just sort of generally "want to do it." (I'm guessing it's addiction based.

) I hope at least one of the suggestions is helpful to you. You might also consider seeing a therapist, if you aren't already, as they can help you figure out ways to overcome self harm completely. Good luck.