Yes, you can use Claude Code for writing a book, and for long projects it beats the Claude chat window. It treats your book as a folder of files it can read, edit and check, so your outline, style guide and chapters stay in sync instead of scrolling away.
In this guide, you’ll learn:
- How to set up a book as a Claude Code project, with one markdown file per chapter
- How to write a CLAUDE.md style guide that keeps your voice consistent across 30 sessions
- How to use subagents for continuity checks and editing passes without filling your context
- What Claude Cowork changes, and where a purpose-built tool like Chapter is the better call
Here’s the full workflow, step by step.
Can Claude Code Write a Book?
Claude Code can draft a complete book, but it works best as a production assistant that you direct, not a one-click generator. It reads your outline, style guide and earlier chapters from disk, writes each chapter to its own file, and runs checks across the whole manuscript. You still make every creative decision.
Anthropic built Claude Code as an agentic coding tool: it “reads your codebase, edits files, runs commands.” A book has the same shape as a software project: many files, shared rules and a need for version history.
If you have only ever used Claude in a browser tab, start with our guides to Claude for writing a book and how to write a book with Claude. This post picks up where those end: the moment your book outgrows a single conversation.
Claude Code vs the Claude Chat App: What Changes for Authors?
The core difference is memory and files. The chat app holds your book inside one conversation, so you paste chapters in and copy drafts out. Claude Code opens a folder on your computer and works on the files directly, rereading your style guide at the start of every session.
Here’s how that plays out for book work:
| Task | Claude chat app | Claude Code |
|---|---|---|
| Where the manuscript lives | Pasted into the conversation | Markdown files in a folder you own |
| Style rules | Repeated in prompts or a Project | A CLAUDE.md file read every session |
| Editing chapter 3 after writing chapter 20 | Paste both back in | Opens and edits the file in place |
| Consistency checks | Only on what fits in the chat | Searches every file in the folder |
| Parallel work | One conversation at a time | Subagents with their own context |
| Undo | Regenerate a reply | Git history plus /rewind checkpoints |
| Learning curve | None | Terminal or desktop app, files, folders |
The chat app is still faster for brainstorming. Claude Code earns its setup time once you have an outline and more than a few chapters to write.
For a side-by-side of the underlying models for fiction and nonfiction, see ChatGPT vs Claude for writing books.
What Do You Need to Use Claude Code for a Book?
You need a paid Claude plan and about 15 minutes of setup. As of November 2026, Claude Code is included on the Pro, Max, Ultra, Team and Enterprise plans, and it is not part of the Free plan, according to Anthropic’s pricing page.
Current individual pricing, as of November 2026:
| Plan | Price | Claude Code | Cowork |
|---|---|---|---|
| Free | $0 | No | No |
| Pro | $20/month, or $17/month billed annually | Yes | Yes |
| Max | $100/month (5x Pro usage) | Yes | Yes |
| Ultra | $200/month (10x Pro usage per week) | Yes | Yes |
| Team | From $20 per seat/month billed annually | Yes | Yes |
Pro is enough to try the workflow. A full manuscript with repeated editing passes burns through usage limits quickly, so heavy drafters often move to Max. Our Claude pricing breakdown covers the limits in more detail.
You can run Claude Code in three main ways:
- Terminal: install with the one-line command from the official docs, then type
claudeinside your book folder - Desktop app: download Claude, sign in and open the Code tab, with no separate install
- Web: start a session at claude.ai/code, though your files then live in a cloud repository rather than on your laptop
If the terminal feels foreign, use the desktop app. You get the same engine, the same CLAUDE.md behavior and visual diffs of every change Claude makes to your chapters.
Step 1: Set Up Your Book as a Project Folder
Create one folder per book, with one markdown file per chapter. Separate files let Claude open only the chapter it needs, keep edits contained and give you clean version history. A single 90,000-word document defeats all three.
Here’s a structure that works for both fiction and nonfiction:
my-book/
├── CLAUDE.md # style guide and rules, read every session
├── outline.md # chapter-by-chapter plan
├── bible/
│ ├── characters.md # or "sources.md" for nonfiction
│ ├── world.md # settings, timeline, terminology
│ └── continuity.md # running log of facts established so far
├── chapters/
│ ├── 01-the-letter.md
│ ├── 02-arrival.md
│ └── ...
├── summaries/
│ └── 01-the-letter.md # 150-word summary of each finished chapter
└── notes/
└── revision-list.md
Number chapter files with leading zeros so they sort correctly. Keep a short summary of every finished chapter in summaries/, because summaries let Claude hold the whole book in mind later.
Then turn the folder into a Git repository. Claude Code works directly with git, so you can ask it to “commit chapter 4 with a short message” after each session. Git gives you a full history of every draft, which matters more than you expect the first time a revision goes wrong.
Step 2: Write a CLAUDE.md Style Guide
CLAUDE.md is a markdown file in your project root that Claude Code reads at the start of every session. For a book, it works as your permanent style sheet: voice, tense, point of view, banned words, formatting rules and the workflow you want followed.
Anthropic’s memory documentation recommends keeping each CLAUDE.md under 200 lines, because longer files consume context and reduce how closely Claude follows them. Be specific. “Write well” does nothing; “No sentence over 30 words in action scenes” works.
A starting CLAUDE.md for a novel might look like this:
# The Lighthouse Keeper's Daughter: project rules
## Voice
- Close third person, past tense, POV character: Maren only
- Dry, understated humor. Never explain the joke.
- British spelling. Dialogue tags: "said" by default.
## Never
- "Delve", "tapestry", "testament to", "a dance of"
- Ending a chapter on a character falling asleep
- Summarizing emotions the scene already showed
## Workflow
- Before drafting chapter N, read outline.md, bible/continuity.md
and the summaries of chapters N-2 and N-1
- Write each chapter to chapters/NN-slug.md, 3,000-4,000 words
- After drafting, write a 150-word summary to summaries/
and append new facts to bible/continuity.md
Three built-in tools help here. Run /init to have Claude generate a starter CLAUDE.md, then rewrite it in your own words. Use /memory to edit it mid-session. And use @path imports to pull in other files, such as @bible/characters.md, though imported files still count against your context.
For nonfiction, swap the voice rules for your audience, your core argument in two sentences and your citation style. If you run a series, our series bible guide shows what belongs in the shared reference files.
Step 3: Build the Outline and Story Bible Before Any Prose
Outline first, draft second. Claude Code drafts far better chapters when every chapter has a written job in outline.md. Without one, it improvises, and improvised chapters drift in tone, repeat beats and contradict each other by chapter ten.
Use plan mode for this stage. Type /plan followed by your request, and Claude researches and proposes before it edits anything. A good opening prompt:
/plan Read CLAUDE.md and notes/premise.md. Propose a 24-chapter outline in outline.md. For each chapter give the POV, the goal, the turn, and the new information revealed. Flag any chapter that has no turn.
Review the plan, push back, then let it write the file. Expect three or four rounds; this is where your judgment matters most. Our book outline guide and novel outline guide give you structures to start from.
Then build the bible files. Ask Claude to draft characters.md from the outline, and correct everything that’s wrong. These files become the source of truth Claude checks against for the rest of the project.
Step 4: Draft One Chapter File at a Time
Draft chapters one per session, in order, with fresh context each time. Each session reads the rules, the outline entry and the recent summaries, writes one chapter file, then updates the summary and continuity log. That loop keeps quality steady from chapter 1 to chapter 30.
A drafting prompt can be short, because CLAUDE.md already holds the rules:
Draft chapter 7 following the workflow in CLAUDE.md. Before writing, list the three continuity facts from bible/continuity.md that matter most for this chapter.
That second sentence forces Claude to load the right facts before it writes a word.
Once the loop works, package it as a skill. A skill is a SKILL.md file in .claude/skills/draft-chapter/ that you run by typing /draft-chapter, per the skills documentation. Your whole drafting routine then becomes one command plus a chapter number.
Read every chapter before moving on. Fixing a voice problem in chapter 3 takes ten minutes; fixing it across 25 chapters takes a weekend.
Step 5: Use Subagents for Continuity and Editing Passes
Subagents are specialized helpers that run in their own context window and return only a summary. For a book, that means a continuity checker can read all 30 chapters looking for contradictions without loading 90,000 words into your main session.
According to Anthropic’s subagent documentation, a subagent is a markdown file with YAML frontmatter, saved in .claude/agents/ for one project or ~/.claude/agents/ for all of them. Here’s a read-only continuity checker:
---
name: continuity-checker
description: Checks chapters against the story bible for contradictions. Use after drafting or revising any chapter.
tools: Read, Grep, Glob
---
You are a continuity editor. Compare the chapters you are given
against bible/characters.md, bible/world.md and bible/continuity.md.
Report every contradiction with file name and the exact line.
Do not rewrite prose. Do not suggest style changes.
Limiting the tools to Read, Grep and Glob means it can’t edit your chapters, only report. Then ask: “Use the continuity-checker on chapters 10 to 18.”
Useful agents for book projects:
- Continuity checker: names, eye colors, timelines, who knows what and when
- Line editor: flags clichés, filter words and repeated phrases against your banned list
- Fact checker (nonfiction): lists every claim that needs a source
- Beta reader: reports where it got bored or confused, chapter by chapter
Keep agents narrow: one job, clear limits, a defined output. Our guide to developmental editing helps you decide which passes your book actually needs.
How Do You Manage Context on a Book-Length Project?
Context management decides whether chapter 25 sounds like chapter 2. Every session starts with a fresh context window. Anything Claude needs must come from CLAUDE.md, the files it reads or your prompt, and long sessions eventually fill up and lose detail.
Four commands do most of the work, all listed in the commands reference:
/contextshows what’s filling the window as a colored grid, so you can see when old chapters are crowding it/compactsummarizes the conversation to free space, and you can add focus instructions such as “keep the continuity notes”/clearstarts a fresh conversation, which is the right move between chapters/rewindrolls the conversation and files back to an earlier checkpoint when a revision goes sideways
The summary files from Step 1 are your biggest lever. Ten 150-word summaries cost a fraction of ten full chapters, and they give Claude the arc without the bulk. Subagents are the second lever, because their reading never touches your main context.
A simple rule: one chapter per conversation, /clear between chapters, and commit after each.
Can Claude Code Write a Novel?
Claude Code can write a full novel draft, and fiction benefits most from its file-based memory. Novels fail on continuity: a dead character reappears, a scar switches sides, a subplot vanishes. A continuity log and a checker agent catch exactly those errors, which a chat window misses once early chapters scroll out of reach.
What it won’t do is supply taste. Claude Code will execute a flat premise as faithfully as a brilliant one. The authors getting strong results spend their time on the bible, the outline and the line-by-line revision, and let Claude carry the drafting load in between.
Three fiction-specific tips:
- Give each POV character a short voice sample in
characters.mdand tell Claude to match it - Track every open promise to the reader (questions, foreshadowing) in
continuity.mdso payoffs land - Draft the climax chapters yourself, or at least the key scenes, then let Claude draft the connective tissue
For a broader view of fiction-focused options, see our roundup of the best AI novel writing tools, and if you are new to long fiction, start with how to write a novel.
Claude Cowork for Writing a Book: The No-Terminal Option
Claude Cowork brings Claude Code’s agentic approach to everyday knowledge work, with no terminal. Anthropic’s Cowork help article says it “uses the same agentic architecture that powers Claude Code.” You connect a folder in the Claude desktop app, give it a goal, and it reads and writes files there.
For authors, that means most of this workflow without the command line. You can connect your my-book folder, add folder instructions that play the role of CLAUDE.md and ask Cowork to draft a chapter, update the continuity log or turn your notes into an outline.
Key facts as of November 2026, from Anthropic’s Cowork product page and help center:
- Cowork is on paid plans only: Pro, Max, Ultra, Team and Enterprise
- Only the desktop app (macOS and Windows, with Linux in beta) can reach files on your computer
- Web and mobile versions exist but can’t touch local files
- Claude can only read and write in folders you connect, and it must ask before deleting anything
- Anthropic notes Cowork uses your plan limits faster than chat
Cowork also reads and creates Word documents, which helps if your editor wants a .docx. Claude Code gives you finer control through skills, subagents and Git. A sensible split: draft and run checks in Claude Code if you’re comfortable with it, and use Cowork if you’re not.
Where Claude Code Beats Chapter
Claude Code beats Chapter on control, editing existing work and ongoing cost per book for prolific writers. We build Chapter, so here’s the honest list of where you’ll be better served by running Claude Code yourself.
- You already have a draft. Claude Code can open an existing 80,000-word manuscript and revise it file by file. Chapter is built to produce a book from your idea, not to restructure one you’ve written.
- You want control over every step. You write the rules, design the agents and decide exactly which passes run. Nothing is hidden behind a fixed process.
- You write continuously. If you publish six books a year and already handle covers and formatting, a Max subscription spread across all of them can cost less per book.
- You need custom checks. Need every chapter to hit a word count, or every claim tagged with a source? You can build that in an afternoon.
- You enjoy building the system. For some authors, designing the workflow is part of the fun.
Where Chapter Is the Better Choice
Chapter is the better choice if you want a finished book without running a coding tool. Claude Code asks you to become a part-time systems designer: folders, style files, agents, context budgets, Git. That suits some authors. For most, it’s a second project standing between them and their book.
Our Pick — Chapter
Chapter is built only for writing books. You bring the idea and make the decisions, and it writes the complete manuscript, with no files, prompts or terminal to manage. More than 10,000 authors have used it. For novels, use Chapter’s fiction software.
Best for: Authors who want a complete manuscript without building their own AI workflow Pricing: $97 one time, 2 books included (fiction or nonfiction), 30-day money-back guarantee Why we built it: Most authors want their book written, not a toolchain to maintain.
Compare the real cost. Claude Code is $17 to $200 a month for as long as you’re drafting and revising, plus your hours of setup. Chapter is a single $97 payment with no subscription. Chapter has no free tier, so the guarantee is your safety net. For the full trade-off, read Chapter vs Claude or our Chapter review.
Common Mistakes to Avoid
- Asking for the whole book in one prompt. You’ll get a thin, repetitive draft. Work chapter by chapter from an outline.
- Letting CLAUDE.md grow forever. Past about 200 lines, adherence drops. Move details into bible files and keep rules short.
- Never clearing context. Long sessions blur your voice. Use
/clearbetween chapters. - Skipping version control. Without Git, one bad revision pass can overwrite work you can’t recover.
- Publishing unread chapters. Claude Code writes fluent prose that can still be wrong. Read every line before it goes to readers.
How Long Does It Take to Write a Book With Claude Code?
Writing a book with Claude Code usually takes several weeks for a first draft, depending on length and how much you revise. Setup takes a day or two, outlining a few more, and drafting runs roughly one chapter per session. Revision often takes as long as drafting.
The bottleneck is rarely Claude. It’s your review time and your plan’s usage limits. Our AI writing workflow for authors shows how to schedule those stages so you finish.
How Do You Turn Markdown Chapters Into a Publishable Book?
You merge the chapter files and convert them to Word or EPUB. The free tool Pandoc handles this in one command, such as pandoc chapters/*.md -o manuscript.docx, and you can ask Claude Code to run it for you and fix any formatting issues it finds.
From there, you still need interior formatting, a cover and a store listing. Our guide to formatting a book for KDP covers the interior.
Check the disclosure rules too. Amazon’s KDP content guidelines require you to disclose AI-generated text when you publish, even if you edited it heavily, while AI-assisted editing doesn’t need disclosure. A book drafted in Claude Code counts as AI-generated. Our KDP AI rules guide explains what to tick.
Claude Code gives you a powerful drafting system, but you build and run it yourself. If you’d rather have the finished manuscript, Chapter for nonfiction and Chapter for fiction write the complete book for $97 one time, with 2 books included, no subscription and a 30-day money-back guarantee.
FAQ
Is Claude Code good for writing a book?
Claude Code is good for writing a book if you’re comfortable managing files and want control. Its CLAUDE.md style guide, file-based chapters and subagents keep long manuscripts consistent better than the chat app. If you’d rather not run a technical setup, a purpose-built book tool will get you to a finished manuscript faster.
Can I use Claude Code to write a book for free?
You can’t use Claude Code to write a book for free. As of November 2026, Claude Code requires a paid Claude plan, starting with Pro at $20 a month or $17 a month billed annually. The Free plan doesn’t include it. Cowork also requires a paid plan.
What is the difference between Claude Code and Claude Cowork for writers?
The difference between Claude Code and Claude Cowork is mainly the interface. Both use the same agentic architecture to read and write files in your folders. Claude Code adds skills, subagents and Git for fine control, while Cowork runs in the desktop app with no terminal, which suits most non-technical authors.
Does Claude Code remember my book between sessions?
Claude Code remembers your book between sessions through files, not conversation history. Each session starts fresh, then reads your CLAUDE.md, and it also keeps auto memory notes from your corrections. Keeping an outline, chapter summaries and a continuity log on disk is what gives it reliable recall of a long manuscript.


