Cyclic peptides are of particular interest due to their pharmacological properties, but their design for binding to a target protein is challenging. Here, the authors present a computational “anchor extension” methodology for de novo design of cyclic peptides that bind to the target protein with high affinity, and validate the approach by developing cyclic peptides that inhibit histone deacetylases 2 and 6.