Tear off two large sheets of heavy-duty aluminum foil, each about 12 inches long. Lay them flat on a clean surface.
Place one cod fillet in the center of each foil sheet. Season both sides with salt and pepper.
Top each fillet with half the minced garlic, a few lemon slices, and half the butter pieces. Sprinkle with dried dill or parsley.
Fold the foil over the fish to create a packet. Crimp the edges tightly to seal, leaving a little space inside for steam to circulate.
Preheat a camp stove to medium heat. Place the foil packets directly on the grate. Cook for 12-15 minutes, depending on fillet thickness. The fish should flake easily with a fork.
Carefully open the packets away from your face to avoid steam burns. Serve immediately directly from the foil or transfer to a plate.