When Lil Wayne entered Rikers Island on a gun-possession charge, in March of 2010, his career had already begun its descent. His prolific genius had seemingly been wrung dry, replaced by perplexing impulses to make rock music and shroud his voice in heavy Auto-Tune. When he was released from jail, eight months later, sober and on probation, he continued this dodgy streak, offering occasional flashes of vitality but never quite regaining the force of the breakneck mixtape era that culminated with “Tha Carter III.” The unravelling of Lil Wayne’s career made it tempting to pin on him theories about the nature of creative genius: Was he a prodigy who burned up his talent early? Could he only achieve brilliance while on drugs? Once he began to slide into fallen-hero status, he had little chance of reversing course.

But this year has offered a surprising rebuttal to those assumptions about the rapper: “Gone ’Til November,” a new collection of diary entries that Lil Wayne wrote, sober, during his imprisonment. The journal shows that Lil Wayne’s mind during this period was alive, in all of its oddball glory, even if his music didn’t reflect it. Aside from a handful of verses—on collaborations with Drake, 2 Chainz, and others—this book is the greatest thing he has put into the world since his rap career peaked, in the late two-thousands.

Wayne claims that he didn’t originally write his prison diary with an audience in mind. “I was just doing something to pass time in there,” he explains in an author’s note. “It became something to look forward to every night, which is very difficult to do when you’re locked up.” Perhaps because he considered the journal less a creative endeavor than an exercise in self-preservation, his entries are deeply mundane, chronicling his limited range of daily activities behind bars: wake-up times, phone calls and visits, the countless burritos made using tortilla wraps and chips from the prison commissary. He offers a daily barometer of his mood, which swings between elation, frustration, and despair, and records each night’s pre-bedtime rituals—some combination of listening to ESPN, saying prayers, doing pushups, writing letters, drinking tea—and signs off with “Another one.” He frequently laments the deep boredom of prison life. “This is the kind of shit that has become worth writing about: eating Oreos and drinking grape Kool-Aid. Damn!” he writes. Not exactly fodder for a juicy memoir.

And yet the dullness of this raw material only makes the energy of Lil Wayne’s prose, and the force of his personality on the page, all the more remarkable. He has always been able to look at the world slightly askance and emerge with a screwball observation, a cleverly roundabout jeer, or a loopy pop-culture reference. Removed from the distraction and stimulation of normal life, these talents are amplified, and Lil Wayne’s ability to amuse himself in the face of crushing tedium becomes transfixing. One night, the light in his cell begins to flicker, an effect he likens to being at the club. He starts to play music, and from there on he often references “going to the club” as a nightly activity. Some mornings he’s tired and chalks it up to his late night at the club. “Woke up and went crazy with the weights today,” he writes of one workout. “I got my 50 cent on. Well, I’m probably about 35 cent, but if I stand next to 50, we almost make a dollar.” At one point, Lil Wayne describes the TV shows that play in the common room. “ ‘Who Wants to Be a Millionaire’ was on TV,” he writes. “It made me think, who the fuck don’t want to be a millionaire?”

Like his densest verses, each of the hundred and fifty-nine pages of “Gone ’Til November” contains nuggets of delight, but the book is not always unserious. In one section, Lil Wayne writes that he feels close to suicide, and on another day he describes learning that his girlfriend slept with Drake years ago, and is so distressed that he can hardly leave his cell for several days. Lil Wayne also uses his journal to explore the challenges of navigating the line between celebrity treatment and normalcy in prison. At one point, he’s thrown into solitary confinement after being caught with an MP3 player, and the guards explain to him that giving him special privileges “would’ve been their ass.” But when he arrives in solitary confinement he finds that he’s treated more humanely there than he was in his regular cell. He writes of striving to establish friendly relationships with the other inmates on his floor and shows them generosity by offering them provisions from his outsized commissary. But “Gone ’Til November” is less about life at Rikers than about life inside of Lil Wayne’s head. In one passage that delightfully captures the antic twists and turns in his thinking, he ruminates on a letter he has received from a church, urging him to start rapping in God’s name:

If I was rapping for the Lord, I’d probably be the coldest nigga on the planet. I was looking at it like everything that I do already gets followed, so if I fucked around and did that, I would literally change the world. It would be way bigger than having a million motherfuckas walking around with tattoos every-damn-where with dreadlocks or saying shit like “bling-bling.” I would truly have the power of having pop culture turn to God. I would have straight killers in church every Sunday.

Man, I really got lost in those thoughts listening to Lauryn Hill and dozed off. That’s when God spoke to me in my sleep and told me to stop tripping. That’s not my calling . . . yet, that is, ’cause if it was, those types of thoughts would be popping in my head instead of “I will merk you,” “I will shine on you,” and “I’m going to fuck that bitch.” It was a cool thought though . . . but it was just a thought.

Even at the peak of his successes in music, Lil Wayne never displayed the gifts that most artists need in order to achieve icon status. He has never been much of a sonic innovator in the vein of Kanye West, nor has he ever developed a true signature sound. As prolific and beloved as he has always been, he has never had a knack for making pop hits the way his protégé Drake does. His output has always been unwieldy and somewhat rudderless. He has excelled in large part because his brain is simply the most fun to explore, his booming personality and harebrained swagger the most dazzling. His prison diary is, above all, a testament to the irrepressibility of his charisma—his is a force that can never go dormant, even when it’s not plainly on display.

Having long since finished his sentence, Lil Wayne these days is facing a different kind of imprisonment: a war with Birdman, his longtime mentor, label head, and de-facto father figure. The dispute has resulted in alleged drive-by shootings, lawsuits over royalties, fractured allegiances, and the eternal delay of Lil Wayne’s latest album, “Tha Carter V.” But this period has also produced some of the liveliest rapping Lil Wayne has produced since his pre-Rikers era, including a pair of piercing guest verses written for new albums by Chance the Rapper and Solange Knowles. “Hold up, I get too choked up when I think of old stuff,” he rapped on Chance’s “No Problem,” telling his fans that, even if he might be hung up on the past, he would charge forward nonetheless.