Cilia are membrane-enveloped organelles that protrude from the surface of most eurokaryotic cells and play crucial roles in sensing the external environment. For maintenance and function cilia are dependent on intraflagellar transport (IFT). Here we use a combination of microfluidics and fluorescence microscopy to study the response of phasmid chemosensory neurons, in live Caenorhabditis elegans , to chemical stimuli. We found that chemical stimulation resulted in unexpected changes in IFT and ciliary structure. Notably, stimulation with hyperosmotic solutions or chemical repellents resulted in different responses, not only in IFT, ciliary structure and cargo distribution, but also in neuronal activity. The response to chemical repellents results in habituation of the neuronal activity, suggesting that IFT plays a role in regulating the chemosensory response. Our findings show that cilia are able to sense and respond to different external cues in distinct ways, highlighting the flexible nature of cilia as sensing hubs.