This paper presents a tree-pattern-based method of automatically and accurately finding code clones in program files. Duplicate tree-patterns are first collected by anti-unification algorithm and redundancy-free exhaustive comparisons, and then finally clustered. The algorithm is designed in such a way that the same comparison is not repeated for speed, while thoroughly examining every possible pairs of tree patterns for accuracy. Our method maintains the syntax structure of code in tree-pattern clusters, which gives the flexibility of finding different types of clones while keeping the precision. Categories and Subject Descriptors D.2 [Software Engineering]: D.2.7 Distribution, Maintenance, and Enhancement – Restructuring, reverse engineering, and reengineering, Version control; D.3 [Programming Language]: D.3.3 Language Constructs and Features – Patterns General Terms Algorithms, Management, Languages Keywords clone detection, tree-pattern, reverse engineering, software maintena...