The algorithm developed by the CMS Collaboration to reconstruct and identify tau leptons produced in proton-proton collisions at root s = 7 and 8 TeV, via their decays to hadrons and a neutrino, has been significantly improved. The changes include a revised reconstruction of pi(0) candidates, and improvements in multivariate discriminants to separate tau leptons from jets and electrons. The algorithm is extended to reconstruct tau leptons in highly Lorentz-boosted pair production, and in the high-level trigger. The performance of the algorithm is studied using proton-proton collisions recorded during 2016 at root s = 13 TeV, corresponding to an integrated luminosity of 35.9 fb(-1). The performance is evaluated in terms of the efficiency for a genuine tau lepton to pass the identification criteria and of the probabilities for jets, electrons, and muons to be misidentified as tau leptons. The results are found to be very close to those expected from Monte Carlo simulation.