The neuropsychological consequences of opioid abuse are particularly evident in attention, memory and executive functioning, but it remains unclear whether these consequences persist in heroin users doing methadone in harm reduction programs and therapeutic community treatments. Thus, the current study aimed to assess these cognitive domains in distinct clinical groups of heroin users undergoing methadone maintenance. The sample consisted of 110 participants divided in four groups (low threshold methadone program, short-term community treatment, long-term community treatment, drug-free controls). These groups were compared regarding memory and attentional abilities. Multiple linear regressions were then conducted to obtain standardized effect sizes for significant comparisons. Results showed a better attentional and memory function in patients that were in opioid dependence treatment in community opposed to patients in harm reduction programs (p's<0.05). Standardized effect sizes suggest larger improvements in cognition in long-term heroin-abstinent individuals doing methadone maintenance. These results highlight the detrimental effect of heroin use in cognitive function, but also suggest that this decrement may be reversed during long-term opioid dependence treatment.