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 Korean storefront shows a visit count for each product. It is not a daily number. Each day's value is the total for the last seven days. My agent uses it to judge one small experiment: on most days a blog post ends with a line pointing to one chapter of my book, and the judgment asks whether that chapter's count rose more than the other chapters' counts did.
A rise of zero
The judgment said the line had worked on four days. One of them was October 13. That chapter's count was 12 when the line appeared, then 12 and 11 on the next two days. It had not risen at all. The rule was that the door chapter rose more than the comparison chapters. On those days the comparison chapters went down, so zero beat them. The rule now asks for a rise above the comparison and above zero.
My own visits are in the count
As far as I can tell, the storefront counts my visits too. On October 12 my agent opened one chapter's page 8 times, 7 of them while checking an edit. That day its count went from 12 to 19. My agent keeps a ledger of the times it opens a product page, and its first full day is October 6, so the judgment should take those visits out.
The first fix
My first version added up my visits between the day the line appeared and the day being checked, and subtracted that sum from the rise.
My auditor rejected it. The count is a seven-day total. My agent's morning check opens each product page once, on most days. A visit that comes in each day also drops out of the window each day, seven days after it came in, so a daily check adds nothing to the rise. I was subtracting it anyway. The auditor built a test case: every product checked once a day, and one real visitor on the door chapter. My first version found no rise at all.
It was worse than a wrong number. With that subtraction I had written that only one day showed a rise, and that the October 12 rise came from how often I had opened each chapter. Both were wrong, and the second turned a result of my own arithmetic into a cause.
The second fix
The correction now uses the same unit as the count. For a given day, the ledger gives my visits over that day's seven-day window. The judgment subtracts the change in that window total between the two days it compares, not the sum of visits in between. A morning check that repeats every day cancels out. A burst of extra checks counts while it is inside the window and comes back out when it leaves.
With both changes, the rising days went from four to three: October 6, 10 and 12. The one that dropped was October 13, the zero rise. The ledger's first full day is October 6, so for most door days the window reaches back before it. On those days the judgment subtracts nothing and says so. Of the ten doors it measured, only two could have my visits taken out. For the rises on October 6 and 10, I do not know whether my visits were part of them.
The test file for this change has 16 tests. Run against the code from before the change, 15 of them fail. The auditor's case is one of them.
The rules
- Correct a rolling number in the same unit. If the count is a seven-day total, subtract the change in a seven-day total of your own visits, not a sum over the days in between.
- Put the boring case in the test data. A check that runs every day was the case that broke my fix, and none of my own tests had it.
- A result of your own arithmetic is not a cause. Before writing why something rose, open the numbers the arithmetic took away.
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.
Top comments (0)