If you wish to study this, you may find it useful to build a tail-wiggling robot from a 12V motor and the amputated tail of a death adder.
Some snakes that do this also have brightly coloured tail tips. Wilfred Neil described a group of young copperheads:
In the shadowy interior of the container I could at first make out only a number of writhing, yellowish objects, for all the world like small worms or maggots. Closer inspection revealed that each little copperhead was coiled up and was holding aloft its bright yellow tail, which was writhing slowly.