My Jasper used to do that too when he was on a kibble diet and now gets episodes every once in a while. The only thing that prevents his issues is NO kibble. He is now on a quality raw/canned diet and I rarely have the diarrhea/running out of the litter box, poop all over the floor and up the stairs. When he does get his rare episodes, I do give him some slippery elm bark in his food and it seem to help sooth the bowel.
A cat's digestive tract is NOT made to digest carbs as their small intestines are very short and carbs can be very irritating to the bowel. IMHO, most cat food manufacturers do not do what is best for you kitty, but what is best for their bottom line profits
Personally, before I started pumping meds that can possibly cause organ damage into my cat, I would do a complete food change to something much healthier than what I was currently feeding.