During development, the refinement of neural circuitry involves the removal of specific dendritic branches, but how this selective elimination is mediated is unclear. The authors monitored changes in levels of intracellular calcium before and during dendritic pruning in Drosophila melanogaster sensory neurons. They found that localized changes in excitability in specific dendritic branches result in the generation of compartmentalized calcium transients that trigger pruning of those branches through mechanisms that involve activation of the calcium-activated protease calpain.