We can't diagnose here but you might want to try to increase your fiber and water intake. Small sized stools can be indicative of a long transit time in the colon - which results in more water being removed - resulting in hard pellet sized stools. Because its hard to get those stools out of your system it can stress the muscles in that area. The fact that your muscles are actually spasming suggests you should see a doctor about this problem. Good luck!
We hope you find this general health information helpful. Please note however, that this Q&A is meant to support not replace the professional medical advice you receive from your doctor. No information in the Answers above is intended to diagnose or treat any condition. The views expressed in the Answers above belong to the individuals who posted them and do not necessarily reflect the views of Remedy Health Media. Remedy Health Media does not review or edit content posted by our community members, but reserves the right to remove any material it deems inappropriate.