Denny Hamlin has claimed the pole position for NASCAR's first Cup Series race at Chicagoland Speedway in seven years.