Diagnosis of lower urinary tract dysfunction with urodynamics has historically relied on data acquired from multiple sensors using nonphysiologically fast cystometric filling. In addition, state-of-the-art neuromodulation approaches to restore bladder function could benefit from a bladder sensor for closed-loop control, but a practical sensor and automated data analysis are not available. We have developed an algorithm for real-time bladder event detection based on a single in situ sensor, making it attractive for both extended ambulatory bladder monitoring and closed-loop control of stimulation systems for diagnosis and treatment of bladder overactivity. Using bladder pressure data acquired from 14 human subjects with neurogenic bladder, we developed context-aware thresholding, a novel, parameterized, user-tunable algorithmic framework capable of real-time classification of bladder events, such as detrusor contractions, from single-sensor bladder pressure data. We compare six event detection algorithms with both single-sensor and two-sensor systems using a metric termed Conditional Stimulation Score, which ranks algorithms based on projected stimulation efficacy and efficiency. We demonstrate that adaptive methods are more robust against day-to-day variations than static thresholding, improving sensitivity and specificity without parameter modifications. Relative to other methods, context-aware thresholding is fast, robust, highly accurate, noise-tolerant, and amenable to energy-efficient hardware implementation, which is important for mapping to an implant device.