Frederick and Kimberly Kagan, a husband-and-wife team of hawkish military analysts, put their jobs at influential Washington think tanks on hold for almost a year to work for Gen. David H. Petraeus when he was the top U.S. commander in Afghanistan. Provided desks, e-mail accounts and top-level security clearances in Kabul, they pored through classified intelligence reports, participated in senior-level strategy sessions and probed the assessments of field officers in order to advise Petraeus about how to fight the war differently.