Primary cilia, organelles protruding from the surface of eukaryotic cells, act as cellular antennae to detect and transmit signals from the extracellular environment. They are built and maintained by continuous cycles of intraflagellar transport (IFT), where ciliary proteins are transported between the ciliary base and tip. These proteins originate from the cell body because cilia lack protein synthesis machinery. How input from the cell body affects IFT and ciliary function is not well understood. Here, we use femtosecond-laser ablation to perturb the dendritic input of proteins to chemosensory cilia in living Caenorhabditis elegans. Using fluorescence microscopy, we visualize and quantify the real-time response of ciliary proteins to dendritic ablation. We find that the response occurs in three distinct stages. First, IFT dynein is activated within seconds, redistributing IFT components toward the ciliary base; second, the ciliary axoneme shortens and motors slow down; and third, motors leave the cilium. Depletion of ATP by adding azide also results in IFT slowdown and IFT components leaving the cilium, but not in activation of retrograde IFT. These results indicate that laser ablation triggers a specific mechanism important for IFT regulation that allows the cilium to rapidly adapt to changes in the outside environment.