Press the tofu: Wrap the tofu in a clean towel and set a heavy pan on top for 10–15 minutes. This helps it crisp.
Pat dry.
Boil the pasta: Bring a large pot of salted water to a boil. Cook pasta until al dente. Reserve 1 cup of pasta water before draining.
Make the pesto: In a blender or food processor, add basil, optional spinach, nuts, garlic, lemon zest, 2 tablespoons lemon juice, nutritional yeast or Parmesan, a pinch of salt, and black pepper. Pulse to chop, then stream in olive oil until creamy but still textured.
Adjust salt, lemon, and oil to taste.
Cube and season tofu: Cut tofu into 1/2-inch cubes. Toss with salt, pepper, and a teaspoon of cornstarch if you want extra crisp edges.
Crisp the tofu: Heat a nonstick skillet over medium-high with 1–2 tablespoons olive oil. Add tofu in a single layer.
Cook 7–9 minutes, turning occasionally, until golden on most sides. Sprinkle with red pepper flakes if you like heat.
Optional tomatoes: Halve cherry tomatoes and toss them in the hot pan for 1–2 minutes just to blister. Remove from heat.
Toss it all together: Return drained pasta to the pot.
Add pesto and a splash of reserved pasta water. Toss until glossy and well coated, adding more water a little at a time to loosen. Fold in tofu (and tomatoes, if using).
Taste and finish: Add more lemon juice, salt, or pepper as needed.
Finish with a drizzle of olive oil and extra Parmesan or nutritional yeast.
Serve: Plate warm, with a sprinkle of nuts or fresh basil on top for texture and color.