Tumor microenvironment (TME)-responsive nanosystems represent a category of intelligent nanomaterials for precise anticancer drug delivery. Herein, we report a smart size-/morphology-switchable nanodrug that can respond to the acidic TME and near-infrared (NIR) laser irradiation for effective tumor ablation and tumor metastasis inhibition. The nanoagent is physically assembled by a cytolytic peptide, melittin (MEL), an NIR-absorbing molecule, cypate, and a tumor-targeting polymer, hyaluronic acid (HA). At pH 7.4, the as-formed MEL/Cypate@HA complexes are negatively charged nanospheres (∼50 nm), which are suitable for long-term systemic circulation. When these nanospheres actively target tumors, the weakly acidic TME triggers an in situ transformation of the nanospheres to net-like nanofibers. Compared with the nanospheres, the nanofibers not only exhibit an inhibitory effect on tumor cell mobility but also significantly prolong the retention time of MEL/Cypate@HA in tumor tissues for MEL-based chemotherapy. Moreover, the nanofibers can be photodegraded into small nanospheres (∼25 nm) by NIR laser irradiation during cypate-mediated photothermal therapy, which enables deep tumor penetration of the loaded MEL and thus achieves effective tumor eradication. This work provides a facile strategy for converting naturally occurring therapeutic peptides into a TME-responsive drug delivery system and may inspire the development of nanomaterials with changeable structures for therapeutic purposes.