While rebel above has good advice and cleaning of gas tube is done every time ya squeeze off a round w/ tens of thousands of psi gas pressure, blowing the tube clean, here's why I clean mine every time I clean my rifle and how.
I use Sweets 7.62 as a bore cleaner. It's an ammonia based highly caustic type cleaner, which [b]IF[/b] it is not cleaned from the rifle bore properly can ruin your bore. As I clean the rifle generally while still warm (not hot as this would melt the "NYLON" only bore brushes we use, as mentor expressed, "the object is removal of copper guilding from the bore, not the introduction of brass to it") from shooting and use SuperTech 2000 carb-cleaner from WalMart (because it has none of the bad/noxious stuff in it) as a rinse for ridding the bore of the Sweets, I also use it to blow any Sweets which may have accumilated in the gas tube while aggressively brushing the bore.
Simply stick the little red-tube, which comes w/ the carb-cleaner into the end of the gas-tube and give it a couple squirts, this flushes any of the Sweets ?(or any accumilations for that matter, BTW, careful of your eyes as IT will squirt back at ya, and that shit burns), which may have gotten in there while cleaning and keeps your gas tube squeaky clean.
This is not necessary, just something I was taught to do, based on the cleaning method and products used to clean our rifles, semi-auto or bolt rifles, which never varies. Sweets, ST2000 and CLP for lubing upon completion of our range sessions.
Hope this is some help, but understand, it's NOT necessary for the majority of AR15 shooters.
Mike