Upon reaching their intermediate target, the floorplate, commissural axons acquire responsiveness to repulsive guidance cues, allowing the axons to exit the midline and adopt a contralateral, longitudinal trajectory. The molecular mechanisms that regulate this switch from attraction to repulsion remain poorly defined. Here, we show that the heparan sulfate proteoglycan Glypican1 (GPC1) is required as a coreceptor for the Shh-dependent induction of Hedgehog-interacting protein (Hhip) in commissural neurons. In turn, Hhip is required for postcrossing axons to respond to a repulsive anteroposterior Shh gradient. Thus, Shh is a cue with dual function. In precrossing axons it acts as an attractive guidance molecule in a transcription-independent manner. At the same time, Shh binds to GPC1 to induce the expression of its own receptor, Hhip, which mediates the repulsive response of postcrossing axons to Shh. Our study characterizes a molecular mechanism by which navigating axons switch their responsiveness at intermediate targets.