This is the larval stage of the coffee leopard moth, which lays its eggs in cracks in the bark of a tree. Once they hatch, they can spin threads of silk to launch themselves into the air to be dispersed by the wind. When the larvae land on a tree, they bore into it to pupate (Waller et al., 2007). Because of their large size and the realtively small size of this coffee tree, the worm damaged or destroyed large parts of the xylem and possibly even the phloem. From the point of entry into the main stem to the top, this tree exhibited die-back.
The farmer cut it below the die-back and just discarded the top. He was taking me on a tour of the farm and told me about some trees that had mysterious damage, ‘as if struck by lightning.’ When I looked at the removed tree tops I could see a clean hold right in the center of the main stem, so we cut the stem open to find this guy going about his business beefing himself up before pausing to pupate and take adult form.
Natural enemies include parasitoid wasps in the Braconidae family (Waller et al., 2007).