The axon initial segment (AIS) is an important axonal microdomain for action potential initiation and implicated in the regulation of neuronal excitability during activity-dependent cortical plasticity. While structural AIS plasticity has been suggested to fine-tune neuronal activity when network states change, whether it acts as a homeostatic regulatory mechanism in behaviorally relevant contexts remains poorly understood. Using an in vivo model of the mouse whisker-to-barrel pathway in combination with immunofluorescence, confocal analysis and patch-clamp electrophysiological recordings, we observed bidirectional AIS plasticity. Furthermore, we find that structural and functional AIS remodeling occurs in distinct temporal domains: long-term sensory deprivation elicits an AIS length increase, accompanied with an increase in neuronal excitability, while sensory enrichment results in a rapid AIS shortening, accompanied by a decrease in action potential generation. Our findings highlight a central role of the AIS in the homeostatic regulation of neuronal inputoutput relations.