HI. My name is***** Thank you for your question. Do you still have some of the material present that you can take a picture of and post it? Is he otherwise still eating and drinking normally? No vomiting? Are his stools looking normal?
That is ok! It is good that he is otherwise eating and drinking normally. With his stools being normal too, the big suspicion here for what you saw was anal gland secretion. Cats have two glands by their rectal region that express material with the passage of stools. Pretty much it is never seen or an issue in a majority of cats. Sometimes though, they can have the material be a little thicker and when it is expressed it can cling by the rectal region and look like a small worm. Could it have been a small worm? Cats can have tapeworms too and this can look like little brown rice like things. What I think is a good idea here is to observe him for any more occurrence of this material and if seen again, take a picture or try to get the "thing" and put it in a bag to take to your vet. If it is anal gland secretions, then most likely nothing needs to be done. If it is tapeworms, then he would benefit from a deworming for them. Humans can't get tapeworms from their pets. The most common one in cats is from the eating of the intermediate host which is a flea.