Inclusion
PRE-REGISTRATION: Age \>= 18 years
PRE-REGISTRATION: Disease characteristics
Histological confirmation of adenocarcinoma of the stomach or gastroesophageal junction (GEJ)
Currently receiving first-line therapy with leucovorin calcium, fluorouracil, and oxaliplatin (FOLFOX) and nivolumab without evidence of disease progression OR planning to start first-line therapy with FOLFOX and nivolumab
PRE-REGISTRATION: No radiographic or histological evidence of non-peritoneal metastasis
PRE-REGISTRATION: Eastern Cooperative Oncology Group (ECOG) performance status (PS) 0, 1 or 2
PRE-REGISTRATION: Willingness to provide mandatory blood specimens for correlative research
PRE-REGISTRATION: Willingness to provide mandatory tissue specimens for correlative research
PRE-REGISTRATION: Willing to return to enrolling institution for follow-up (during the Active Monitoring Phase of the study)
REGISTRATION: Peritoneal Carcinomatosis Index (PCI) \>= 1 and =\< 24 obtained =\< 30 days prior to registration
REGISTRATION: Clinical, pathological, or radiographic evidence of peritoneal metastasis per PCI and Peritoneal Regression Grading Score (PRGS)
REGISTRATION: Hemoglobin \>= 8.0 g/dL (obtained =\< 30 days prior to registration)
REGISTRATION: Absolute neutrophil count (ANC) \>= 1000/mm\^3 (obtained =\< 30 days prior to registration)
REGISTRATION: Platelet count \>= 75,000/mm\^3 (obtained =\< 30 days prior to registration)
REGISTRATION: Total bilirubin =\< 1.5 x upper limit of normal (ULN) (obtained =\< 30 days prior to registration)
REGISTRATION: Alanine aminotransferase (ALT) AND aspartate transaminase (AST) =\< 1.5 x ULN (obtained =\< 30 days prior to registration)
REGISTRATION: Prothrombin time (PT)/international normalized ratio (INR) =\< 1.5 x ULN OR if patient is receiving anticoagulant therapy, then PT/INR is within target range of therapy (obtained =\< 30 days prior to registration)
REGISTRATION: Calculated creatinine clearance \>= 40 ml/min using the Cockcroft-Gault formula (obtained =\< 30 days prior to registration)
REGISTRATION: Negative pregnancy test done =\< 8 days prior to registration, for persons of childbearing potential only
REGISTRATION: Provide written informed consent
REGISTRATION: Willingness to provide mandatory blood specimens for correlative research
REGISTRATION: Willingness to provide mandatory tissue specimens for correlative research
REGISTRATION: Willing to return to enrolling institution for follow-up (during the Active Monitoring Phase of the study)
Exclusion
PRE-REGISTRATION: Any of the following because this study involves an agent that has known genotoxic, mutagenic, and teratogenic effects:
Pregnant persons
Nursing persons
Persons of childbearing potential and persons able to father a child who are unwilling to employ adequate contraception
PRE-REGISTRATION: Any of the following prior therapies: IL-2 or chronic corticosteroids, or immunosuppressive agents
NOTE: Inhaled corticosteroids are allowed
PRE-REGISTRATION: Co-morbid systemic illnesses or other severe concurrent disease which, in the judgment of the investigator, would make the patient inappropriate for entry into this study or interfere significantly with the proper assessment of safety and toxicity of the prescribed regimens
PRE-REGISTRATION: Immunocompromised patients and patients known to be human immunodeficiency virus (HIV) positive and currently receiving antiretroviral therapy
PRE-REGISTRATION: Uncontrolled intercurrent illness including, but not limited to:
Ongoing or active infection
Symptomatic congestive heart failure
Unstable angina pectoris
Cardiac arrhythmia
Or psychiatric illness/social situations that would limit compliance with study requirements
Autoimmune disease
PRE-REGISTRATION: Receiving any other investigational agent which would be considered as a treatment for the primary neoplasm
PRE-REGISTRATION: Active second malignancy currently receiving systemic treatment =\< 6 months prior to pre-registration
PRE-REGISTRATION: History of myocardial infarction =\< 6 months prior to pre-registration, or congestive heart failure requiring use of ongoing maintenance therapy for life-threatening ventricular arrhythmias
REGISTRATION: Identification of non-peritoneal metastasis during laparoscopy
REGISTRATION: Any of the following because this study involves an agent that has known genotoxic, mutagenic, and teratogenic effects:
Pregnant persons
Nursing persons
Persons of childbearing potential and persons able to father a child who are unwilling to employ adequate contraception
REGISTRATION: Any of the following therapies: prior immune checkpoint inhibitors, prior IL-2, or chronic corticosteroids or immunosuppressive agents
NOTE: Inhaled corticosteroids are allowed. One-time antiemetic dose is allowed
REGISTRATION: Co-morbid systemic illnesses or other severe concurrent disease which, in the judgment of the investigator, would make the patient inappropriate for entry into this study or interfere significantly with the proper assessment of safety and toxicity of the prescribed regimens
REGISTRATION: Immunocompromised patients and patients known to be HIV positive and currently receiving antiretroviral therapy
REGISTRATION: Uncontrolled intercurrent illness including, but not limited to:
Ongoing or active infection
Symptomatic congestive heart failure
Unstable angina pectoris
Cardiac arrhythmia
Or psychiatric illness/social situations (e.g., substance abuse) that would limit compliance with study requirements
Autoimmune disease requiring systemic treatment
Small bowel obstruction
REGISTRATION: Receiving any other investigational agent which would be considered as a treatment for the primary neoplasm
REGISTRATION: History of myocardial infarction =\< 6 months prior to registration, or congestive heart failure requiring use of ongoing maintenance therapy for life-threatening ventricular arrhythmias
REGISTRATION: Small bowel obstruction \< 15 days prior to registration