After refitting at Guam between 29 May and 26 June 1945, "Cod" put out for the Gulf of Siam and the coast of Indo-China on her seventh war patrol under the command of Lieutenant commander Edwin M. Westbrook, Jr. On 9 and 10 July she went to the rescue of a grounded Dutch submarine, "O-19", taking its crew on board and destroying the Dutch boat when it could not be gotten off the reef. This was the only international submarine-to-submarine rescue in history. After returning the Dutch sailors to Subic Bay, between 21 July and 1 August "Cod" made 20 gunfire attacks on the junks, motor sampans, and barges which were all that remained to supply the Japanese at Singapore. After inspecting each contact to rescue friendly natives, "Cod" sank it by gunfire, sending to the bottom a total of 23. On 1 August, an enemy plane strafed "Cod", forcing her to dive, leaving one of her boarding parties behind. The men were rescued two days later by .