Glioblastoma multiforme (GBM) remains incurable despite aggressive implementation of multimodal treatments after surgical debulking. Almost all patients with GBM relapse within a narrow margin around the initial resected lesion due to postsurgery residual glioma stem cells (GSCs). Tracking and eradicating postsurgery residual GSCs is critical for preventing postoperative relapse of this devastating disease, yet effective strategies remain elusive. Here, we report a cavity-injectable nanoporter-hydrogel superstructure that creates GSC-specific chimeric antigen receptor (CAR) macrophages/microglia (MΦs) surrounding the cavity to prevent GBM relapse. Specifically, we demonstrate that the CAR gene-laden nanoporter in the hydrogel can introduce GSC-targeted CAR genes into MΦ nuclei after intracavity delivery to generate CAR-MΦs in mouse models of GBM. These CAR-MΦs were able to seek and engulf GSCs and clear residual GSCs by stimulating an adaptive antitumor immune response in the tumor microenvironment and prevented postoperative glioma relapse by inducing long-term antitumor immunity in mice. In an orthotopic patient-derived glioblastoma humanized mouse model, the combined treatment with nanoporter-hydrogel superstructure and CD47 antibody increased the frequency of positive immune responding cells and suppressed the negative immune regulating cells, conferring a robust tumoricidal immunity surrounding the postsurgical cavity and inhibiting postoperative glioblastoma relapse. Therefore, our work establishes a locoregional treatment strategy for priming cancer stem cell-specific tumoricidal immunity with broad application in patients suffering from recurrent malignancies.