Epidural electrical stimulation of the spinal cord elicits motor responses by recruiting large sensory afferents in the posterior roots. Divergence of excitatory inputs provided by these fibers generates a variety of shapes, latencies and amplitudes in the electrical responses recorded from skeletal muscles. Interpretation of these signals is pivotal to the tuning and optimization of stimulation parameters. Here we present an automatic approach to identify and sort different arm muscle responses elicited by epidural stimulation of the cervical spinal cord in nonhuman primates. We tested the efficiency of our algorithm both under anesthesia and during behavior.