The Hat-in-Hand glitch is a glitch that causes Mario to hold his hat in his hand, as if he was stuck in his putting-on-a-cap animation. When holding objects in this state, the objects' models don't render, which means the HOLP will not update.
The hat in hand glitch is performed by picking up two or more caps in quick succession. The glitch works with duplicated normal caps as well as special caps. During the animation of putting on a cap, the hat appears in Mario's hand. If the animation is interrupted at the very end with picking up another cap, then Mario will not update to having the hat on his head instead of in his hand.
Ending the Glitch
Mario will put his hat back on after any textboxes (except for sign textboxes) or any cutscenes. The hat will also go back onto Mario's head if he leaves the course.
When Mario is holding his hat in his hand, it cannot be stolen by enemies.
While holding his hat, Mario will take damage as if he was not wearing his hat.
The HOLP will not update while Mario is holding his hat in his hand, since the hat is rendered in his hand and consequently the object is not rendered, which is required for updating the HOLP.
Use in Challenges
Due to its property of causing the HOLP not to update, the Hat in Hand glitch has been useful in some challenges such as the A Button Challenge. Although it has often been obsoleted by pause buffered hitstun, it's still required for Mario Wings to the Sky in 0 A presses and Pole-Jumping for Red Coins in 0,5 A presses. It's also the only way to place crazy boxes at a remote HOLP, which is used in the current fastest method for Ride Big Boo's Merry-Go-Round in 0 A presses.
The hat in hand glitch can be performed in the following courses. 
- Bob-omb Battlefield, using the Wing Cap
- Whomp's Fortress, using the Metal Cap
- Jolly Roger Bay, using the Metal Cap
- Big Boo's Haunt, using the Vanish Cap
- Hazy Maze Cave, using the Metal Cap
- Shifting Sand Land, using the Wing Cap
- Dire, Dire Docks, using the Metal Cap or the Vanish Cap
- Snowman's Land (outside the igloo), using a hat clone
- Snowman's Land (inside the igloo), using the Vanish Cap
- Wet-Dry World, using the Metal cap or the Vanish Cap
- Tall, Tall Mountain, using a hat clone
- Tower of the Wing Cap, using the Wing Cap
- Vanish Cap under the Moat, using the Vanish Cap
- Cavern of the Metal Cap, using the Metal Cap
- Wing Mario over the Rainbow, using the Wing Cap
The glitch can only be done if the cap is close enough to the cap block when the block respawns, so it needs to be stopped by a wall. Seeing as there are no walls near the cap blocks in Bowser in the Dark World and Lethal Lava Land, the glitch can't be done in these courses. Even though there are no walls near the metal cap block in Wet-Dry World, the glitch can still be done with that cap because it can be stopped by the water. This requires raising the water level exactly once, so it reaches above the cork boxes and submerges the cap.