Context Species of the tropical frog Family Hylodidae tend to be restricted to streams and, hence, have a small occupancy area. Hylodes fredi (Canedo and Pombal 2007), a diurnal stream-dwelling species endemic to the Atlantic Forest in Ilha Grande, south-eastern Brazil, is one such species. Because of scarce population studies, it is also categorised as Data Deficient (DD) in the IUCN Red List. Previous studies on the habitat use by this species did not account for imperfect detection, which could have led to biased results. Aims We aimed to systematically describe the microhabitats occupied by H. fredi, by generating a fine-scale occupancy model while accounting for imperfect detection. Methods We sampled six streams where the species is known to occur. Perpendicular transects were established in each stream and further subdivided into 10 sampling plots. Single-species and single-season occupancy models were created with the UNMARKED R package, and model selection was performed on the basis of the Akaike information criterion. Key results We observed the species in 70 of the 275 sampled sites, which resulted in a naïve occupancy of 0.28 and detectability of 0.25. The best models suggest that H. fredi occupancy increases positively with rock cover and inversely with leaf-litter cover. Detectability reduced with an increase in leaf litter cover and varied with the air temperature. Conclusions We conclude that H. fredi occupancy is affected by the presence of rock and leaf-litter cover. The data indicated that the species is restricted to the stream channel and does not seem to occupy forested areas that are distanced from the stream margins. Implications Considering that H. fredi and many other congeneric species are listed as ‘Data Deficient’ in the IUCN Red List, it is important to define a threat category so as to conserve them. Many stream-associated species tend to have their occupancy overestimated, leading to an underestimation of their threat risk. This study systematically demonstrated that H. fredi has a strict and reduced occupancy, mostly limited to the stream margins, that should be considered when determining conservation efforts for this and ecologically similar species.