Cilia have evolved hugely diverse structures and functions to participate in a wide variety of developmental and physiological processes. Ciliary specialization requires differences in gene expression, but few transcription factors are known to regulate this, and their molecular function is unclear. Here, we show that the Drosophila Forkhead box (Fox) gene, fd3F, is required for specialization of the mechanosensory cilium of chordotonal (Ch) neurons. fd3F regulates genes for Ch-specific axonemal dyneins and TRPV ion channels, which are required for sensory transduction, and retrograde transport genes, which are required to differentiate their distinct motile and sensory ciliary zones. fd3F is reminiscent of vertebrate Foxj1, a motile cilia regulator, but fd3F regulates motility genes as part of a broader sensory regulation program. Fd3F cooperates with the pan-ciliary transcription factor, Rfx, to regulate its targets directly. This illuminates pathways involved in ciliary specialization and the molecular mechanism of transcription factors that regulate them.