the specific aims of this research are 1) To develop and refine, with user feedback, a cognitive behavioral therapy-based text-messaging intervention (TXT-CBT) for HIV-infected adults with opioid dependence; 2) To conduct a pilot randomized clinical trial to assess the feasibility of recruiting and retaining individuals for a large scale study and to determine the effect size of TXT-CBT over and above standard care (SC) on opioid use, HIV medication adherence, and healthcare outcomes. Both SC and SC+TXT-CBT participants will be assessed at baseline, treatment-end, and 12 weeks post-treatment; and 3) To examine potential mechanisms of action of TXT-CBT, including self-efficacy, affect regulation, and social support. The investigators hypothesize that TXT-CBT delivered in conjunction with SC will produce greater reductions in opioid use and HIV-risk behaviors, and will improve HIV treatment regimen adherence, relative to MM alone. Further, the investigators expect that SC+TXT-CBT will facilitate greater changes in negative affect, self-efficacy, and social support, and these changes will be associated with substance use outcomes. TXT-CBT incorporates specific substance- and adherence-focused cognitive therapy techniques with a concurrent emphasis on reducing HIV-risk behaviors. By providing support to maximize HIV treatment regimen adherence, coupled with coping skills to address withdrawal symptoms and stress, two important factors in opioid relapse, TXT-CBT may provide a promising, cost-effective, and easily deployable augmenting strategy for the treatment of opioid users who are HIV-infected.