'03 subaru starting and idling problems

I have a '03 Subaru Impreza Outback Sport thing with the 2.5L boxer engine, standard, with 160,000 miles.
There is an intermittent starting and idling failure that i thought started because of the colder weather rolling in(25 at night 35 during the day). When I turned the ignition to start it, there was a huff, it sounded like it would start, but it would simply shut down after about one second. If I depressed the throttle it would run at 1.5k rpm but only with my foot on the pedal. If i took it off it would die. Here’s where it gets odd. The other night I had been getting rid of some rust on the undercarriage and so i kept the car indoors overnight. In the morning it started fine, and ran fine for an hour. I parked it and went to run an errand. 20 minutes later when i got back into my car to start it, still warm, it was 49 degrees outside, i started it and it went dead again. The same happened two days later after I had driven it out of the garage, i drove it for about 20 minutes, got out for less than five minutes, and when i got back in, it did the same thing twice. My uncle says it could be a hose leak, please let me know what you think it is.

I assume the CEL light isn’t on and there are no error codes to check out. The MAF sensor might be a good place to start the check. It may have an intermittent problem. When the problem happens how does the engine go back to normal operation, just let it set?

Well when it happens I’ll usually have to nurse the throttle for a few minutes, then after that i can take my foot off of the throttle and It’ll run at a very low idle(about .5k rpm). Sometimes I’ll drive it for a few hundred yards, or until the next stop sign, and when i come to a complete stop it will stall out, (the clutch is fully depressed when it happens). Then after I start it up again it will run really well.

no lights are on the dashboard while running, but when it stalls the whole lot will show up.

I’d make sure your coolant is topped off. The thermosensor on a subaru is really high up and it will misbehave the way you describe, if it isn’t fully immersed.
A rough starting subie is very often related to the thermosensor. It often does not throw a code.

I’ll check the coolant. I looked for the MAF sensor so i could clean it, but there isn’t one anywhere near the air filter. the only sensors near the filter are the boost sensor and the throttle position sensor. Is it possible that i don’t have one?