This is a pediatric phase I dose escalation study to determine a biologically active dose and to obtain information concerning the safety, tolerability, and pharmacokinetics of capravirine (AG 1549)(5-[(3,5-dichlorophenyl)thio]-4-(1-methylethyl)-1-(4-pyridinylmethyl)-1H-imidazol-2-meth anol carbamate), a potent non-nucleoside HIV-1 reverse transcriptase (RT) inhibitor, that induces a novel pattern of resistance mutations. In addition to obtaining needed biological activity, pediatric safety, tolerability, and pharmacokinetic data, the study will utilize capravirine's potent antiretroviral activity and novel resistance mutation pattern, together with serial measurements of plasma HIV viral load, flow cytometry, and genotypic and phenotypic viral resistance analysis to conduct pilot studies in pediatric HIV pathogenesis, the response to antiretroviral therapy, and to develop strategies to optimize the management of pediatric antiretroviral therapy. We will also use initial viral decay dynamics and other patient characteristics to model predictions for the long-term response to antiretroviral therapy. We will enroll children who have become refractory to or have experienced toxicity on prior therapy. The study will include resistance testing on the failing regimen, a one week period off antiretrovirals (washout period), an initial 6 days of capravirine monotherapy followed by capravirine in combination with the optimal antiretroviral therapy as determined by their baseline viral resistance mutation pattern and history. The patients will be followed for at least 48 weeks to assess long-term tolerability and toxicity, and to assess the clinical, virological, and immunological response to capravirine.