Wigan had looked set to register a sixth clean sheet in eight league games until the former Leeds player struck.
But Latics, who looked rock solid in the first half, were stretched more by Town after the break.
Midfielder Oliver Norwood hit the bar with a wind-assisted 40-yard free-kick just four minutes before Clayton's winner.
The ball crashed down off the woodwork and into the hands of keeper Al Habsi as he dived for the effort.
In-form Norwood, who hit the post with a similar drive against Leeds last week, also saw a shot on 73 minutes dip just over the bar.
Huddersfield, boosted by the return of striker James Vaughan from a knee injury, made most of the early running.
Vaughan twice just failed to connect with teasing crosses from Hammill early on before going close with an over-head kick on 42 minutes.
Wigan, who have now failed to score in their last three away games, grew into the game, which was played in a biting wind and swirling rain.
Martyn Waghorn, one of five signings made by Wigan boss Uwe Rosler, was at the heart of things for the visitors.
There was a bizarre incident on 14 minutes when Waghorn, affected by the wind, kicked the flag instead of the ball at a corner.
Referee Mark Brown insisted the corner be taken again, much to the disgust of Norwood, who was lucky not to be booked for dissent.
Soon after another Waghorn corner was flapped at by keeper Alex Smithies with a Marc Antoine-Fortune header cleared by Anthony Gerrard.
Wigan had the best of the early second-half stages but failed to test Smithies, despite creating some good chances.
Fortune hit the top of the bar with a shot from Waghorn's pass on 52 minutes and then the on-loan Leicester forward twice went close seconds later.
Waghorn first hit the side netting from close range when Fortune put him in and he then blazed over from McArthur's cross.
At the other end substitute Danny Ward, who replaced Nahki Wells, grazed the side-netting with a near-post shot from Norwood's diagonal through ball.
Ward's introduction turned the tide in Town's favour and they began to dominate, with Clayton and Norwood coming into their own in the closing stages with the former eventually grabbing the winner.
- Sports & Recreation
- Oliver Norwood
- Ali Al Habsi
- Adam Hammill