By the skin of your teeth
Overall, “by the skin of your teeth” is an idiom used to highlight a situation where someone narrowly avoids a negative outcome or achieves success in an extremely close and challenging manner. It adds a dramatic touch to the story and emphasizes the thin margin between success and failure.