Having nominated Jacob Lew to move next door to the Treasury Department, President Obama for the fifth time must choose the aide who will be the Oval Office gatekeeper for every problem and person, domestic and foreign, that comes before the president, and who is often the last to speak to Obama before he makes a decision.

For some weeks, associates say, Obama has been considering between Denis McDonough, the deputy national security adviser in the White House, and Ronald Klain, former chief of staff to Vice President Joe Biden and Al Gore.

The president's hesitation about choosing McDonough, 43, a Minnesota native, is his lack of domestic policy experience at a time when issues of the federal budget, immigration and gun violence are second-term priorities. But since the 2008 campaign, McDonough has been perhaps Obama's closest confidant on national security and foreign policy, enjoying access and trust beyond his position.

Klain, 51, is now an adviser to the AOL co-founder Steve Case, but much of his career has been as a counsel to congressional Democrats. Known as an aggressive and organized lawyer, he helped both John F. Kerry in 2004 and then Obama last fall with preparations for their presidential debates.

NEW YORK TIMES