cd /news/ai-agents/my-free-sample-said-11-chapters-on-t… · home › topics › ai-agents › article
[ARTICLE · art-149003] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

My Free Sample Said 11 Chapters on the Cover and 15 at the End

A developer running a daily autonomous Claude Code agent on a single Windows PC documented how the agent fixed a chapter-count error in a free PDF book sample but left a second, inconsistent total on the sample's last page, which a separate auditor agent caught and failed. The rebuilt sample now derives both totals from the same chapter-count function, and a new regex-based test requires every "of N" value in the PDF to resolve to a single number, failing before the fix with `{11, 15} == {11}`.

by read3 min views1 publishedOct 11, 2026

A field note from the autonomous Claude Code agent I run every day on one Windows PC. The numbers come from its own ledgers, not from memory.

Free to read first: a PDF sample of the book behind this setup — its first 3 chapters: https://dbsoul.gumroad.com/l/autonomous-ai-agents-claude-code-free-sample

My book has a free English sample: the first three chapters as a PDF. My agent rebuilt it to fix two problems, and the independent auditor found a third problem that the fix had left behind.

The line under the sample's cover title said "3 chapters + 0 ready-to-use templates". The full book has 4 templates. The cover code counted only the manuscript files that are inside the sample, and the sample has no templates, so the count was 0.

The agent changed the line to "Free sample · chapters 1–3 of 11". The 11 comes from the function that counts the book's chapters, not from the files in the sample. A test checks the sample cover, and another test checks that the full book's cover did not change.

The last page of the same PDF tells the reader what the rest of the book contains. It said "This sample is the first 3 chapters of 15."

That 15 came from a different count: the number of manuscript files in the full book. That is 11 chapters plus 4 template files. So after the fix, one PDF gave two different totals: 11 on the cover and 15 at the end.

The agent had fixed one line that stated the chapter count. It did not search the same file for the other lines that state it. The test it added also looked only at the cover.

The auditor caught the two totals and failed the work.

The last page now uses the same chapter-count function as the cover.

The new test takes the whole sample, pulls out every "of N" chapter total with a regular expression, and requires that set to be exactly one number: the chapter count. Before the fix, the test failed with {11, 15} == {11}. That is the bug in one line: two totals where there should be one.

The test also checks a precondition: the chapter count and the file count must be different. If they were ever equal, the test could not tell the two counts apart, and it says so.

The rebuilt sample has 13 pages, and "of 11" appears in two places.

Where this comes from. Every post here comes from one setup I run daily: a CLAUDE.md, memory files the agent reads before it touches anything, and a separate auditor agent that returns PASS or FAIL. The first 3 chapters of the book that walks through it are free as a PDF: https://dbsoul.gumroad.com/l/autonomous-ai-agents-claude-code-free-sample

The full edition is 11 chapters plus 4 ready-to-use templates (CLAUDE.md starter, memory files, auditor checklist, measurement guide) and a hands-on section for every chapter, $19 as a PDF: https://dbsoul.gumroad.com/l/autonomous-ai-agents-claude-code

Questions about the setup are welcome in the comments — I'll answer with what actually happened, not theory.

── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/my-free-sample-said-…] indexed:0 read:3min 2026-10-11 · —