The Philadelphia lefty gave up a leadoff double to Tyler Greene in the first inning, then retired 14 straight hitters.
Hamels alllowed one hit in five innings. Brandon Laird was the only other batter to reach against Hamels, drawing a two-out walk in the fifth.
Greene scored Houston's run on a groundball. Hamels struck out one in his fourth spring start.
"At least I was able to build up my pitch count, which was huge," Hamels said, "but I've got to get the timing issue down so I can go seven, eight, nine innings and throw as many pitches as I have to."
Five days after giving up eight runs and 12 hits to a Dominican Republic team tuning up for the World Baseball Classic, Hamels looked more like the pitcher who won a career-high 17 games last season.
"You just keep making adjustments and I was finally able to get a few good pitches there, but it's not as consistent as where I need it to be," he said. "It's just a timing issue. More reps obviously will help."
"I feel strong and that's great, but you want to feel strong and you want your timing to be right on target, too, to pitch effectively. That's kind of where my mind's wandering. I just need to get there and I have a lot of work to do."
Peacock had one of the Astros' more impressive outings of the spring while filling in for Lucas Harrell, who has a strained groin. A new sinker has given a confidence boost to the 25-year-old Peacock, who was acquired from Oakland in a trade just before the start of spring training.
"Everybody has always told me I need a sinker and I've always tried, but it just didn't do anything," Peacock said. "This year I just took their advice and it's working good. Hopefully I can keep that pitch going in my next start."
"He's just got to get a little mad or something and he'll be OK," manager Charlie Manuel said. "Throw some fits or something."
Phillies LF Darin Ruf left in the sixth after being hit on his left arm by a pitch from Cosart. Houston 1B Brett Wallace was replaced after striking out on a pitch that hit his hand. Neither injury was considered serious. ... Erik Bedard, who missed a turn because of tightness in his right gluteal muscle, will get another start for the Astros soon. ... In their first round of cuts, the Astros sent Ps Sam Demel and Rudy Owens to their minor league camp, and reassigned 2B Delino DeShields, OFs Jake Goebbert, Mark Krauss and George Springer and C Chris Wallace.