The refinement of neural circuits involves dendrite pruning, a process that removes inappropriate projections that are formed during development. In Drosophila sensory neurons, compartmentalized calcium (Ca(2+)) transients in dendrites act as spatiotemporal cues to trigger pruning, yet how neurons define the dendrites with Ca(2+) transients remains elusive. Here we report that local elevation of endocytic activity contributes to defining dendrites that generate Ca(2+) transients, triggering pruning. In vivo imaging of single dendrites reveals an increase of endocytosis in proximal dendrites that spatially and temporally correlates with dendrite thinning, an early step in pruning tightly coupled with compartmentalized Ca(2+) transients. Two GTPases, Rab5 and dynamin, are required for both the increased endocytic activity and compartmentalized Ca(2+) transients. Further genetic analyses suggest that local endocytosis in proximal dendrites functions cooperatively with global endocytosis-mediated protein degradation pathways to promote dendrite pruning.