Hudson-Prentice was out for 99 from 133 balls on his first-class debut for Derbyshire and Luis Reece also fell for 96 but the home side still closed in a strong position on 372-4 with Leus du Plooy 50 not out.
Tom Helm took two late wickets but Middlesex lacked intensity for much of the day after electing to put Derbyshire in.
A grassy pitch probably persuaded them to bowl but if there was anything there for the seamers, they failed to take advantage by dropping too short.
Godleman may have unsettled their line with the way he set about the bowling, charging down the wicket to drive Toby Roland-Jones for six on his way to a 35-ball half-century that also contained nine fours.
Perhaps Middlesex were taken by surprise given that Godleman holds the record for the slowest ever championship 50 from 244 balls, made against them in 2013, but they did not help themselves by spilling three chances.
The most costly was when Max Holden put down Reece at mid-wicket off Roland-Jones before he had scored which would have given Middlesex the early breakthrough that might have changed the course of the day.
Godleman should have gone on 51 when he cut Nathan Sowter to gully and the spinner saw Reece put down at slip on 33 in his next over.
By the time Sowter found some turn and bounce to have Godleman caught behind, Derbyshire were well set and Hudson-Prentice took advantage to unfurl some handsome drives through the covers on his first-class debut for the county.
The 23-year-old last played in the championship in 2016 before he was released by Sussex but Derbyshire’s decision to sign him on a three year deal looks a decent one on this showing.
He and Reece took Derbyshire to a first batting point in the 49th over before Reece drove George Scott tamely to mid on four short of a second championship century of the season.
Hudson-Prentice quickly passed his previous best first-class score of 20 and after reaching 50 from 64 balls, launched Sowter over long-on for six.
By contrast, du Plooy struggled with his timing but he dug in as Derbyshire went past 300 before Middlesex claimed the second new ball.
It should have accounted for Hudson-Prentice who edged Tom Helm to second slip on 91 only for the umpire to signal a no ball which summed up Middlesex’s day.
But Helm got him two overs later when Hudson-Prentice top-edged a pull to midwicket and then had Alex Hughes caught behind without scoring, the only failure on a day which belonged to the batsmen.
Join the newsletter to receive the latest updates in your inbox.