Date: 201906
Local time of day: 1801-2400
Location: ZZZ.TRACON, US
Flight conditions: Mixed
Light: Daylight
Aircraft: B737-700
Operator: Air Carrier
Operating under: Part 121
Flight plan: IFR
Mission: Passenger
Flight phase: Climb; Descent; Initial Climb
Airspace: Class B ZZZ
ATC / advisory: TRACON ZZZ
Reporter organization: Air Carrier
Reporter function: Captain; Pilot Flying
Reporter qualification: Flight Crew Instrument; Flight Crew Multiengine; Flight Crew Air Transport Pilot (ATP)
Human factors: Troubleshooting
Second reporter function: Pilot Not Flying; First Officer
Anomaly: Aircraft Equipment Problem Less Severe; Flight Deck / Cabin / Aircraft Event Smoke / Fire / Fumes / Odor
Detector: Person Flight Attendant; Person Flight Crew
When detected: In-flight
Result: Air Traffic Control Provided Assistance; Flight Crew Diverted; Flight Crew Landed As Precaution; General Maintenance Action
Contributing factors: Aircraft; Human Factors
Primary problem: Aircraft

Narrative: On initial climbout; we experienced an odor in the cockpit. There was no smoke; but a 'musty' smell; similar to engine exhaust; but with a 'dirty sock' odor to it as well. It wasn't overpowering or extreme; but just enough to be very noticeable. At about 8;000 feet MSL; the FAs notified us they were getting the smell in the cabin as well; and that it was somewhat stronger in the back of the aircraft. We leveled off at 10;000 feet MSL and began to investigate.During the investigation; the smell quickly dissipated. There were no abnormal engine or pack indications; nor could the Flight Attendants find anything that might be the cause. As a Crew; we decided to continue since the smell was gone. However; after a few minutes during the subsequent climb; the smell returned; so we leveled off at FL 260. Again; once the power was back (below around 87% N1) the smell quickly dissipated; though it seemed to dissipate more slowly in the cabin this time. I also got a sense the FAs were getting a little concerned. My suspicion was that the smell came only when the N1s were advanced to the climbout or at a high setting. If this was the case; any further climb would only make it happen again; and continuing to ZZZ at FL 260 wasn't possible given the route of flight we had for weather avoidance between us and ZZZ.At that point; as a precaution; the FO and I ran the Smoke; Fire or Fumes QRC; which led us to run the Smoke; Fire or Fumes Checklist in the QRH. Since there was never any smoke; nor were there any more fumes (as the odor we smelled was always temporary and dissipated quickly after level off) the decision was made to not don the oxygen masks. The FO and I agreed; however; we'd have to divert. The only question was to where. We were heavyweight and therefore too heavy to land anywhere close. Because there was never any smoke; and the only time we experienced the temporary smell was during the climb and not at level flight; and because the smell was; at that time; completely gone; we didn't believe we were in a 'land at the nearest suitable airfield' situation. The situation we had just didn't dictate that kind of urgency. Therefore; my intention was to continue while we figured out where best to divert into; hopefully at a Maintenance base; but somewhere with a longer runway due to our fuel state. With the decision made to divert; I notified the FAs of our intentions; and initiated contact with Dispatch via phone-patch on COMM 2 to get their input on where best to divert while the FO began running the landing data at several different possible locations. I believe COMMS with Dispatch were; perhaps; initially disjointed as I tried to convey we were grossly overweight to land anywhere close; plus we'd need a longer runway; but it was initially mentioned we should divert to ZZZ1. The landing data showed us to be 9;400 pounds overweight to land there. I again conveyed we were too heavy for ZZZ1 and asked about anything further west. ZZZ2 was then mentioned; so we ran those numbers and saw we would be 6;600 pounds overweight. At this point we began to be queried by Dispatch if we'd run the QRH; and that perhaps it was directing us to land at the nearest suitable airfield. ZZZ3 was then suggested by Dispatch because they had maintenance there as well. The FO ran the landing data for ZZZ3 and it showed us to be 4;500 pounds overweight. Voice communications with Dispatch became difficult due to our distance from any station; so I sent an ACARS message stating we'd be overweight upon landing in ZZZ3. I honestly felt somewhat 'led' to land there; even with the understanding we'd most likely be landing overweight. Of note; for the same reasons mentioned above on why we didn't don the oxygen masks; we also agreed it wasn't necessary to [identify as] a priority handling to ARTCC.Once we were headed in the direction of ZZZ3; the landing data computed; and all the normal and QRH Checklists completed; I made a Public Address to the passengers explaining where we were diverting to and why. The FO and I agreed that if we descended to a lower altitude (something definitely below 10;000 feet) and dirtied-up the aircraft; we could greatly improve our weight situation. The descent and subsequent level flight was uneventful until approximately 40 miles from ZZZ3; level at 5;000 feet MSL; 210 knots; and the N1s at about 83%; we once again got the smell in both the cockpit and cabin temporarily. It lasted for only a matter of seconds and then was gone. We were able to get just under max landing weight upon landing into ZZZ3. The landing and taxi in was uneventful; however; just as we shut down the engines at the gate; the smell again came back into the cabin and cockpit.Preventative Measures: In performing the Fumes Checklist; we accomplished each step verbatim except for donning the oxygen masks because the fumes had dissipated before we even ran the checklist. We knew this decision might be questioned; but given our situation at that time; we didn't believe it was necessary. We used our best judgment and didn't believe donning the oxygen masks was necessary at that time. I understand the argument fully that if at any time the QRC is run; it might be the best policy to [identify as] a priority handling; just in case. But again; knowing we were gonna be droning at a low altitude and slow airspeed to burn off fuel; and with no real emergency; in my judgment; it just didn't make sense to declare one.


Second narrative: Preventative Measures: I'm not sure there was anything the crew could have done to prevent the unusual fumes/odor from occurring. Although not in line with the QRC/QRH procedure; use of the crew oxygen masks during this event would have immeasurably complicated crew communications and made a relatively benign situation far more complex.


Synopsis: B737-700 flight crew reported a 'dirty sock' smell in cockpit and cabin; they made a diversion as a result of odor/fumes.