Sen. Eric Brakey, R-Auburn, has identified the right problem, but he’s come up with the wrong solution. His bill to eliminate the cash bail system calls attention to expensive problems in the criminal justice system, but it would not stop the revolving door of repeat offenders who are the real management burden in the state’s lockups.

Brakey rightly points out that a large number of inmates in the state’s county jails are “pretrial,” or people who have not been convicted of a crime and are waiting for their day in court. Brakey’s proposed solution is to eliminate the cash bail system and replace it with a risk assessment model that would release nonviolent offenders who are unlikely to re-offend, regardless of whether they can come up with the cash to post a bond.

While that’s a good goal, it’s more or less what is being done already. In Maine, bail commissioners and judges set bail based on what is needed to make sure that the defendant shows up in court when he is supposed to and gives extra incentive to be law-abiding when he is out in the community. Quite often, bail is set at nothing, and the accused is released on his personal recognizance.

Higher bails are set for people who are deemed a flight risk, who have violated bail conditions in the past or who pose a particular threat to the community.

Most of the pressure on jail budgets is not from nonviolent first-time offenders who can’t afford bail, but from defendants who are constantly signaling that they can’t be trusted. Reducing the number of repeat offenders is where the Legislature should put its focus.

The cycle can start when a first-time offender is out on bail. In addition to the bond, there are often conditions to meet, such as random testing for drug use, or no contact with a victim. The defendant can be thrown back in jail for violating the conditions, even though the original charges still haven’t been proven.

After a trial or a guilty plea, an offender will usually spend part of his sentence in the community on probation. Department of Corrections statistics show that 46 percent of probationers were arrested, either for a technical violation or for committing a new crime within a year of their release. In three years, the number was 56 percent. These are often the inmates who face a high bail when they are awaiting trial on new charges because their record of violating conditions makes them a high risk to re-offend.

National studies indicate that recidivism remains a problem, even as crime rates fall. A study of New York City inmates between 2008 and 2013 found that there were 473 people who were jailed 18 times or more. They accounted for 300,000 days in jail. And 99.4 percent of them had a substance abuse disorder.

It would seem that drug use is more likely to be what’s filling our jails than excessive cash bail. Programs that work with people after release, during incarceration and especially before they are ever arrested would do more to lower the head count in Maine’s jails than any reform of the bail code.