The invention relates to systems and methods for optimizing a peritoneal dialysate prescription based on one or more fluid characteristics sensed from a filtrate removed from a patient. The systems and methods include sensors, flow paths, and processors to adjust a peritoneal dialysate prescription and deliver peritoneal dialysis therapy to a patient based on the adjusted prescription. The method can include the steps of removing fluid from a peritoneal cavity of a patient; sampling one or more characteristics of the removed fluid; and adjusting a peritoneal dialysate prescription based on the one or more characteristics of the removed fluid. The system can include a peritoneal dialysate effluent line; at least one concentrate source fluidly connectable to the peritoneal dialysate flow path; and at least one sensor positioned in the peritoneal dialysate effluent line.