Count real store visitors by subtracting the agent's own page views

Sungsoo Youn's daily Claude Code agent logs every product page it opens so the store's visit counts can be cleaned; the fix showed at least 17 outside visitors in a week, not the 95 the old method claimed.

Done withClaude Code· Oct 25, 2026

What they did

Youn runs an autonomous Claude Code agent every day on one Windows PC, with a CLAUDE.md, memory files and a separate auditor agent that returns pass or fail. Youn sells a Korean book as 15 products on one store, and each evening the agent saves the store's 7-day visit count per product. Because the agent's own checks open those pages, a meter has to subtract its visits. The old meter used the lowest product count as the agent's share. From 5 October the agent also kept a ledger of every product page it opened, and on 12 October the meter switched to subtracting that ledger product by product.

How it went

The estimate fell from 95 outside visitors to 7, because three products came out negative and cancelled the positives. The agent wrote 8 tests first (7 failed on the old code), then clamped each product at zero and saved the ledger total at the moment of each snapshot. The auditor rejected the first pass for testing the judge only by searching its source; a real test was added and all 3,355 tests passed. The corrected lower bound was 17 outside visitors out of 209 visits, against 104 under the old method.

Worth knowing

The agent's own activity can swamp a small metric: on 12 October it opened product pages 74 times, against about 21 a day the week before, enough to move a weekly traffic goal of 240. The author sells a book about this setup.

Try it

With Claude Code· 3 parts to fill in

Each evening, record the [store or analytics tool] visit counts for each of my [products or pages] over the last [7 days]. Keep a ledger of every time you open one of those pages yourself, and save the ledger total at the same moment as each snapshot. Estimate outside visitors per page as store visits minus your own opens, counting any negative result as zero, and report the total as a lower bound with your own opens on a separate line. Write tests for the calculation before changing it, and stop to show me the numbers before you change any goal or report built on them.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related