Cut the fish into bite-size chunks and set aside.
Heat the oil in a 2- to 3-quart saucepan over medium heat until a bit of curry paste just sizzles when added to the pan. Add all the curry paste and cook, pressing and stirring with a wooden spoon or heatproof spatula, to soften the paste and mix it in with the oil, until fragrant, 1 to 2 minutes. Add the coconut milk and broth and bring to a simmer. Add the green beans and half the lime leaves (if using) and stir well.Gently simmer, stirring occasionally, until the green beans are almost tender, about 4 minutes. Add the cod, stir, and cook until the fish is just about done, about 2 minutes. Add the fish sauce and sugar and stir to combine. Remove from the heat.
Tear the basil leaves in half (or quarters if they are large), and stir them into the curry, along with the remaining lime leaves (if using). Let rest for 5 minutes to allow the flavors to develop. Serve hot or warm with rice or noodles, garnished with the chile slices (if using).
Photo: Scott Phillips