Rico is a 3 month old Ambilobe panther chameleon and he starts doing this every night between 7:30 and 8:30 pm when he’s getting ready to go to sleep. Lights are out at 8:30 pm and he's generally close to being asleep if not already asleep. He keeps his tail curled up tightly as he sleeps through the night.
Without knowing definitively, if I had to guess I would hypothesize that chameleons do this in order to protect their tail from being mistaken as a light night snack by predators that might be crawling around in the trees. If it were kept extended and possibly dangling it might attract more attention than they’d like! It makes sense to me that they’d want to protect their tail but that’s just a theory on my part though. I have no idea why they really do it. Chances are there’s a much more scientific reason for it such as helping t regulate their body temperature while they sleep, for example.
What I do know is that when Rico does start curling his tail up it’s a sign that he’s getting ready to hunker down for the night.
Stevie mentioned that they will do it when they feel threatened in order to look bigger as part of a defense mechanism and that would make a lot of sense to me as well. I've not seen Rico do it for that reason but he's never really been threatened though.