Researchers developed a mathematical model to examine how antibiotic treatment duration influences the emergence of antimicrobial resistance. The model integrates pathogen growth, immune response, antibiotic action, and commensal bacteria dynamics. Simulations showed that 71 percent of cases successfully treated with a standard 7-day regimen could also be cured with shorter "Stop When Better" (SWB) courses, where treatment cessation was triggered by a predefined pathogen abundance threshold, and 97 percent with SWB plus one day. Compared to standard treatment, the SWB+1 approach reduced overall antibiotic exposure and resistance emergence in commensal niches while maintaining efficacy. Although these findings suggest potential for future adaptive antibiotic prescribing strategies, further clinical validation is necessary.