Inflammation in the gut, caused by infection and autoimmunity, remains challenging to effectively detect, monitor, and treat. Here, we engineer a commensal mouse E. coli strain to record exposure to tetrathionate, a downstream product of reactive oxygen species generated during inflammation. Using these programmed bacteria to sense in situ levels we show that tetrathionate accompanies inflammation during Salmonella-induced colitis in mice and is elevated in an inflammatory bowel disease mouse model. We demonstrate long-term genetic stability and associated robust function of synthetic genetic circuits in bacteria colonizing the mammalian gut. These results demonstrate the potential for engineered bacteria to stably and reliably probe pathophysiological processes for which traditional diagnostics may not be feasible or cost-effective.