We develop a new code, the Hierarchical Bound-Tracing (hbt for short) code, to find and trace dark matter subhaloes in simulations based on the merger hierarchy of dark matter haloes. Application of this code to a recent benchmark test of finding subhaloes demonstrates that hbt stands as one of the best codes to trace the evolutionary history of subhaloes. The success of the code lies in its careful treatment of the complex physical processes associated with the evolution of subhaloes and in its robust unbinding algorithm with an adaptive source-subhalo management. We keep a full record of the merger hierarchy of haloes and subhaloes, and allow the growth of satellite subhaloes through accretion from its ‘satellite-of-satellites’, hence allowing mergers among satellites. Local accretion of background mass is omitted, while rebinding of stripped mass is allowed. The justification of these treatments is provided by case studies of the lives of individual subhaloes and by the success in finding the complete subhalo catalogue. We compare our result to other popular subhalo finders and show that hbt is able to well resolve subhaloes in high-density environment and keeps strict physical track of subhaloes’ merger history. This code is fully parallelized and freely available upon request to the authors.