The easiest way to deal with them is in close combat, but compies are so small and quick that even melee attacks sometimes miss them.
Tall grass is the perfect hiding spot for Compies, they are almost invisible in it. If you don't know what is gnawing on you they are often the reason.
Compies do not attack the Power Generator.
The Compy bite