We prove that the set of limit groups is recursive, answering a question of Delzant. One ingredient of the proof is the observation that a finitely presented group with local retractions (a la Long and Reid) is coherent and, furthermore, there exists an algorithm that computes presentations for finitely generated subgroups. The other main ingredient is the ability to algorithmically calculate centralizers in relatively hyperbolic groups. Applications include the existence of recognition algorithms for limit groups and free groups.