Kenyon Wells of Livingston appeared in court Wednesday on felony burglary charges.
Prosecutors say Wells broke into at least three Bozeman area homes early Tuesday morning, stealing a car from one.
Deputies say they later discovered Wells in a detached garage, trying to get into the rafters.
He allegedly had a bag of methamphetamine in his pocket.
The judge set bond at $50,000.
Editors Note: This article was corrected to reflect the fact that Wells is accused of stealing a car, not a truck.