99 Jeep Grand Cherokee. Randomly looses engine power sitting still at low speed or at high

Replaced the crank shaft sensor and so far for two days no issues… Got my fingers crossed… I found on the int that I could go through a plate in the floor inside vehicle and the bolt was right there… Made it way easier to get it off and back on… Codes weren’t coming up at all for some reason the caps doesn’t throw a code when it isn’t completely out… Def worth a shot to replace it… Not to expensive of a part a pain to replace but can be done by yourself.

I had a symptom similar to this w/a 70’s VW Rabbit that turned out to be a faulty fuel pump relay. My diagnostic technique was to connect a fuel pressure gauge and position the gauge so I could see it as I rev’d the engine. The fuel pressure would be steady for a while, then drop precipitously, then the engine would slow and loose power.