Hanson agreed to a minor league contract with the San Francisco Giants on May 13, 2015. He was assigned to the San Jose Giants and was promoted to the Sacramento River Cats on July 5. He made eleven starts for Sacramento during the remainder of the season, pitching to a 3-5 record and a 5.60 ERA.
On November 9, 2015, Hanson died at Piedmont Hospital in Atlanta, after falling into a coma with catastrophic organ failure.
On December 11, 2015, a preliminary autopsy report was released, stating Hanson's official cause of death was from "delayed complications of cocaine and alcohol toxicity". The coroner ruled his death an accident caused by cocaine use.