How many tanks?
Battle mech is expensive. When tanks are there, they are committed.
Their army will move out at tanks pace regardless of Cyclone/Hellion mobility. You should have some kind of vision of when they move out, and preferably intercept them on the move.
Blinkstalkers are useful because they can disengage easily. That way you can poke and prod at their army to buy enough time to grow your army at home. A couple extra Disruptors should stop this army quite easily.
If they are already at your base with tanks before you even notice, you’ve already screwed up. But you still do have some options. Move a group of stalkers (Blink is practically a must vs Cyclone-mech) behind enemy lines to kill reinforcements. Hopefully you can buy enough time to grow your army enough to smash it from two angles.
You might have to give up the base in this scenario, but then again you’ve already screwed up as mentioned previously. So that’s fair.
So key factors here:
*Intercept tank-based army while it’s moving across the map.
*If above fails, cut off reinforcements and buy time to gain army lead.
*If you have to and can afford it, give up nexus and save probes.
*When and if you do commit to an attack, truly commit to it. A common mistake to make is to walk the lines of tank fire indecisively - giving them free damage and the worst possible trades. Once you’ve attacked, you’re committed.