This study investigated the effects of crayfish shell powder (CSP) and bamboo-derived biochar (BDB) on nitrogen metabolism, bacterial community and nitrogen functional genes during pig manure composting. Four treatments were established: CP (with no additives), TP1 (5 % BDB), TP2 (5 % CSP) and TP3 (2.5 % BDB + 2.5 % CSP). Compared to CP, the germination index (GI) of TP reached > 85 % 10 days earlier. Meanwhile, TP3 reduced NH3 and N2O emissions by 42.90 % and 65.9 %, respectively, while increased TN (total nitrogen) concentration by 5.43 g/kg. Furthermore, additives changed the bacterial structure and formed a beneficial symbiotic relationship with essential N-preserving bacteria, thereby enhancing nitrogen retention throughout the composting process. Metagenomic analysis revealed that additives upregulated nitrification genes and downregulated denitrification and nitrate reduction genes, ultimately improving nitrogen cycling and mitigating NH3 and N2O emissions. In conclusion, the results confirmed that TP3 was the most effective treatment in reducing nitrogen loss.