Many caravanners explain (=complain) that their coat/clothes hangers bounce off the hanging rails in their wardrobes when their caravan is towed. This seems more likely if your caravan (or trailer) has an end wardrobe. This is a clip to prevent clothes hangers bouncing of the hanging rail during a caravan journey. It was designed for plastic hangers with a (roughly) 10mm diameter hook, but will probably work for the wire hooked versions (please let me know your experience of this).
Hopefully, the photos show how to use it. The hanging rail does not need to be removed to use the clip, but you may need to put the clip on the hanger hook before clipping it to the rail.
I printed the clip in white Esun PLA+, on its side (as in the first photograph), with a 2mm brim and support on the underside of the hole where the hanger hook slots in.
The design is intended to fit hanging rails with a squared oval profile, roughly 30mm tall x 16mm wide. It would be possible to modify the design to fit different rail profiles. The original drawing is here:
The author marked this model as their own original creation.