This phase I/II trial studies the side effects and best dose of mitoxantrone hydrochloride when given together with filgrastim, cladribine, and cytarabine and to see how well they work in treating patients with acute myeloid leukemia or high-risk myelodysplastic syndromes that is newly diagnosed, has returned, or does not respond to treatment. Drugs used in chemotherapy, such as filgrastim, cladribine, cytarabine, and mitoxantrone hydrochloride, work in different ways to stop the growth of cancer cells, either by killing the cells, by stopping them from dividing, or by stopping them from spreading.