To guide programmer code navigation, previous approaches such as TeamTracks recommend pieces of code to visit by mining the associations between pieces of code in programmer interaction histories. However, these result in low recommendation accuracy. To create more accurate recommendations, we propose NavClus an approach that clusters navigation sequences from programmer interaction histories. NavClus automatically forms collections of code that are relevant to the tasks performed by programmers, and then retrieves the collections best matched to a programmer`s current navigation path. This makes it possible to recommend the collections of code that are relevant to the programmer`s given task. We compare NavClus` recommendation accuracy with TeamTracks` by simulating recommendations using 4,397 interaction histories. The comparative experiment shows that the recommendation accuracy ofNavClus is twice as high as that of TeamTracks. We also conduct a diary study to investigate the effectiveness of a graphical code recommender that incorporates the NavClus approach. Our study reveals that developers using NavClus tend to spend less time viewing the code base and more time modifying the software, indicating less time is needed to understand software before modifying it.