Clear indications on how to select retreatments for recurrent hepatocellular carcinoma (HCC) are still lacking.To create a machine learning predictive model of survival after HCC recurrence to allocate patients to their best potential treatment.Real-life data were obtained from an Italian registry of hepatocellular carcinoma between January 2008 and December 2019 after a median (IQR) follow-up of 27 (12-51) months. External validation was made on data derived by another Italian cohort and a Japanese cohort. Patients who experienced a recurrent HCC after a first surgical approach were included. Patients were profiled, and factors predicting survival after recurrence under different treatments that acted also as treatment effect modifiers were assessed. The model was then fitted individually to identify the best potential treatment. Analysis took place between January and April 2021.Patients were enrolled if treated by reoperative hepatectomy or thermoablation, chemoembolization, or sorafenib.Survival after recurrence was the end point.A total of 701 patients with recurrent HCC were enrolled (mean [SD] age, 71  years; 151 [21.5%] female). Of those, 293 patients (41.8%) received reoperative hepatectomy or thermoablation, 188 (26.8%) received sorafenib, and 220 (31.4%) received chemoembolization. Treatment, age, cirrhosis, number, size, and lobar localization of the recurrent nodules, extrahepatic spread, and time to recurrence were all treatment effect modifiers and survival after recurrence predictors. The area under the receiver operating characteristic curve of the predictive model was 78.5% (95% CI, 71.7%-85.3%) at 5 years after recurrence. According to the model, 611 patients (87.2%) would have benefited from reoperative hepatectomy or thermoablation, 37 (5.2%) from sorafenib, and 53 (7.6%) from chemoembolization in terms of potential survival after recurrence. Compared with patients for which the best potential treatment was reoperative hepatectomy or thermoablation, sorafenib and chemoembolization would be the best potential treatment for older patients (median [IQR] age, 78.5 [75.2-83.4] years, 77.02 [73.89-80.46] years, and 71.59 [64.76-76.06] years for sorafenib, chemoembolization, and reoperative hepatectomy or thermoablation, respectively), with a lower median (IQR) number of multiple recurrent nodules (1.00 [1.00-2.00] for sorafenib, 1.00 [1.00-2.00] for chemoembolization, and 2.00 [1.00-3.00] for reoperative hepatectomy or thermoablation). Extrahepatic recurrence was observed in 43.2% (n = 16) for sorafenib as the best potential treatment vs 14.6% (n = 89) for reoperative hepatectomy or thermoablation as the best potential treatment and 0% for chemoembolization as the best potential treatment. Those profiles were used to constitute a patient-tailored algorithm for the best potential treatment allocation.The herein presented algorithm should help in allocating patients with recurrent HCC to the best potential treatment according to their specific characteristics in a treatment hierarchy fashion.