Complex agroforestry systems can host similar biodiversity levels to adjacent continuous forests and can offer important ecosystem services for wildlife. Species inhabiting adjacent forests, as well as species that prefer agroforestry systems, can benefit from this habitat matrix. It is necessary, however, to understand the species-specific adaptability to such a complex matrix. Indonesia is a biodiversity hotspot and hosts many endemic species that are threatened with extinction. Its human population relies heavily on agriculture, meaning that finding a balance between crop productivity and biodiversity is key for the long-term sustainability of local communities and wildlife. We aim to determine the influence of the presence of shade trees and distance to the forest on the detection rates of wildlife in coffee home gardens. In West Java, Indonesia, we monitored 23 gardens between April 2018 and March 2021 via camera traps, totalling 3856 days of monitoring in shade-grown and 3338 days in sun-exposed gardens. We also collected data in the nearby montane rainforest, totalling 1183 days of monitoring. We used Generalized Additive Models to estimate the influence of shade cover and distance to the forest on the detection rates of wildlife. The Sunda leopard cat Prionailurus javanensis was found more frequently in shade-grown gardens and used both the forest and agroforest matrix. Wild boars Sus scrofa mostly occurred in gardens adjacent to the forest, while barred buttonquails Turnix suscitator were associated with gardens far (>1 km) from the forest. Several species (civets Viverricula indica and Paradoxus musangus javanicus, Horsfield’s treeshrew Tupaia javanica, Javan ferret badger Melogale orientalis, Javan mongoose Herpestes javanicus) were not influenced by shade cover and distance to the forest, suggesting they are well adapted to the agroforestry system. Still, species of high conservation importance, such as Javan leopard Panthera pardus melas, Sunda porcupine Hystrix javanica, and grizzled langur Presbytis comata, were present in the forest but not in the agroforest, suggesting that the replacement of the forest by the agroforestry matrix is still detrimental. Nevertheless, it is important to maintain the complexity of the agroforestry system and connectivity with the neighbouring continuous forest to favour the long-term sustainability of this environment and the conservation of endemic species.