Animal locomotion is mediated by a sensory system referred to as proprioception. Defects in the proprioceptive coordination of locomotion result in uncontrolled and inefficient movements. However, the molecular mechanisms underlying proprioception are not fully understood. Here, we identify two transient receptor potential cation (TRPC) channels, trp-1 and trp-2, as necessary and sufficient for proprioceptive responses in C. elegans head steering locomotion. Both channels are expressed in the SMDD neurons, which are required and sufficient for head bending, and mediate coordinated head steering by sensing mechanical stretches due to the contraction of head muscle and orchestrating dorsal head muscle contractions. Moreover, the SMDD neurons play dual roles to sense muscle stretch as well as to control muscle contractions. These results demonstrate that distinct locomotion patterns require dynamic and homeostatic modulation of feedback signals between neurons and muscles.