Tuberculosis kills more people than any other infectious disease. Three pivotal trials testing 4-month regimens failed to meet non-inferiority margins; however, approximately four-fifths of participants were cured. Through a pooled analysis of patient-level data with external validation, we identify populations eligible for 4-month treatment, define phenotypes that are hard to treat and evaluate the impact of adherence and dosing strategy on outcomes. In 3,405 participants included in analyses, baseline smear grade of 3+ relative to <2+, HIV seropositivity and adherence of ≤90% were significant risk factors for unfavorable outcome. Four-month regimens were non-inferior in participants with minimal disease defined by <2+ sputum smear grade or non-cavitary disease. A hard-to-treat phenotype, defined by high smear grades and cavitation, may require durations >6 months to cure all. Regimen duration can be selected in order to improve outcomes, providing a stratified medicine approach as an alternative to the 'one-size-fits-all' treatment currently used worldwide.