move driving logic into SessionCodeTools to avoid blowing up command line