BackgroundTo reach South Africa’s targets for HIV treatment and viral suppression, retention on antiretroviral therapy (ART) must increase. Much effort and resources have been invested in tracing those already disengaged and returning them to care programs with mixed success. Here we aim to successfully identify ART clients at risk of loss from care prior to disengagement.Methods and FindingsWe applied a previously developed machine learning and predictive modelling algorithm (PREDICT) to routinely collected ART client data from the SLATE I and SLATE II trials, which evaluated same-day ART initiation in 2017-18. Using a primary outcome of an interruption in treatment (IIT), defined as missing the next scheduled clinic visit by >28 days, we investigated the reproducibility of PREDICT in SLATE datasets. We also tested two risk triaging approaches: 1) threshold approach classifying individuals into low, moderate, or high risk of IIT; and 2) archetype approach identifying subgroups with characteristics associated with risk of ITT. We report associations between risk category groups and subsequent IIT at the next scheduled visit using crude risk differences and relative risks with 95% confidence intervals. SLATE datasets included 7,199 client visits for 1,193 clients over ≤14 months of follow-up. The algorithm achieved 63% accuracy, 89% negative predictive value, and an area under the curve of 0.61 for attendance at next scheduled visit, similar to previous results using only medical record data. The threshold approach consistently and accurately assigned levels of IIT risk for multiple stages of the care cascade. The archetype approach identified several subgroups at increased risk of IIT, including those late to previous appointments, those returning after a period of disengagement, those living alone or without a treatment supporter. Behavioural elements of the archetypes tended to drive risk of treatment interruption more consistently than demographics; e.g. adolescent boys/young men who attended visits on time experienced lowest rates of treatment interruption (10%, PREDICT datasets and 7% SLATE datasets), while adolescent boys/young men returning after previously disengaging from care had highest rates of subsequent treatment interruption (31%, PREDICT datasets and 40% SLATE datasets).ConclusionRoutinely collected medical record data can be combined with basic demographic and socioeconomic data to assess individual risk of future treatment disengagement using machine learning and predictive modelling. This approach offers an opportunity to intervene prior to and potentially prevent disengagement from HIV care, rather than responding only after it has occurred.