Why would I have anal mucus when I get diarrhea?

Cell turnover. Normal cell turnover of the colon lining though it can increase in inflammatory conditions.