Prepona sp. (Nymphalidae)
Upon a simulated attack (i.e., light pinch with blunt forceps) it rears up the front part of its body and sometimes curls up its forked "tail" segments in an attempt to touch the attacker. I'm not sure if those "tail" segments are poisonous or really that sharp, but it is intimidating when they rear up, especially because the larger ones I saw today were over 5cm long.
Here is a smaller specimen that I photographed a few days earlier in the Santa Rosa sector of the ACG:
At the time I didn't realize how snake-like these caterpillars would get, and becasue of their size I thought it was primarily a dead leaf mimic. Smaller specimens are often found hanging on the end of the central vein of the leaf that they have been feeding on. Also, it trims small pieces of the leaf and attaches them along the vein of the leaf too - perhaps to enhance its camouflage? Here is another individual from Cacao that was of intermediate size and really trying to pull off the dead leaf effect: