The development of neuronal circuits is controlled by guidance molecules that are hypothesized to interact with the cholesterol-enriched domains of the plasma membrane termed lipid rafts. Whether such domains enable local intracellular signalling at the submicrometre scale in developing neurons and are required for shaping the nervous system connectivity in vivo remains controversial. Here, we report a role for lipid rafts in generating domains of local cAMP signalling in axonal growth cones downstream of ephrin-A repulsive guidance cues. Ephrin-A-dependent retraction of retinal ganglion cell axons involves cAMP signalling restricted to the vicinity of lipid rafts and is independent of cAMP modulation outside of this microdomain. cAMP modulation near lipid rafts controls the pruning of ectopic axonal branches of retinal ganglion cells in vivo, a process requiring intact ephrin-A signalling. Together, our findings indicate that lipid rafts structure the subcellular organization of intracellular cAMP signalling shaping axonal arbors during the nervous system development.