99 jeep gr cherokee idling probs

When cranking, i have to give it gas and rev it til it smooths out. Eventually it will run smoothly. When i throw it in gear, it wants to sputter and die out. If I put in D, i have to give it gas or it dies, but I can only barely touch the gas or it dies out. There is a vacuum leak in brake booster, but ive been told the headgasket could be blown.I want to know if the head gasket could be a problem and if its worth replacing the booster.

First I would replace the booster to correct the vacuum leak. If that does not correct the problem, I would look at a dirty IAC. Vacuum leak will cause a bunch of problems and I would start there.

yes. vacuum leaks , IAC valve, and the vacuum line or valve to the valve cover or the PCV system, whichever your jeep has.

I had Identical issues with my jeep and cleaning the IAC valve and throttle body as well as fixing vacuum problems took care of the problem completely, at zero cost!