Prescribing (writing medication orders) is one of residents’ commonest tasks. Superficially, all that has to be done is complete a form. Behind this apparent simplicity, though, lies the complex task of framing patients’ needs and navigating relationships between them and fellow clinicians. Mistakes, which compromise patient safety, commonly result. There is no evidence that competence-based education is preventing harm. We found a profound contradiction between medical students becoming competent, as defined by passing competence assessments, and becoming capable of treating real patients safely. We reinstated patients as the object of learning by allowing students to ‘pre-prescribe’ (complete, but not authorise prescriptions). This turned a disabling tension into a driver of curriculum improvement. Students ‘knotworked’ within interprofessional teams to the benefit of patients as well as themselves. Refocusing undergraduate medical education on patient care showed promise as a way of improving patient safety.