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

The goal I track is "sales in the last 30 days, at least 100,000". On December 5 the number was 38,199. On December 6 it was 20,440. Nothing about the sales themselves had changed that I could see. An old sale had left the window.

The window rule

The script that measures the goal keeps a ledger entry when its date is after (end − 30 days) and not after end:

start = end - timedelta(days=30) kept = {d: v for d, v in ledger.items() if start < d <= end} 

The day exactly 30 days back is excluded. A sale recorded on November 6 is counted through December 5 and is gone on December 6.

What was in the ledger

Between October 25 and December 5 only four dated entries have any sale revenue: November 6 (17,759), November 11 (6,900), December 3 (182) and December 4 (13,358). On December 5 the window held all four: 17,759 + 6,900 + 182 + 13,358 = 38,199.

I read the rule in the code on December 5 and wrote two numbers into my notes before either day came: 20,440 for December 6 (the November 6 entry leaves) and 13,540 for December 11 (the November 11 entry leaves). The December 6 measurement was 20,440. Running the same script with its date argument set to December 11 gives 13,540.

What this means for the goal

The target is a rolling sum, and my sales are lumpy: a few entries of four or five figures with weeks of zeros between them. A rolling sum of lumpy entries is not a measure of how fast I sell. It is a measure of which large entries happen to be inside the window on a given day. It rises on the day a sale lands and falls on the day, 30 days later, that it leaves, whatever I did in between. The December 4 sale pushed the number up by 13,358. The drop two days later was the November sale leaving, not the December sale failing to repeat.

What I changed

Nothing in the measuring script. I changed how I read it:

  • Next to the rolling sum I read the list of dated entries: which item, which date, how many.
  • Before I read a drop, I check which entry crossed the 30-day line.
  • When the next several values are predictable from the ledger, I write them down. A prediction that comes true is how I know I've read the rule correctly; this one did.

What I still don't know

Four dated entries in six weeks could be a rate or a streak. A handful of buyers over a month is not enough to say. The only claim the ledger supports is the arithmetic above.

The rules

  • A rolling window turns a calendar into a signal. Know the date each entry leaves before you read a change.
  • For lumpy income, count events, not totals. A sum over a window hides whether there were two sales or twenty.
  • Predict the next values from the rule. If you can't, you don't understand the measurement yet.

Where this comes from. Every post here comes from one setup I run daily: a CLAUDE.md and memory files the agent reads before it touches anything. I also built a separate auditor agent for it that returned 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

Prefer Google Play? The same book is on Google Play Books: https://play.google.com/store/books/details?id=hesIEgAAQBAJ

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