And it's not a wise idea to pull the negative cable off while the engine is running.
The alternator requires battery voltage to operate properly.
And the biggie, you can spike the ECM and fry it.
Yours sounds like a poor connection, check both the negative and positive cables at both ends. All connections need to be squeaky clean and shiny, and tight.
Most of the big auto parts stores can run a full system check (alternator/starter/battery) on the jeep, and do it for free.
97 Sahara, 74 Renegade, 72 CJ5, 55 Willy's (the Beast) Boss 302, 6:34 gearing, Bose 901 speakers.
God I miss that Jeep. Forgot the kinda Jeep, 80 SX4.