mountain climbers, a great exercise to target the core and also do some cardio training to burn fat, but there are mainly 4 safety and performance notes you should consider.
1_ make sure the knee comes high so the hip tilts posteriorly as well. do not just flex your hip, make sure you bring the knee up so your spine also flexes as well. it is better to bring the knee to the alternate side so you have more freedom. if you just bring forward and back, you might hit the ground if you go a little bit fast or get fatigued, also you need more flexibility and stability to do that safely.
2_ do not bring the hip up too much and start with an already flexed hip. this is related to the first note. if you bring the knee to the side, it is going to be easier and safer for you to bring the hip down. the more you bring the hip up, you put a lot of pressure on your shoulder while it is your hip flexor muscles that are getting trained the most, not your chosen core muscles.
3_ slow it down. no matter how much you try, the hip flexors(mainly the iliopsoas) are going to be involved, especially since they initiate the exercise(there is minimum rectus abdominis and obliques activation in the beginning since there is no posterior pelvic tilt or spine flexion and spine rotation). by going slower, you limit momentum and emphasize the right core muscles, meanwhile the risk of spine, shoulder knee, and elbow injury is minimized.
4_ do not keep your arm fully straight. since we are talking about safety, make sure you keep your elbow slightly bent so you can absorb force going through your arm joints better. especially if you want to bring the knee to the opposing side which requires elbow flexion/extension.