What level is it advised for your character to be before entering Deadwind Cavern and fighting the Legendary Deathclaw?
I am level 24, my companion is Boone and I still get my butt kicked.
It's not only about your level, but also about the weapon/perks you are using. With the perks Better Criticals and Sniper using an Anti-Materiel Rifle with armor piercing ammo, you should have an easier time fighting this beast.
Consider also using chems and magazines to boost your stats, like Psycho to inflict more damage and/or Buffout to take a few more hits before dying.
Mines on the Legendary Deathclaw path are efficient to cripple its legs and delay its advance towards you. It will also lose its "pounce" attack, that deals more damage.
Good luck!
The trick with deathclaws is to have a lot of ammo and seek higher ground. For some reason they don't seem to be able to get to you if you are perched on top of rocks.
So my strategy was to load up on explosives, go trigger the deathclaws to chase me, when they scuffled with my companions I scurried up onto a rock and then rained down bombs on them until they died. You may have to repeat triggering them a few times to get them all as they sometimes forget about you and go back into their hidey hole. Be sure to save every time you kill a few of them and get back to your safe perch so you don't have to start over if they catch you before you get to safety.
Also, beware. There is a nasty surprise outside the cave (a bunch more deathclaws) and no convenient rock to jump up on. I just ran like hell for the nearby shack. They followed me in and killed me, but when it re-spawned me inside the cabin they were back outside and oblivious to my presence.
Stealth Boy and lots of C-4. There's a reason it's the most expensive explosive in the game by far... Also, you may want to leave your companions outside for this one. They tend to get trigger-happy and ruin a good ambush.
I killed the beast at level 9. I stumbled into the cave on my way to Novac for the first time and promptly ran. They followed but to the right of the exit upon leaving is a ledge you can climb onto where they cannot reach you. I just kept sniping it with the Cowboy Repeater until it fell.
I did at Level 22, and my perks were Centre of Mass, Maths Wrath, Grim Reaper Sprint and Action Girl. I used an Anti-Materiel Rifle with Incendiary Rounds. The Explosives are no good in the cavern because up close you damage yourself.
If your gun level is high you can use an assault carbine and kill the Legendary Deathclaw. Keep in mind that you need to have Ed-E upgraded and Boone as well.