Claire DeWitt, the high-stepping, coke-snorting, Zen-loving heroine of Sara Gran’s new novel, “Claire DeWitt and the Bohemian Highway,” is something of a mess, but she’s also the most interesting private eye I’ve encountered since Stieg Larsson’s Lisbeth Salander. Claire’s investigative methods are haphazard at best, but through her — seen both as a teenager in Brooklyn and as a woman in her late 30s in today’s San Francisco — the author offers a gritty, ultra-realistic portrait of how one rebellious American woman has lived her life.

Here’s what happens in the novel’s first 10 pages: Claire goes to a bar to hear a band and makes eyes with a talented guitarist named Paul. When she returns to the bar two weeks later, they meet. Already, she’s thinking he’s cute, the kind of fellow whom “maybe I would sleep with.” But she also feels “a wave of dread . . . like we were being pulled into a black undertow we couldn’t fight our way out of.”

Soon they’re a couple, but then, she says, “I went to Peru for a week on the Case of the Silver Pearl and stayed for another six weeks studying coca leaves with a man I met in a bar in Lima.” Ah, yes, those coca leaves can lead a girl astray. When she returns to San Francisco, Paul has hooked up with a fellow musician, the gorgeous Lydia. Claire grumbles, “Watching people fall in love is like watching two trains rush toward each other at top speed, with no way to stop them.” Paul marries Lydia. Then he is shot to death one night at home. Some people think Lydia killed him, but the police find no evidence of that. Claire vows to uncover the truth.

At this point, if you’re expecting a logical, linear tale of crime and detection, you’re out of luck. Claire’s life takes many detours. One is spontaneous sex. After Paul’s funeral, she goes home with another mourner, explaining, “Everyone wants to have sex after a funeral.” Later, she’s kicked out of a Buddhist retreat for seducing a “young monk-in-training in the toolshed”; another casual encounter is with a waitress she fancies — but whom the next morning she hopes never to see again.

Drugs are another diversion. “I excused myself and went to the bathroom and did two fat lines of cocaine off the top of the toilet,” Claire reports at one point, and there must be 20 variations of this in the novel. And be warned that if Claire enters your bathroom, she’ll search your medicine cabinet and pocket any drugs she might find useful.

The solution to Paul’s murder is further delayed by a series of flashbacks to Claire’s teenage years in Brooklyn, when she and her girlfriends dreamed of being detectives — at least when they weren’t pursuing the more conventional pleasures of boys, booze and punk rock. One of their friends goes missing, and they finally find her in very sordid circumstances in an S&M bar. In the present-day part of the book, 20 years later, we learn what finally happened to this seemingly lost soul.

Months pass as Claire slowly makes headway in seeking Paul’s killer. She mostly follows her intuition, along with the precepts laid down by the great (and fictional) French detective Jacques Silette, who said things like, “Solutions wait for you, trembling, pulling you to them, calling your name, even if you cannot hear.”

Along with her formal plots — the missing friend in the past, the murdered lover in the present — Gran presents an unflinching, heartfelt portrait of the way many women of her generation have lived their lives: speeding down the fast lane. Claire gives this bittersweet summation of her early years: “Sometimes it seemed like every teenager in New York was separated by only two or three degrees. Like it was a secret world you gained admittance to at fourteen and left at twenty, swearing never to repeat what you’d seen. No one would believe us, anyway.”

Late in the novel, after Claire almost overdoses, she admits that “something ugly was growing in me. I watched it grow. I fed it cocaine.” Still, there’s no indication that she will change. This is Gran’s second Claire DeWitt novel. It’s a fascinating read, and it will be interesting to see what becomes of her unconventional, all-too-human private eye.

Anderson regularly reviews mysteries and thrillers for Book World.

Claire dewitt and the bohemian highway

By Sara Gran

Houghton Mifflin Harcourt. 280 pp. $20