Identifying the main controlling factors of tight gas productivity is essential for accurate forecasting and efficient reservoir development. However, the nonlinear and high-dimensional characteristics of tight gas reservoirs pose challenges for conventional analytical methods. This study proposes an improved Harris hawk optimization algorithm (TVLHHO), which integrates a nonlinear escape energy strategy and a time-varying leader structure, to enhance feature selection performance. The method expands the search space, accelerates convergence, and reduces the risk of local optima. Using a tight sandstone gas field as a case study, preliminary feature screening combined Pearson correlation and XGBoost, and TVLHHO was subsequently applied to identify the optimal controlling factors. Compared with six benchmark algorithms, TVLHHO achieved the fastest convergence and obtained a mean R² exceeding 0.9 in productivity prediction. The selected factors effectively distinguished high- and low-capacity wells, confirming the practicality and robustness of the proposed method. TVLHHO provides a reliable tool for analyzing main controlling factors under complex geological conditions, offering a solid foundation for productivity prediction and optimization in tight gas reservoirs.