Boats, I get those same thoughts...like intrusive images, but thoughts instead. They can come in a torrent and totally shock me because I'm not thinking them and don't believe them. Things like "you deserve to die" or "I should die" or urges to grab a knife and do something to myself with it. I don't want to die, I'm not suicidal, I definitely don't want to cut myself because I grew up with my mother cutting gruesomely. And yet there they are.
They've actually almost completely gone away now. I've never taken medication so I don't have advice on that. But what I noticed was they were a mental distraction. If I started to get upset about something my mom was doing that was very difficult for me and threatened to make me angry, all the sudden instead I'd be feeling this way about myself like a magic unintentional substitute. Oddly my brain decided that urges to SH were safer than being angry at my mom. Because deep down I do trust myself to not do that.
I did own up to my therapist about this and he kindly shrugged it off and just said "they're just intrusive thoughts. Ignore them." He did that knowing me well enough to know there was no danger to me. The thoughts would also be exceptionally persistent and aggressive if I was told or tried to tell myself to be kind to myself or to love myself. That too was a threat.
Since my mom died, I haven't had those urges or thoughts. I know you don't want to revisit and process what happened, likely for very very good reason. But having the trauma resolved (by my mom passing away) is what ended those thoughts and urges for me at least. But before that, just ignoring them or telling them "no, I don't deserve to die" or even a sarcastic "nnnoooo" helped them be more of a murmur than a shout.
Good luck. It's distressing to have thoughts that you don't ask for want or believe. And I'm sorry for what happened to you to cause those thoughts to be there in the first place. It's not fair.