Heat a grill to medium-high heat (365 degrees F).
Tear off several large squares of aluminum foil. There should be one for every cod fillet. Set the cod on the foil and sprinkle with salt and pepper.
Combine the melted butter, diced shallot, and minced garlic in a small bowl. Brush the mixture across the fillets.
Place several lemon slices across the top of each fillet.
Close the foil packets around the fish, crimping the foil so it creates a closed packet.
Reduce the grill heat to medium. Place the foil packets on the grill (not directly on top of a flame, indirect heat works best) and grill for 8 to 10 minutes or until the fish flakes apart. Fish should reach an internal temperature of 145 degrees F on an instant-read thermometer.
Remove the packets from the grill and place the cod on plates. Top with additional fresh herbs if desired and serve immediately.