Coding can become a precursor to writing a children’s book—at least, that’s the case for Karlie Kloss. The supermodel-turned-philanthropist who founded Kode with Klossy, a nonprofit that hosts free-of-charge coding camps for teens, has channeled her entrepreneurial skills in her first picture book. Spaghetti Code: A Story About Problem-Solving, Pasta, and the Power of Big Ideas (Roaring Book, July 28) is part of a five-book deal between Kloss and Macmillan, with each title focusing on coding and technology. A middle grade graphic novel will be published in 2028, with YA and middle grade titles to follow.

From Programming to Publishing

Kloss’s debut release, co-authored by Vicky Fang and illustrated by Remi Jose, stems from her decade running KWK, during which she observed young people embracing coding in a digital-centric world. “So often technology can feel intimidating before someone ever has the chance to explore it,” Kloss told PW. “I wanted to create a story that would replace that hesitation with curiosity and show young readers that technology doesn’t have to be so convoluted; it’s really about creativity, persistence, and problem-solving.”

While Kloss was initially intrigued by coding for its ability to drive innovation across myriad industries, she was unaware of its creative side. “You’re constantly experimenting, testing ideas, solving problems, and building something from nothing,” she said. “It’s both analytical and imaginative.”

The parallels between coding and writing, in fact, became more obvious to Kloss when she began working on Spaghetti Code. Both start with an idea that later involves revising and simplifying to create a fully fleshed-out product. “With a children’s book, especially, every word matters,” she said. “You’re constantly thinking about clarity, rhythm, pacing, and how each page builds on the last. That process felt surprisingly similar to coding, where you’re always refining until everything works together seamlessly.”

Introducing coding to younger readers has allowed Kloss to broaden her reach beyond KWK’s core audience. The story’s main character, Kelly Kent, who is tasked with creating a pasta-making machine that replicates a special recipe, is a composite of the students she has met over the years and the author herself. (“We’re both naturally curious, we’re determined problem-solvers, and we share a pretty serious appreciation for Italian food,” Kloss quipped.)

Also essential to Kelly’s personality is imperfection—a trait that Kloss sees not as a character flaw, but as a quality worth modeling for young readers. Asking questions, making mistakes, and trying again are part of her protagonist’s story arc, which she believes is relatable.

At the core of Spaghetti Code’s storyline is the concept of trial and error, which is played out via Kelly’s code writing—a process that Kloss likens to cooking. “Recipes evolve, ingredients behave differently than expected, and sometimes, the most memorable discoveries come from experimentation,” she said. “Both coding and cooking ask us to stay curious, embrace creativity, and trust the process.”

With additional coding and technology-themed titles in the pipeline, Kloss aims to leverage her KWK platform not only to promote her books, but to inspire the next generation of coders and storytellers. “One of the things I’ve learned through Kode with Klossy is that confidence often begins with exposure,” she said. “Sometimes, all it takes is one class, one mentor, or even one book to help a young person imagine themselves in a space they hadn’t considered before.”

Spaghetti Code: A Story About Problem-Solving, Pasta, and the Power of Big Ideas by Karlie Kloss, with Vicky Fang, illus. by Remi Jose. Roaring Brook, $19.99 July 28; ISBN 978-1-250-85288-5