Hedgehog pathway components and select G protein-coupled receptors (GPCRs) localize to the primary cilium, an organelle specialized for signal transduction. We investigated whether cells distinguish between ciliary and extraciliary GPCR signaling. To test whether ciliary and extraciliary cyclic AMP (cAMP) convey different information, we engineered optogenetic and chemogenetic tools to control the subcellular site of cAMP generation. Generating equal amounts of ciliary and cytoplasmic cAMP in zebrafish and mammalian cells revealed that ciliary cAMP, but not cytoplasmic cAMP, inhibited Hedgehog signaling. Modeling suggested that the distinct geometries of the cilium and cell body differentially activate local effectors. The search for effectors identified a ciliary pool of protein kinase A (PKA). Blocking the function of ciliary PKA, but not extraciliary PKA, activated Hedgehog signal transduction and reversed the effects of ciliary cAMP. Therefore, cells distinguish ciliary and extraciliary cAMP using functionally and spatially distinct pools of PKA, and different subcellular pools of cAMP convey different information.