Adjust rack to middle position and preheat oven to 275°F. Thinly slice 4 lemon rounds, leaving the remainder for garnish.
Place the potatoes in a medium pot and cover with heavily salted water by 2 inches. Place over medium-high heat and bring to a boil. Then reduce heat to medium-low and cook until tender but not too soft or falling apart, 10 minutes. Drain and set aside.
Meanwhile, sprinkle the cod generously with Kosher salt, covering all sides. Let sit for 10 minutes.
Lay the lemon slices on the bottom of a large, oven-safe pan or baking dish (should be at least 2 inches deep). Place the salted cod, cooked potatoes, smashed garlic cloves, grape tomato vines, and thyme on top of the lemons. Pour olive oil over the fish so it is completely submerged. Sprinkle red pepper flakes over the oil.
Cover pan tightly with a lid (If using a baking dish, cover with tinfoil). Place into the oven and cook for about 30-32 minutes, until the fish flakes easily with a fork. Using a slotted spatula, remove fish, potatoes, and tomatoes from the oil and transfer to a plate. Sprinkle with flaky sea salt and freshly ground black pepper, to taste Serve with fresh lemon on the side, for squeezing over the fish.