Summary During development, many tubular organs undergo extensive longitudinal growth to reach their defined length, essential for their function, but how they lengthen is poorly understood. Here, we found that primary cilia are critical for the elongation of the small intestine and esophagus during murine embryonic development. More specifically, HH ligands produced by the epithelium signaled via cilia in the surrounding mesenchyme to pattern the smooth muscle. Like attenuated ciliary HH signaling, partial ablation of the smooth muscle reduced elongation, revealing an essential role for smooth muscle in longitudinal growth. Disruption of cilia, HH signaling or the smooth muscle reduced residual stress within the gut wall, indicating that smooth muscle contributes to the mechanical properties of the developing gut. Reducing residual stress decreased nuclear YAP, an effector of the mechanotransductive Hippo pathway. Removing YAP in the mesenchyme did not affect smooth muscle formation, but attenuated proliferation and elongation, demonstrating that YAP interprets smooth muscle-generated force to promote proliferation. Together, our results reveal that ciliary signaling directs the formation of the smooth muscle layer which, in turn, generates mechanical forces that activate YAP-mediated proliferation. As this interplay of biochemical and mechanical signals drives elongation of both the esophagus and small intestine, we propose that this mechanism may underlie tubular organ elongation generally. Highlights Primary cilia are essential for the elongation of the small intestine and esophagus during embryonic development Ciliary signaling patterns the smooth muscle in the developing intestine and esophagus The smooth muscle contributes to tissue mechanics Smooth muscle-generated strain activates YAP to drive longitudinal growth of the tubular organs