For indispensable reporting on the coronavirus crisis, the election, and more, subscribe to the Mother Jones Daily newsletter.

At 13, Patrick started shooting heroin. When I met him on a sunny Tuesday last August, he was a homeless 46-year-old with a chiseled face and close-cropped hair, sitting in the examination room of a pioneering opioid addiction treatment clinic in SOMA—a San Francisco neighborhood known lately for both homelessness and tech companies. Outside, needles and broken glass littered the sidewalks. Twitter’s headquarters were two blocks away.

Clinic manager Dina Cehand asked why Patrick had come to the clinic that morning, walking from the squat house where he lived with a crew of homeless people, and he put his head in his hands. “I don’t want to use opiates no more,” he pleaded, shaking. “I don’t want to do Oxy. I don’t want that.”

Patrick is one of 2.5 million Americans who are addicted to opioids, from prescription painkillers like OxyContin or Vicodin to heroin and fentanyl. Their options for addiction treatment are few: abstinence, in which they give up the drugs altogether, or medication. Abstinence-based programs have abysmal success rates, with some studies showing that as many as 90 percent of those who complete them relapse within a year. Of the go-to medications, there’s methadone, which has been around for decades but requires daily visits to a methadone clinic—many of which have long waiting lists.

And then there’s buprenorphine—which Patrick was just starting. Like methadone, buprenorphine serves as an opioid replacement, curbing the cravings for heroin or painkillers. It’s more difficult to abuse than methadone, and, critically, you don’t need to go to clinic each day—ideally, a doctor can prescribe the medication, which comes in pill or film form, like any other drug.

But buprenorphine, which was approved by the Food and Drug Administration in 2002, is still not available to most drug users looking for help. That’s partly because only a fraction of primary care doctors have taken the required eight-hour training to prescribe the drug, and partly because getting started on it typically requires a bit of hand-holding. Patients—particularly those with a long history of drug abuse—need to be watched carefully to make sure they’re getting the right dose, not using drugs with dangerous conflicts, and not smuggling it to sell on the street. (The pills sell for about $10 a pop.) Daily or weekly visits are typically in order for a few weeks.

All of which contributes to a so-called “treatment gap”: Though drug overdoses now kill more Americans than guns or cars, upwards of 80 percent of those in need of opioid addiction treatment don’t have access to it. Getting effective treatment to someone like Patrick—jobless, homeless, no insurance—is the exception to the rule.

But Patrick is attending one of a handful of programs around the country that provides buprenorphine to “safety net” residents—those without private insurance. The program, called Office-Based Buprenorphine Induction clinic, or OBIC, does the hand-holding that the drug requires at the beginning—watching patients take the medication, testing for other drugs the patient is using, and providing counseling. After patients are stable for a few weeks or months—off heroin or painkillers and onto the right dose of buprenorphine—the clinic transfers the patient to a nearby primary care provider. The program, which treats about 200 new patients per year, has become a model for clinics across the country. Public health officials from across the world, from Portland to New York to Japan, regularly come to observe.

When it comes to making opioid treatment available, “San Francisco probably does it better than anybody,” says David Kan, an addiction psychiatrist and president of the California Society of Addiction Medicine.

Inside the nondescript SOMA building are exam rooms and a modest waiting room decorated with ivy. “No pee, no see—that’s our philosophy,” said Dina Cehand, the program manager, gesturing to a pink bin for urine samples. The samples have a temperature gauge to make sure the urine is warm. “You can buy urine from the mom and pop shops,” she explained. “They come in, try to heat it up in the sink, run the jar under hot water. Our patients are really creative.”

In a light-filled office next to the exam rooms, the four OBIC clinicians discussed the patients on the day’s schedule. (All patient names have been changed to protect their privacy.)

There was Vicki, the 35-year-old Cambodian woman who was on buprenorphine but, like many patients, was also addicted to meth. The day before, she had hobbled in, legs swollen, red, and shiny. It was cellulitis, a bacterial skin infection common among meth users. “I kept trying to explain to her that it was related to the meth—that it was because her heart is giving out, but I don’t know if she got it,” said Mike Silva, a genial psychiatric nurse, in a worried voice. He put her in a cab and directed it to a nearby hospital.

There was the 37-year-old regular who was sometimes so high and paranoid on meth that he hid behind the cars on Howard Street. They left him granola bars at the front desk in hopes of bringing him in.

There was a tall, shy man named Nathan, who was addicted to opioids on and off for twelve years before coming to OBIC. He hadn’t used since, and he was about to “graduate” to another clinic. The staff, knowing he was nervous about the transition, would personally walk him to his first appointment.

“Homeless people, sometimes, they lose track of time. We get out there and we don’t give a fuck about anything except getting high and getting our next fucking fix,” said Patrick. “Now, I give a shit.”

And there was Patrick—who, to a casual observer, faced so many long-term, interwoven, seemingly insurmountable barriers that any attempt of treatment seemed futile. He started using regularly at 15, when he was living on his own and working in lumber yards in Northern California’s Humboldt County. He’d been homeless on and off for years, living under bridges and in abandoned homes. In addition to heroin, he used meth, and he made money to pay for the drugs by stealing bikes and selling weed.

He spoke quickly during his appointment, explaining he had fallen asleep on the train the night before and woken up nearly 40 miles away before being kicked off. To give himself a boost in the morning, he used speed.

Cehand later told me matter-of-factly that Patrick was “pretty likely to drop out.” When I asked if this made her work seem futile, she looked affronted. “Even if someone shows up for just one or two days and they feel good, they remember that,” she said. “Then the next time it’s four or five days, and then maybe longer.”

At it’s best, the program is life-changing. One former patient took to Yelp to spread the word, writing, “Oh my god, I can write a review for the place that saved my life?!” Another recently left this voicemail: “I’m not sure if you remember me, but I came to your place to get help,” she said in a timid tone. “I just wanted to say hello. I’ve been clean for a number of years now. I have a child—our child is four years old. I just wanted to say thank you.”

Former patients often continue using the clinic’s on-site pharmacy because it’s so unlike a typical Walgreens or CVS. When patients are first getting started on buprenorphine, they’ll come in daily for observed dosing—a pharmacist watches the patient put the buprenorphine film or pill under their tongue and keep it there for five minutes. Pharmacists reach out to patients before their prescriptions have run out so there’s no break between doses. If a patient comes in for a dose and looks high or drunk, the pharmacy will send them up to the clinic.

Three months after my first OBIC visit, I gave Patrick a call. Against the odds, he had been going back to the clinic for his buponephrine doses. “It’s a miracle drug,” he said calmly. “It’s totally turned my life around.”

Now, when he wakes up in the morning, instead of craving heroin, he has a cup of coffee and breakfast. He’s living in a single-occupancy hotel and has a job interview lined up for later in the week.

The progress is fragile, though. A few weeks into the buprenorphine treatment, he was picked up for an old warrant for petty theft—stealing a bolt locker to steal bikes—and put in jail in another county, where buprenorphine wasn’t an option. When he got out, he couldn’t get buprenorphine because the clinic was closed over the weekend, so he sought out heroin and overdosed. His girlfriend found him in his hotel room and injected him with the overdose reversal drug naloxone. The next day, he walked into OBIC.

Cehand wrote to me in an email that Patrick is “doing well in a hotel and trying really hard to adjust to a life without drugs. As a middle aged person, that’s a tall order but he’s trying really hard.”

Patrick put it more bluntly. “Homeless people, sometimes, they lose track of time. We get out there and we don’t give a fuck about anything except getting high and getting our next fucking fix,” he said. “Now, I give a shit.”