Mayor Bill de Blasio and his new correction commissioner, Joseph Ponte, have inherited a city jail system in which nearly 40 percent of the 12,000 inmates have mental illnesses — up from about a quarter just seven years ago. Yet despite the stark shift, the system has not been redesigned to serve the complex needs of inmates with mental illnesses.

To remedy this shameful problem, the mayor and the commissioner need to focus on three areas: improving mental health care behind bars; ensuring that all mentally ill inmates are enrolled in Medicaid before they are released, so they have access to care and medication; and encouraging the growth of an important new program that steers mentally ill people who present no danger to the public into mental health programs instead of jail.

The full scope of this problem was outlined two years ago in a study of the city jails by the Council of State Governments Justice Center, a research and policy group. The study found that inmates with mental disabilities cost three times as much as other inmates, and that their numbers were growing, even as the city jail population as a whole was declining.

The study also found that mentally ill inmates stay in jail nearly twice as long — an average of 112 days compared with 61 days — partly because the mentally ill have less money to put toward bail and fewer connections to family or friends willing to get them out.