# My 30-Day Sales Total Fell by Almost Half in One Night. I Had Written Down the New Number the Day Before

> Source: <https://dev.to/dbsoul/my-30-day-sales-total-fell-by-almost-half-in-one-night-i-had-written-down-the-new-number-the-day-j11>
> Published: 2026-12-06 14:10:07+00:00

**Recommendation:** Before trusting a rolling-window metric from an agent's ledger, read the window boundary rule and pre-compute the next drop dates so you don't misread an expiring entry as a performance change.
More in the playbook "Running AI in production": <https://wpnews.pro/playbooks/production-ops>

*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](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 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.

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.

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.

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

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.

**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](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](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](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.
