Assembly and function of cilia rely on the continuous transport of ciliary components between the cell body and the ciliary tip. This is performed by specialized molecular machines, known as Intraflagellar Transport (IFT) trains. Anterograde IFT trains are powered by kinesin-2 motors and move along the B-tubules (enriched in detyrosinated tubulin) of the ciliary microtubule doublets. Conversely, retrograde IFT trains are moved by dynein-1b motors along the A-tubules (enriched in tyrosinated tubulin) back to the cell body. The segregation of oppositely directed trains on A-tubules or B-tubules is thought to prevent traffic jams in the cilium, but the mechanism by which opposite polarity trains are sorted onto either tubule, and whether tubulin tyrosination/detyrosination plays a role in that process, is unknown. Here, we show that CRISPR-mediated knock-out of VashL, the enzyme that detyrosinates microtubules, causes recurrent stoppages of IFT trains and reduces the rate of ciliary growth in Chlamydomonas reinhardtii. To test whether the observed stoppages, potentially caused by collisions between oppositely directed IFT trains, are ascribable to direct interactions between IFT trains and tubulin tyrosination/detyrosination, we developed methods to reconstitute the motility of native IFT trains from cilia on de-membranated axonemes and ex vivo on synthetically polymerized microtubules. We show that anterograde trains have higher affinity for detyrosinated microtubules (analogous to B-tubules), while retrograde trains for tyrosinated microtubules (analogous to A-tubules). We conclude that tubulin tyrosination/detyrosination is required for the spatial segregation of oppositely directed trains and for their smooth uninterrupted motion. Our results provide a model for how the tubulin code governs molecular transport in cilia.