Although my comments on the 4th Section of the General Staffs work haven't exactly sparked massive interest, I feel that I should discuss their most catastrophic failure. This was their helpful advice for the Japanese Foreign Ministry on codes. During the Thirties two cipher machines were designed by the IJN and then used for Japanese diplomatic codes. These were the Type 91 Alphabetic Typewriter, which was called Red by the Americans, and the Type 97 Alphabetic Typewriter, which the Americans called Purple.
There is a description of Red at
Development of the First Japanese Cipher Machine: RED, which concludes "Now, the RED cipher machine is remembered as a classic example of a weak machine cipher broken by codebreakers. There is even a view that the weak RED cipher provided a tutoring period for codebreakers to prepare themselves for more complicated ones such as PURPLE."
The mechanics of the related machines called Purple, Coral and Jade are described at
PURPLE, CORAL, and JADE. Whilst Purple was certainly stronger than Red, it was still not a strong cipher and it had fewer possible permutations than contemporary rotor machines as it was not possible to carry out an operation equivalent to swapping the rotors. However, the real errors that doomed Purple's security were the totally unnecessary choice of keeping the division of the alphabet into groups of twenty and six as with Red and the sending of the same messages using both the broken Red machine and the new Purple machine during the period when Purple was replacing Red.
Naturally it is very easy to suggest with hindsight how to do much better. For example, either the American ECM II
The ECM Mark II, also known as SIGABA, M-134-C, and CSP-889 or the later Russian Fialka
http://www.xat.nl/fialka/files/man001.pdf would have kept Japanese diplomatic messages completely secure up to 1945. However, a more realist question is whether there were options that Japan might have plausibly taken. One possibility might have been to buy an early Enigma A or B
The Enigma A and Enigma B and make the rotor motion less predictable by making the cams adjustable.
Unlike most of the improvements suggested in this thread, keeping Japanese diplomatic codes secure might have very significantly altered history. There are possibly three mechanisms which all might have made a Pacific War less likely.
Firstly, as mentioned earlier, secure Japanese codes might have caused America to take Japan more seriously as a potential adversary, which might have made American policy more cautious over 1941.
Secondly and much more obviously, America would have listened more carefully to the Japanese Ambassador Nomura. Nomura, as a retired full admiral felt that he was in Washington to represent the IJN and to make policy and he was determined to avoid a war (see Peter Mauch's Sailor Diplomat
http://www.h-net.org/reviews/showrev.php?id=34971). Unfortunately, when he diverged from his instructions from the Foreign Ministry, the Americans reading the often poorly translated instructions, believed that he was trying to deceive them. "Misunderstanding and Mistranslation in the Origins of the Pacific War of 1941-1945: The Importance of "Magic" by Keiichiro Komatsu
http://theburmacampaignsociety.org/library/Lecture-by-Dr-Keiichiro-Komatsu-24-March-2002.pdf goes into more detail on the malign effects of poor translations.
Finally and most importantly, American leaders would have had to ask Ambassador Grew's opinion rather more often as he would be left as their best source on what Japan was likely to do. OTL, Grew's views were assumed to be wrong because he was naturally not informed of the results of code breaking and he was mostly ignored. Here is an extract from "My Year with Ambassador Joseph C. Grew 1941-1942 — A Personal Account" by Robert A. Fearey
www.connectedcommunities.net/robertfearey/year_with_grew.doc :
"Fully set out in those volumes are the arguments supporting Washington's handling of the negotiations, on the one hand, and on the other, Ambassador Grew's firmly held views that Washington's stance was unimaginative and inflexible; that the Embassy's carefully considered reports, analyses and recommendations, centering on Prime Minister Konoye's proposal that he and President Roosevelt meet face-to-face in Honolulu in a direct effort to achieve a settlement of all outstanding issues, were given short shrift; and that if the meeting had been allowed to take place the Pacific War might have been avoided."