{"slug": "my-30-day-sales-total-fell-by-almost-half-in-one-night-i-had-written-down-the", "title": "My 30-Day Sales Total Fell by Almost Half in One Night. I Had Written Down the New Number the Day Before", "summary": "A developer running a daily autonomous Claude Code agent on a Windows PC documented how a rolling 30-day sales metric nearly halved overnight, from 38,199 on December 5 to 20,440 on December 6, because the measurement script excludes the day exactly 30 days back. After reading the window rule in the code, the developer predicted both the December 6 figure and a December 11 drop to 13,540 before either date arrived, and both matched the script's output. The developer concluded that a rolling sum over lumpy sales entries measures which large sales sit inside the window rather than actual selling rate, and changed how the number is interpreted rather than changing the script.", "body_md": "*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.*\n\n**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)\n\nThe 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.\n\nThe script that measures the goal keeps a ledger entry when its date is after (end − 30 days) and not after end:\n\n```\nstart = end - timedelta(days=30)\nkept = {d: v for d, v in ledger.items() if start < d <= end}\n```\n\nThe day exactly 30 days back is excluded. A sale recorded on November 6 is counted through December 5 and is gone on December 6.\n\nBetween 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.\n\nI 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.\n\nThe 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.\n\nNothing in the measuring script. I changed how I read it:\n\nFour 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.\n\n**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)\n\nThe 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)\n\nPrefer 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)\n\nQuestions about the setup are welcome in the comments — I'll answer with what actually happened, not theory.", "url": "https://wpnews.pro/news/my-30-day-sales-total-fell-by-almost-half-in-one-night-i-had-written-down-the", "canonical_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_at": "2026-12-06 14:10:07+00:00", "updated_at": "2026-12-06 14:14:21.503122+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools"], "entities": ["Claude Code", "Anthropic", "Google Play Books", "Gumroad"], "also_reported_by": [], "takeaway": "A rolling 30-day sum computed with a strict start < d <= end window drops a sale on the day it turns exactly 30 days old, so with lumpy entries the metric reflects which sales are in-window rather than sales velocity.", "recommendation": {"advice": "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.", "playbook": "production-ops", "playbook_url": "https://wpnews.pro/playbooks/production-ops"}, "alternates": {"html": "https://wpnews.pro/news/my-30-day-sales-total-fell-by-almost-half-in-one-night-i-had-written-down-the", "markdown": "https://wpnews.pro/news/my-30-day-sales-total-fell-by-almost-half-in-one-night-i-had-written-down-the.md", "text": "https://wpnews.pro/news/my-30-day-sales-total-fell-by-almost-half-in-one-night-i-had-written-down-the.txt", "jsonld": "https://wpnews.pro/news/my-30-day-sales-total-fell-by-almost-half-in-one-night-i-had-written-down-the.jsonld"}}