Subagents

Book writer

Updated 6 Oct 2026

On this page

For agents

Load this page when: you need to know how books are written, edited or recovered

  • Use trove items append to add content and trove items put <id>:<page> to change one page.
  • Always pass --expect-version N to put, with the version from trove items get <id> --json.
  • After a refused write, read the book again, merge your change, and retry at most 3 times.

The book writer creates and edits Markdown books and manuscripts. It edits so that it never overwrites another writer's work.

SignalWhat happens
You say "write a book about..."The writer drafts an outline, then the book
You confirm a manuscript entryThe writer adds the entry
The manuscript is marked auto-updateThe writer adds the entry, then your agent shows a one-line notice
A write is refusedThe writer reads again, merges, and retries

What it does

The writer creates new books with trove items create and trove items import <file>. It edits existing books page by page. It shares the book with other writers, such as other sessions or a teammate's agent.

When it starts

  • You use a writing phrase, such as "write a book about", "add a section to" or "draft a manuscript".
  • You confirm a manuscript entry that your agent proposed.
  • A manuscript is marked auto-update. The writer gets the entry directly.

See Manuscripts.

How it edits without losing work

Another writer can change the book between your read and your write. A whole-book put would then delete their work. The writer follows three rules, in this order:

  1. Use trove items append to add content. An append is spliced in on the server, so it cannot conflict.
  2. Use trove items put <id>:<page> to change one page. Other pages stay untouched.
  3. Always pass --expect-version N to put. The version comes from trove items get <id> --json.

When a write is refused

A refusal means nothing was written. The writer then:

  1. Reads the book again.
  2. Applies its change to the fresh copy and keeps the other writer's content.
  3. Retries with the new version.

It retries at most 3 times. If the book still conflicts, the writer stops and tells you.

Check and undo

The writer compares trove items toc <id> before and after a write. Every title present before must still be present.

To undo, ask your agent: "Show the version history of my book, and restore the version before the last edit." A restore saves the current text first, so you can undo a restore too.

How a book is split into pages

Each # heading starts a new page. Headings at level two and below stay inside their page. A file sent to put <id>:<page> must hold exactly one # section.

Size caps

These caps are fixed. They are not plan limits.

  • A whole-document put is refused above 1 MB (HTTP 413). Use a page-level put or append instead.
  • A book holds at most 30 MB. Split a larger file into several parts, and ask your agent to import each part as its own book.

For upload limits per plan, see Plans and limits.

Auto-update manuscripts

An auto-update manuscript carries its own writing instructions. The writer reads them with trove ms show <id> --json and follows them exactly. It writes with page-level operations. It never deletes existing wiki content. It supersedes old content with a dated note.

What it never does

  • It never overwrites a book without a version check.
  • It never changes a book without your approval, except an auto-update manuscript.
  • It never hides a failed write. It reports the failure and the exact command.

Errors and fixes

ErrorFix
Item not foundAsk your agent to list your library and check the id.
trove: command not foundThe shell PATH is stale. Open a new terminal or run trove setup.
Not authenticatedRun trove auth login.
No content providedThe file is empty. Check the file, then ask your agent to try again.
413 Payload Too Large on put <id>The book is over the 1 MB cap. Use put <id>:<page> or append.
Content would split into N pagesThe page file has more than one # heading. Demote extra headings to ##, or use append.
409 modified concurrentlyAnother session wrote at the same moment. Ask your agent to read the page again and retry.
Page N not foundAsk your agent to show the table of contents of the book, to see the current page numbers.

Model and tools

The book writer runs on Opus. It uses Bash, Read and Write.

Best practice

Write each chapter as an explanation followed by "Rules for agents", with RULE, WHY and APPLY lines. Use one # heading per page. Ask your agent to edit one page at a time, so that each edit has a version check. See Write books agents can read and Write a book. For manuscripts, each manuscript sets its own approval rule. See Manuscripts that stay useful.

Direct CLI

Your agent runs these through the trove command. You can run them yourself in a terminal, but asking your agent is the recommended way: it picks the right flags, waits for processing and checks the result.

TaskCommand
Create a book from a filetrove items import <file>
Add contenttrove items append <id> --file <file>
Change one pagetrove items put <id>:<page> --expect-version N
See the versiontrove items get <id> --json
See the page numberstrove items toc <id>
Review and undo editstrove items history <id>, then trove items restore <id> --version N

See the CLI reference.

Related

    Book writer | Trove