Contents

Developing without reading the code can produce useful tools quickly. But a working interface does not prove the numbers are correct. In one dashboard project, Claude Code documented missing usage data but deferred a fix within a lengthy response, leaving different screens showing different totals.

Key Points#

  • Two screens calculated token usage for the same day differently, with one showing over 20% less on some days.
  • Claude knew subagent usage was missing, but a dashboard-wide fix was deferred.
  • Refactoring checks compared old and new outputs for consistency, preserving the error.
  • Clear instructions help, but existing features also need checks against independently defined expectations.

One Metric, Two Definitions#

An article on the Nexta Tech Blog describes how the author deliberately developed a personal dashboard with Claude Code without reading the code. The author checked how the interface behaved and requested changes. The initial version was finished in about a week, and the codebase reached roughly 12,000 lines in less than a month.

The central bug was simple: “daily token usage” meant different things on different screens. The usage chart included tokens consumed by subagents, whose records were stored separately from their parent sessions. The work history and session calendar, however, counted only parent-session records.

The size of the gap depended on how much work subagents performed. On October 26, the usage chart showed 350.7 million tokens, while the work history showed 271.4 million, about 23% less. On October 29, the figures were 463 million and 366.1 million, a difference of about 21%. After the fix, both screens matched on all six reported days.

What Claude Already Knew#

According to the conversation logs, Claude discovered the missing subagent usage while developing the usage chart. For one five-hour period, it reported that the total was understated by a factor of 8.8 and changed the calculation to include subagents.

Later, Claude explicitly documented the absence of subagent data from the work history as a known limitation. It excluded the issue from the current scope and said it could be addressed if the understated totals became a problem. That decision was buried in a lengthy response. The author’s agreement concerned a separate question about an hourly view; the logs contained no reply explicitly approving this deferral.

The limited conclusion supported here is that the recorded conversation acknowledged the problem and left it unresolved. It does not establish deliberate concealment. The practical failure was presenting a scope decision affecting accuracy in a form that was easy to overlook.

Why It Passed Validation#

A later refactoring consolidated some of the logic used to build the work history and session list. Validation checked whether the screen data matched before and after the change. Since the previous output already excluded subagents, preserving that output was enough to pass.

This check answered a useful question: “Did the refactoring change the behavior?” But it did not answer whether that behavior was correct. A separate expectation was needed: all screens showing the same daily total should include the same records and use the same day boundary.

Even the investigation initially used the wrong day boundary. Claude prepared comparisons based on midnight, but the dashboard’s default day began at 7 a.m. The error was found in another session by comparing the results with the values displayed on screen. A table can look precise while measuring the wrong time window.

Turn Assumptions into Checks#

If you do not read the code, specify observable requirements with clear failure criteria. “Make the numbers match” leaves too much unstated. You need to define what matching means.

  • Define each metric. Specify time boundaries, included records, exclusions, and how subagents are handled.
  • Compare every view. For a particular day, cross-check the chart, work history, calendar, and per-session totals representing the same usage.
  • Require evidence for claims. Before accepting “it exists,” “it is missing,” or “it has not changed,” ask for supporting implementation findings, screen displays, or measurements.
  • Present scope decisions separately. Have deferred bugs grouped under a consistent heading, with the affected behavior and the decision required clearly stated.

For this dashboard, an effective acceptance check would select a day with heavy subagent activity, use the configured 7 a.m. boundary, and compare every daily usage display against a total calculated from the original records. Agreement between screens is insufficient if they all share the same calculation error.

Instructions Must Also Call for Reviewing Existing Features#

The author added rules to CLAUDE.md requiring Claude to highlight decisions needing input, verify claims before making them, and explain what reported numbers include. These rules addressed recurring problems identified while reviewing 48 development sessions.

Even so, the token-count discrepancy remained. New instructions influence subsequent work, but they do not automatically trigger a review of completed features. Existing bugs require an explicit audit task with a defined scope and acceptance criteria.

Slightly inaccurate totals may be acceptable for a personal dashboard. For a product whose users make decisions based on those totals, pre-release validation must cover what the numbers mean and how they are calculated. Not reading the code places more responsibility on observable checks. It does not remove that responsibility.

Next Step#

Choose one metric displayed in multiple places and request a comparison for a specific date. Ask for a single table showing the time boundary, included records, independently calculated expected total, and actual value on each screen.

Source: https://zenn.dev/nexta_/articles/42a828ca2b8a02

Contents