Andrea James pleaded guilty in 2009 to four criminal counts related to a mortgage fraud.

When the time came to argue about sentencing, her attorney asked the judge to consider the fact that James’s son was just 4 months old. But the prosecutors held the high cards, and they objected. “She made the decision to have this baby at the age of 44 when facing criminal charges and a likely prison sentence,” they wrote in a memo to the judge.

Under the default federal sentencing rules, family considerations are generally considered irrelevant. Ultimately, the judge ignored the prosecutors’ argument and did cite family as a reason for giving James a reduced sentence, in addition to her long record of community service. She still ended up with two years in prison, but that was less than half of the default term recommended under the federal guidelines.

“I still remember that being a deeply painful time for me, exacerbated by feeling less than valued as a mother and human being because the system seemed (to think) the only recourse was to incarcerate and separate me from my children,” recalled James, who said the pregnancy was unexpected.

Official federal sentencing guidelines don’t distinguish between female and male offenders. They often downplay or outright disregard circumstances that are common among women, such as the role of an offender as the sole caretaker for children or an offender having been coerced into committing a crime. But judges commonly compensate ad hoc, which has led to women on the whole receiving much shorter sentences than men when facing the same punishments.

Critics say the sentencing benchmarks should provide more flexibility from the start — a change that would benefit women like James but also men in similar circumstances, whose extenuating factors may be even more likely to be overlooked.

“The notion that you simply deal with a complicated situation by saying, ‘Let’s ignore the complexity,’ is idiotic,” said former federal judge Nancy Gertner, now a lecturer at Harvard Law School.

Congress established the U.S. Sentencing Commission in 1984 with the Sentencing Reform Act, partly in response to concerns that sentencing was marred by racial and geographic disparities. The commission was charged with writing the federal guidelines to remedy those problems, and it updates them occasionally.

But people of different races and genders still fare differently under the guidelines. Race looms large, according to a November 2017 report from the sentencing commission. It found that black men in federal court are sentenced to 19.1 percent more time, on average, than white men who, at least on paper, committed the same crimes and have similar criminal histories. Women receive much shorter sentences than even white men — though the difference also varies by race.

That disparity grows even larger when the full scope of discretionary decision-making is considered. Prosecutors exercise at least as much power as judges in sentencing because they decide what charges to bring after an arrest. A 2015 study from the University of Michigan Law School found that when such decisions are taken into account, sentences for men are on average 63 percent longer than sentences for women.

But women’s criminal involvement often looks different than men’s: They may be minor players in drug rings, are sometimes pushed into crime by a violent partner and often carry trauma from physical and sexual abuse.

“For the majority of women that land on a prison bunk, there’s a common thread to what makes that happen,” said James, now the executive director of the National Council for Incarcerated and Formerly Incarcerated Women and Girls.

More than 56 percent of the women in federal prison are there for drug offenses, compared with about 47 percent of men. In drug cases involving multiple people, each defendant can be held responsible for the full weight of the drugs involved, even if he or she were far down on the organizational chart. That approach is hard on women, who are often low-level players in such operations, experts said.

The guidelines do compensate by offering “role adjustments” for people who were merely drug mules, for example. But for many women, Gertner said, “those adjustments don’t begin to capture their insubstantial role.” So judges, who must consider the guidelines but since 2005 have not been compelled to follow them, may be responding with lower-than-recommended sentences.

Also largely excluded from the guidelines is any consideration of how a defendant got into crime in the first place. Yet research on incarcerated women shows that abusive relationships can put them on the wrong side of the law. Most women who assault their intimate partners have also been victimized by those partners, and they often cite self-defense as a motive. Researchers have also turned up many cases of incarcerated women who reported being forced into committing a crime by threats of violence.

A broader history of victimization is also common among female offenders. When researchers interviewed 125 women awaiting release from North Carolina prisons, they found that almost two-thirds had experienced childhood physical or sexual abuse and more than a quarter had been sexually victimized in the year before they went to prison. (Most studies do not draw explicit comparisons with men, but a survey of about 7,500 state prisoners conducted in 2005 found that while men and women had similar rates of childhood physical abuse, women had far higher rates of childhood sexual abuse.)

The sentencing guidelines set a high bar for considering such life experiences, and then only in cases involving nonviolent crimes. Judges are also discouraged from factoring in the role of drug addiction except in extraordinary circumstances.

The upshot is that the guidelines “disproportionately disadvantage anyone who has a significant trauma,” said Christine Freeman, who runs an Alabama organization that provides lawyers to poor clients charged with federal crimes. The exclusion of life experience may have been motivated by an effort to ensure that people of higher socioeconomic status could not work the system to their advantage, Freeman said. “But what it did was tell the courts that it was OK to ignore all these factors that obviously have motivated this situation and led a person to this point.”

Another wrinkle in the sentencing guidelines is that they do not distinguish between people who have committed only minor offenses and people who have never even had a brush with the law. Yet, according to Ohio State law professor Douglas Berman, who runs the Sentencing Law and Policy blog, “Those who have never gotten their nose dirty in the criminal justice system at all have a much lower recidivism rate.” A study of federal inmates who left prison in 2005 found that a quarter of those with no prior criminal justice contact reoffended, compared with more than a third of those who had some prior contact with the system. That’s a distinction judges might care about. Or they might be attentive to data indicating that among federal inmates, women overall have lower recidivism rates than men.

And the federal guidelines specifically discourage taking family considerations into account, declaring them “not ordinarily relevant” to sentencing. But they are certainly relevant to defendants like James who face separation from their children — and women appear to be particularly affected. Among federal prisoners in 2004, a higher share of men than women reported being the parents of minor children, but almost 80 percent of the mothers reported that they lived with their children just before incarceration, compared with half of the fathers.

Gertner said that judges might be particularly sensitive to the consideration that sending parents away is bad for public safety: “We know as a public-safety measure that (in) families that have been fractured by imprisonment, there’s actually a risk to the next generation.” Gertner and Berman said they believe judges are taking into account women’s family obligations despite the guidelines’ opposition to doing so — and that helps explain women’s shorter sentences.

There is, of course, a contrary argument about whether judges factoring in such circumstances are helpful. Legal scholar Dan Markel and his co-authors wrote in a 2009 book that family ties should be considered only with great caution to ensure equal treatment and to avoid continuing patriarchal norms or creating a “class of persons who are immune from incarceration” and therefore desirable hires for criminal outfits.

Whatever contributes to the sentencing difference, there are few voices arguing that the solution is longer sentences for women. Instead, as the University of Michigan study said, “Policymakers could equally sensibly ask: Why not treat men like women are treated?”

But that kind of change is unlikely under the Trump administration. The sentencing commission is now considering a revision to the way it measures criminal history for people with no records or only minor ones, but the Department of Justice has come out against the change.

Meanwhile, the president’s four nominees to the commission, announced earlier this month, include two who are well-known for advocating harsh punishment. One is U.S. District Judge Henry E. Hudson, who earned the nickname “Hang ’em High Henry” as a prosecutor in the 1980s. The other, former prosecutor Bill Otis, has argued against using social disadvantage as a mitigating factor.

In 2010, Otis wrote that advocates of a “phony and corrosive ‘compassion’” for criminals believe in a world where “there is little or no genuine free will or choice. There is only the overwhelming affliction of racism, militarism, childhood trauma, brain lesions and so on. So viewed, citizens are not responsible. The state is responsible. It is thus up to the state to put food on the dining room table and excuses on the courtroom table.”

But where Otis sees excuses, James sees individual stories that the guidelines spurn too easily.

“I don’t think they’re capturing reality,” she said.