What I Learned Making 34 Novels with Claude Sonnet

What started out as a kind of self-care and an exploration of what Claude Sonnet could do, I have worked out a simple and direct way to create science fiction and fantasy novels using Claude Sonnet and other tools like Nano Banana, Cline, and Claude Code.

For many years I have had a backlog of story ideas – half baked thoughts about some set of characters, or a unique situation I wanted to see played out in a short novel. The past year has been a rough one for many people, including myself, and I wanted to see if I could combine two aspects of my interests: AI ( coding ) and Writing.

I have been creating web projects way before the phrase “Vibe Coding” was a thing and I have picked up a few techniques that have helped me with creating web projects. I wondered if I could coax Claude Sonnet to write a full length novel based on my story ideas, so I set out and approached it like I would a website coding project.

I could go into all the false starts and problems I ran into while trying to build a novel via AI, but I thought it would be best to share my current process and touch upon a few findings.

The process

  1. Decide on a genre – I usually picked Cozy Fantasy, or Funny Fantasy.

  2. Ask the AI to search for the primary aspects of that genre and save into research.md

  3. Brainstorm ideas for a high level plot – collaborate with AI to create a list. Pick something fun and compelling

  4. Flesh out the story plot and store in plot.md

  5. Ask the AI to create supporting documents based on the research.md and plot.md —> emotional-arc.md, sensory-details.md, magic-system.md, character-profiles, world-history.md, and writing-style.md. Review these to make sure they fit your vision of your novel.

  6. Based on all the documents created above, ask the AI to create a comprehensive chapter-by-chapter.md which has checkboxes when each chapter is complete, includes the word count and story beats, and is at least 30 chapters long. ( This last aspect is important because the AI will try to create as short a story as possible and acts “lazy” if you let it )

  7. Create a loop.md workflow. This workflow tells the AI to read all the documents above, determine the next chapter to write in the chapter-by-chapter.md , write that chapter, then update the chapter-by-chapter.md – taking also into consideration the previous chapter if it exists. ( This is also a critical aspect – if you just have the AI write the next chapter it will often place characters in random locations, or a character that died in the previous chapter miraculously comes back to life )

  8. Run this workflow over and over in a “clean context” window for every chapter. Do not try to create many chapters at once. The AI gets more and more dense the longer it goes in one session and the novel will suffer for it. The loop.md gives enough context and reading the previous chapter helps it understand just what to do. I tried having it write the whole novel in one session and it was not great.

  9. When you have gotten to the last chapter the real work begins. I would recommend at this point backing up the files you have created to say github. You will be making some changes to the files that may be destructive and you don’t want to lose the work you already started. Create a prompt that tells the AI it is a talented and relentless novel editor, and you want it to read over the whole novel and call out any inconsistencies, plot holes, timeline issues, etc. And store that in an evaluation.md file.

  10. In a new context, ask the AI to review the evaluation.md file and come up with a plan to fix all the issues. I used to skip this part early on and the novel ended up with odd things like characters who’s names would change, or strange plot holes that just went nowhere. This is an essential step to make your novel take a half-step out of the uncanny valley. Tell it to carry out the fix it plan with as minimal changes to the story as possible. You don’t want it to rewrite the whole thing just for one small issue.

  11. You’re done! Almost!

Beyond the Writing

What happens now? You have a bunch of markdown files and some background documents. Not yet much of a book is it? This is the point where you can rely on the AI to help you get the book in shape, as well as create a nice website for your book so you can distribute it.

Give it some Character

As soon as I finish the content of the novel I want to see the characters and book cover for this work. It really helps make the book come alive and gives something for folks to understand more about your novel. I prompt the AI to read the character backgrounds and the plot documents and create comprehensive image prompts for all the main characters. I then feed those prompts into a site like fal.ai which has a ton of models you can choose from to generate amazing imagery. I will have it create the book cover and the main characters. The point of this will be to enhance the book website you will want to create.

Build the Book

Once you have the cover, you will want to create the artifacts to distribute your novel. As a prerequisite for this step, you should set up Pandoc on your local machine. Pandoc is an amazing piece of software that can convert documents from one form to another. What we want it to do is take the markdown files and convert them to HTML, ePub, and PDF. I won’t go into details about how to get that set up, but for the context of this article, I just prompted the AI to create a build.bat file in Windows to take the documents and convert them to HTML, PDF, and ePub in an output folder using Pandoc. The AI got this down in one shot every time. Often before this step I would ask the AI to create a metadata.yml file which contains the book title, author, and summary and have it use that file in the build.bat. Once this is done, run the batch file and see if it outputs the documents as you expect. For me sometimes the AI will add notes or metadata in each chapter like word count or completed state, you’ll have to run some script to strip that out. The AI can create a batch file to fix those things. Run the build script once again to get a completed novel and save this or commit to git.

Make a Site

Ok, now we have a novel, some book artifacts, some images, but how do you share this? The next step in our plan is to have the AI create a book site for you. I usually write a prompt to ask the AI to consider all the background documents and the image prompts and create a book site that matches the style of the book. I ask it to use the cover and other images in the site, and to link to the HTML, PDF, and ePub files in the output folder. Make sure it uses the metadata.yml and links to your own homepage if you like.

After you have created all this stuff, you need a place to publish it right? For me I use an amazing site called Puter.com . This is a site that lets you host all kinds of web based apps, run them in a simulated desktop environment, and even host websites and other things. You can even sync your files via webdav or just drag and drop files up via the simulated desktop environment.

Here’s the link to my latest novel which I have also made available via github: https://github.com/triptych/mothership and the book website: https://mothership-book.puter.site/

I have honed this technique after many many trials and errors, and this has worked the best for me.

The Library

After creating a few of these novels, I struggled to work out an easy way to share them. Each book has it’s own site, but there’s no real sharing between them and if you ran across one, you might never know any of the others exist. So taking another idea from my coding side of things, I created a master website that hosts links to all the other books. I call it The Library. As of this writing I have 34 novels there – some better than others and all of them are free for you to read, download, and share. They represent the realization of a dream I have had for a long time, but never have had the time or ability to complete.

Here’s the current list of books:

The Chaos Sword – A village girl bonds with an ancient, sentient sword

The Librarian's Index – A magical library with a living Index

Gears and Spirits – A tinker's tale of friendship and invention

The Dark Lord's Bed & Breakfast – A retired villain runs a B&B

A Witch on the Line – Thriller about a mysterious phone connection

The Enchanted Teahouse – Tea brewing becomes a gateway to magic

The Magical Herbalist's Apprentice – Plants that speak and ancient wisdom

Mistweaver – Tarot cards become powerful magical entities

Mountain Odyssey – Romantasy in treacherous magical peaks

Reborn as a Boat – Identity and friendship in an unexpected form

The Shrine Gentleman – A hunter becomes a shrine keeper

Starlight Salvage – Finding beauty in space junk

Stellar Tides – Magic and technology blend in floating islands

Suffer the Dragon – A monster healer instead of a hunter

The Fallen Star – Advanced technology versus corrupt sorcery

The Sigil – Multiverse adventures and cosmic mysteries

Nine Lives: A Servant of Anubis – Supernatural noir detective story

Bards of Discord – Rock music meets fantasy adventure

Nightwing Academy – Victorian steampunk shapeshifters

The Gateway – Guarding a magical portal to another realm

Dragon Crossing – A dragon and a boy switch bodies

The Last Vanguard – Science fantasy romance with AI

The Comprehensive Guide to the Best Inns and Outs – Journey of found family

Bramblewood – Romantic fantasy with elemental magic

Clarity – Dark sorceress finds redemption and love

The Unbroken – Ancient magic with a deadly price

A Familiar Feeling – Caring for abandoned magical creatures

Toy Wars – Romantic comedy with living toys

The Undead Groundskeeper – Gothic romance about curse-breaking

The Tower's Shadow – Identity and memory in dark fantasy

Cybrina – Corporate magic versus true witchcraft

The Lost Librarian – A librarian thrust into the real world

Fantasy House Flip – Retired adventurers flip cursed castles

Mothership – A colony ship AI transforms into a protective mother

Quirks

There were many interesting quirks that came up when I was working on these novels. The AI ( Claude Sonnet) would often use the same names for the characters across different books. For female leads it would often choose Lyra or Elara, and for males it would choose names like Kyle. Bad guys would sound like Malachar, or Mal- something. And for some reason it has an unreasonable love for adding a location called the Whispering Woods.

Another quirk in the AI was that it would often try to steer the storyline into a situation where the main character was just one of many of their kind, and that the story would try to establish a school to teach more folks like the main character become powerful. Another theme was that instead of having the good guy win or the bad guy win, the AI would try to seek some third option – a compromise between the two opposing sides ideas. It was very strange to see these things happen time after time. So if you need to have more unique storylines, I suggest you give your prompts advice to avoid those names and situations.

I hope you find this article interesting and I look forward to hearing about what you have learned from it.